]> www.infradead.org Git - users/dwmw2/linux.git/commit
x86/msi: Only use high bits of MSI address for DMAR unit
authorDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 9 Oct 2020 10:46:10 +0000 (11:46 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Sat, 24 Oct 2020 13:51:43 +0000 (14:51 +0100)
commit84f0ccd65b92e98deb147c82afc16f328442dc5f
tree0a417037a088e05059656f768a012d37479b6998
parenta02dc6c6cfc0611f120bb17e6485c018a688ef87
x86/msi: Only use high bits of MSI address for DMAR unit

The Intel IOMMU has an MSI-like configuration for its interrupt, but it
isn't really MSI. So it gets to abuse the high 32 bits of the address, and
puts the high 24 bits of the extended APIC ID there.

This isn't something that can be used in the general case for real MSIs,
since external devices using the high bits of the address would be
performing writes to actual memory space above 4GiB, not targeted at the
APIC.

Factor the hack out and allow it only to be used when appropriate, adding a
WARN_ON_ONCE() if other MSIs are targeted at an unreachable APIC ID. That
should never happen since the compatibility MSI messages are not used when
Interrupt Remapping is enabled.

The x2apic_enabled() check isn't needed because Linux won't bring up CPUs
with higher APIC IDs unless IR and x2apic are enabled anyway.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/apic/msi.c