qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] msix: allow qword MSI-X table accesses
@ 2020-05-14 15:16 Michael S. Tsirkin
  2020-05-14 18:42 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 2+ messages in thread
From: Michael S. Tsirkin @ 2020-05-14 15:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: jusual

PCI spec says:

For all accesses to MSI-X Table and MSI-X PBA fields, software must use
aligned full DWORD or aligned full QWORD transactions; otherwise, the
result is undefined.

However, since MSI-X was converted to use memory API, QEMU
started blocking qword transactions, only allowing DWORD
ones. Guests do not seem to use QWORD accesses, but let's
be spec compliant.

Fixes: 95524ae8dc8f ("msix: convert to memory API")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/pci/msix.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/pci/msix.c b/hw/pci/msix.c
index 29187898f2..e6a5559038 100644
--- a/hw/pci/msix.c
+++ b/hw/pci/msix.c
@@ -199,6 +199,9 @@ static const MemoryRegionOps msix_table_mmio_ops = {
     .endianness = DEVICE_LITTLE_ENDIAN,
     .valid = {
         .min_access_size = 4,
+        .max_access_size = 8,
+    },
+    .impl = {
         .max_access_size = 4,
     },
 };
@@ -227,6 +230,9 @@ static const MemoryRegionOps msix_pba_mmio_ops = {
     .endianness = DEVICE_LITTLE_ENDIAN,
     .valid = {
         .min_access_size = 4,
+        .max_access_size = 8,
+    },
+    .impl = {
         .max_access_size = 4,
     },
 };
-- 
MST



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] msix: allow qword MSI-X table accesses
  2020-05-14 15:16 [PATCH] msix: allow qword MSI-X table accesses Michael S. Tsirkin
@ 2020-05-14 18:42 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-14 18:42 UTC (permalink / raw)
  To: Michael S. Tsirkin, qemu-devel; +Cc: jusual

On 5/14/20 5:16 PM, Michael S. Tsirkin wrote:
> PCI spec says:
> 
> For all accesses to MSI-X Table and MSI-X PBA fields, software must use
> aligned full DWORD or aligned full QWORD transactions; otherwise, the
> result is undefined.
> 
> However, since MSI-X was converted to use memory API, QEMU
> started blocking qword transactions, only allowing DWORD
> ones. Guests do not seem to use QWORD accesses, but let's
> be spec compliant.
> 
> Fixes: 95524ae8dc8f ("msix: convert to memory API")

9 years =)

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

> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>   hw/pci/msix.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/hw/pci/msix.c b/hw/pci/msix.c
> index 29187898f2..e6a5559038 100644
> --- a/hw/pci/msix.c
> +++ b/hw/pci/msix.c
> @@ -199,6 +199,9 @@ static const MemoryRegionOps msix_table_mmio_ops = {
>       .endianness = DEVICE_LITTLE_ENDIAN,
>       .valid = {
>           .min_access_size = 4,
> +        .max_access_size = 8,
> +    },
> +    .impl = {
>           .max_access_size = 4,
>       },
>   };
> @@ -227,6 +230,9 @@ static const MemoryRegionOps msix_pba_mmio_ops = {
>       .endianness = DEVICE_LITTLE_ENDIAN,
>       .valid = {
>           .min_access_size = 4,
> +        .max_access_size = 8,
> +    },
> +    .impl = {
>           .max_access_size = 4,
>       },
>   };
> 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-14 18:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-14 15:16 [PATCH] msix: allow qword MSI-X table accesses Michael S. Tsirkin
2020-05-14 18:42 ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).