]> www.infradead.org Git - users/dwmw2/qemu.git/commit
intel-iommu: Report interrupt remapping faults, fix return value
authorDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 10 Mar 2023 17:37:03 +0000 (17:37 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 18 Oct 2023 23:28:37 +0000 (00:28 +0100)
commit85d9f1733f018b19a4433b46cf2bd01fe784b8a6
tree7b281ece64b8a56d494965e3fb51f92e943b24af
parentdeaca3fd30d3a8829160f8d3705d65ad83176800
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>
Acked-by: Peter Xu <peterx@redhat.com>
hw/i386/intel_iommu.c
hw/i386/intel_iommu_internal.h