include/hw/i386/x86-iommu: Fix struct X86IOMMU_MSIMessage for big endian hosts
commite1e56c07d1fa24aa37a7e89e6633768fc8ea8705
authorThomas Huth <thuth@redhat.com>
Wed, 2 Aug 2023 13:57:23 +0000 (2 15:57 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 3 Aug 2023 20:16:17 +0000 (3 16:16 -0400)
treeb8d7c845db01ac8c13dcf76af43278792436eae7
parent37cf5cecb039a063c0abe3b51ae30f969e73aa84
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>
include/hw/i386/x86-iommu.h