Skip to content

Fix endianness issues in the intel-iommu device

Thomas Huth qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6hw/i386/intel_iommu: Fix trivial endianness problemshw/i386/intel_iommu.c+5 -01 reply
2/6hw/i386/intel_iommu: Fix endianness problems related to VTD_IR_TableEntryhw/i386/intel_iommu.c include/hw/i386/intel_iommu.h+34 -320 replies
3/6hw/i386/intel_iommu: Fix struct VTDInvDescIEC on big endian hostshw/i386/intel_iommu_internal.h+9 -01 reply
4/6hw/i386/intel_iommu: Fix index calculation in vtd_interrupt_remap_msi()hw/i386/intel_iommu.c+1 -11 reply
5/6hw/i386/x86-iommu: Fix endianness issue in x86_iommu_irq_to_msi_message()hw/i386/x86-iommu.c+1 -11 reply
6/6include/hw/i386/x86-iommu: Fix struct X86IOMMU_MSIMessage for big endian hostsinclude/hw/i386/x86-iommu.h+26 -240 replies

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPeter XuPhilippe Mathieu-Daudé
SeriesR-b
1/6R-b
2/6
3/6
4/6R-b
5/6R-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH for-8.1 0/6] Fix endianness issues in the intel-iommu device

The intel-iommu device is currently unusable on big endian hosts. When doing something like this on a s390x host:

wget https://download.fedoraproject.org/pub/fedora/linux/releases/38/Server/x86_64/images/Fedora-Server-KVM-38-1.6.x86_64.qcow2

 ./qemu-system-x86_64 -M q35 -device intel-iommu -m 2G \
        -hda ~/Fedora-Server-KVM-38-1.6.x86_64.qcow2 -trace "vtd_*"

... the guest kernel crashes during boot, complaining about some problems with the iommu, and you can see clearly in the traces that some values are wrong when compared to running this on a x86 host.

After spending quite some time hunting down the problems one by one, I think I now found them all - at least I can successfully boot the above kernel after I applied these patches.

Thomas Huth (6):
hw/i386/intel_iommu: Fix trivial endianness problems hw/i386/intel_iommu: Fix endianness problems related to
VTD_IR_TableEntry
hw/i386/intel_iommu: Fix struct VTDInvDescIEC on big endian hosts hw/i386/intel_iommu: Fix index calculation in
vtd_interrupt_remap_msi()
hw/i386/x86-iommu: Fix endianness issue in

    x86_iommu_irq_to_msi_message()

include/hw/i386/x86-iommu: Fix struct X86IOMMU_MSIMessage for big
endian hosts

 hw/i386/intel_iommu_internal.h |  9 ++++++
 include/hw/i386/intel_iommu.h  | 50 ++++++++++++++++++----------------
 include/hw/i386/x86-iommu.h    | 50 ++++++++++++++++++----------------
 hw/i386/intel_iommu.c          | 23 ++++++++++------
 hw/i386/x86-iommu.c            |  2 +-
 5 files changed, 76 insertions(+), 58 deletions(-)
Signature · 1 line
2.39.3