]> git.ipfire.org Git - thirdparty/qemu.git/commit
include/hw/i386/x86-iommu: Fix struct X86IOMMU_MSIMessage for big endian hosts
authorThomas Huth <thuth@redhat.com>
Wed, 2 Aug 2023 13:57:23 +0000 (15:57 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 4 Aug 2023 05:27:03 +0000 (08:27 +0300)
commitda6d0af41d66e8c54c430454e534499c289ba47b
tree5f08cee2c4716bf8fbaf3a0cfb5b981c0a2dbc68
parentb58abc4a2b59077bfd5d5b9d1daf7bb86221f6b1
include/hw/i386/x86-iommu: Fix struct X86IOMMU_MSIMessage for big endian hosts

The first bitfield here is supposed to be used as a 64-bit equivalent
to the "uint64_t msi_addr" in the union. To make this work correctly
on big endian hosts, too, the __addr_hi field has to be part of the
bitfield, and the the bitfield members must be declared with "uint64_t"
instead of "uint32_t" - otherwise the values are placed in the wrong
bytes on big endian hosts.

Same applies to the 32-bit "msi_data" field: __resved1 must be part
of the bitfield, and the members must be declared with "uint32_t"
instead of "uint16_t".

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230802135723.178083-7-thuth@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
(cherry picked from commit e1e56c07d1fa24aa37a7e89e6633768fc8ea8705)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
include/hw/i386/x86-iommu.h