kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case
PATCH 1/1 kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case
The AMD IOMMU does not (yet) support interrupt remapping. But kvm_arch_fixup_msi_route assumes that all implementations do and crashes when the AMD IOMMU is used in KVM mode.
--- target/i386/kvm.c | 4 ++++ 1 file changed, 4 insertions(+)
target/i386/kvm.c +4 -0
@@ -3677,6 +3677,10 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route,MSIMessage src, dst;X86IOMMUClass *class =X86_IOMMU_GET_CLASS (iommu); +if (!class->int_remap) { +return 0 ; + } + src.address = route->u.msi.address_hi; src.address <<=VTD_MSI_ADDR_HI_SHIFT ; src.address |= route->u.msi.address_lo;
Signature · 1 line
2.16.4
Quoted 7 lines · Jan Kiszka
The AMD IOMMU does not (yet) support interrupt remapping. But
kvm_arch_fixup_msi_routeassumes that all implementations do and crashes when the AMD IOMMU is used in KVM mode.Fixes 8b5ed7dffa1f ("intel_iommu: add support for split irqchip")Reported-by Christopher Goldsworthy <[email protected]>Signed-off-by Jan Kiszka <[email protected]>
Thanks!
Signature · 1 line
Peter Xu
Quoted 7 lines · Jan Kiszka
The AMD IOMMU does not (yet) support interrupt remapping. But
kvm_arch_fixup_msi_routeassumes that all implementations do and crashes when the AMD IOMMU is used in KVM mode.Fixes 8b5ed7dffa1f ("intel_iommu: add support for split irqchip")Reported-by Christopher Goldsworthy <[email protected]>Signed-off-by Jan Kiszka <[email protected]>
Quoted 21 lines
--- target/i386/kvm.c | 4 ++++ 1 file changed, 4 insertions(+)target/i386/kvm.c +4
-0@@ -3677,6 +3677,10 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route,MSIMessage src, dst;X86IOMMUClass *class =X86_IOMMU_GET_CLASS (iommu); +if (!class->int_remap) { +return 0 ; + } + src.address = route->u.msi.address_hi; src.address <<=VTD_MSI_ADDR_HI_SHIFT ; src.address |= route->u.msi.address_lo;Signature · 1 line
2.16.4
Paolo Bonzini
AppliedQuoted 17 lines · Jan Kiszka
The AMD IOMMU does not (yet) support interrupt remapping. But
kvm_arch_fixup_msi_routeassumes that all implementations do and crashes when the AMD IOMMU is used in KVM mode.Fixes 8b5ed7dffa1f ("intel_iommu: add support for split irqchip")Reported-by Christopher Goldsworthy <[email protected]>Signed-off-by Jan Kiszka <[email protected]>--- target/i386/kvm.c | 4 ++++ 1 file changed, 4 insertions(+)target/i386/kvm.c +0
-0
target/i386/kvm.c int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route, · line 3686
Quoted 10 lines
target/i386/kvm.c +4
-0@@ -3677,6 +3677,10 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route,MSIMessage src, dst;X86IOMMUClass *class =X86_IOMMU_GET_CLASS (iommu); +if (!class->int_remap) { +return 0 ; + } + src.address = route->u.msi.address_hi; src.address <<=VTD_MSI_ADDR_HI_SHIFT ; src.address |= route->u.msi.address_lo;
Queued, thanks.
Paolo