]> 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>
Wed, 30 Sep 2020 09:52:27 +0000 (10:52 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 23 Oct 2020 16:25:50 +0000 (17:25 +0100)
commit5afe1c8146c89976a7f7f7f5b3d4b3d91e21fd12
treec8415f2f045ba30d485b70d6a03b4bce918f6158
parent38cf9ce6e6796c8063cf7cca51cebe7773958984
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>
arch/x86/kernel/apic/msi.c