]> git.proxmox.com Git - mirror_qemu.git/commit
intel-iommu: Report interrupt remapping faults, fix return value
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 23 Aug 2023 12:23:25 +0000 (13:23 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 22 Oct 2023 09:18:17 +0000 (05:18 -0400)
commitc7016bf700cfbee52d2797bc4c592a39b17c4de7
tree7359c233f6fd342a5712aaf4d898df18190fd60f
parent5e7abc29c56f7823f9a122898685bdfcfac2e522
intel-iommu: Report interrupt remapping faults, fix return value

A generic X86IOMMUClass->int_remap function should not return VT-d
specific values; fix it to return 0 if the interrupt was successfully
translated or -EINVAL if not.

The VTD_FR_IR_xxx values are supposed to be used to actually raise
faults through the fault reporting mechanism, so do that instead for
the case where the IRQ is actually being injected.

There is more work to be done here, as pretranslations for the KVM IRQ
routing table can't fault; an untranslatable IRQ should be handled in
userspace and the fault raised only when the IRQ actually happens (if
indeed the IRTE is still not valid at that time). But we can work on
that later; we can at least raise faults for the direct case.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Message-Id: <31bbfc9041690449d3ac891f4431ec82174ee1b4.camel@infradead.org>
Acked-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/intel_iommu.c
hw/i386/intel_iommu_internal.h