[PATCH 10/15] hw/pci-host/q35: Improve blackhole_ops

Richard Henderson posted 15 patches 4 years, 7 months ago
Maintainers: Jason Wang <jasowang@redhat.com>, Hannes Reinecke <hare@suse.com>, "Michael S. Tsirkin" <mst@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Laurent Vivier <laurent@vivier.eu>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Dmitry Fleytman <dmitry.fleytman@gmail.com>, Fam Zheng <fam@euphon.net>
[PATCH 10/15] hw/pci-host/q35: Improve blackhole_ops
Posted by Richard Henderson 4 years, 7 months ago
There is nothing about the blackhole that requires 4 byte
operations.  Decrease the min size to 1, increase the max
size to 8.  Drop duplicate endianness spec.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 hw/pci-host/q35.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 2eb729dff5..133be67e4f 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -268,7 +268,7 @@ static const TypeInfo q35_host_info = {
 
 static uint64_t blackhole_read(void *ptr, hwaddr reg, unsigned size)
 {
-    return 0xffffffff;
+    return UINT64_MAX;
 }
 
 static void blackhole_write(void *opaque, hwaddr addr, uint64_t val,
@@ -282,10 +282,9 @@ static const MemoryRegionOps blackhole_ops = {
     .write = blackhole_write,
     .endianness = DEVICE_NATIVE_ENDIAN,
     .valid.min_access_size = 1,
-    .valid.max_access_size = 4,
-    .impl.min_access_size = 4,
-    .impl.max_access_size = 4,
-    .endianness = DEVICE_LITTLE_ENDIAN,
+    .valid.max_access_size = 8,
+    .impl.min_access_size = 1,
+    .impl.max_access_size = 8,
 };
 
 /* PCIe MMCFG */
-- 
2.25.1


Re: [PATCH 10/15] hw/pci-host/q35: Improve blackhole_ops
Posted by Philippe Mathieu-Daudé 4 years, 7 months ago
On 6/19/21 7:26 PM, Richard Henderson wrote:
> There is nothing about the blackhole that requires 4 byte
> operations.  Decrease the min size to 1, increase the max
> size to 8.  Drop duplicate endianness spec.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  hw/pci-host/q35.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>