]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commit
x86/iommu: avoid MSI address and data writes if IRT index hasn't changed
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 7 Mar 2025 09:16:01 +0000 (10:16 +0100)
committerRoger Pau Monne <roger.pau@citrix.com>
Wed, 12 Mar 2025 12:32:31 +0000 (13:32 +0100)
commit8e60d47cf0112c145b6b0e454d102b04c857db8c
tree1f9cab8d140bf9d9054fa2502bb63fe07deae98a
parentcb587f620ab56cc683347d8120ba63989fad2693
x86/iommu: avoid MSI address and data writes if IRT index hasn't changed

Attempt to reduce the MSI entry writes, and the associated checking whether
memory decoding and MSI-X is enabled for the PCI device, when the MSI data
hasn't changed.

When using Interrupt Remapping the MSI entry will contain an index into
the remapping table, and it's in such remapping table where the MSI vector
and destination CPU is stored.  As such, when using interrupt remapping,
changes to the interrupt affinity shouldn't result in changes to the MSI
entry, and the MSI entry update can be avoided.

Signal from the IOMMU update_ire_from_msi hook whether the MSI data or
address fields have changed, and thus need writing to the device registers.
Such signaling is done by returning 1 from the function.  Otherwise
returning 0 means no update of the MSI fields, and thus no write
required.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hpet.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/msi.c
xen/drivers/passthrough/amd/iommu_intr.c
xen/drivers/passthrough/vtd/intremap.c
xen/include/xen/iommu.h