]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iommu/hyper-v: Add Hyper-V stub IOMMU driver
authorLan Tianyu <Tianyu.Lan@microsoft.com>
Wed, 27 Feb 2019 14:54:04 +0000 (22:54 +0800)
committerJoerg Roedel <jroedel@suse.de>
Thu, 28 Feb 2019 10:12:16 +0000 (11:12 +0100)
commit29217a4746835fef35279abbd12c1a1efe83bfca
treec5ea0066251ce2605754dd785373bb27126d68dc
parent84fdfafab849036b5aefa52824b5cb42e887ef0e
iommu/hyper-v: Add Hyper-V stub IOMMU driver

On the bare metal, enabling X2APIC mode requires interrupt remapping
function which helps to deliver irq to cpu with 32-bit APIC ID.
Hyper-V doesn't provide interrupt remapping function so far and Hyper-V
MSI protocol already supports to deliver interrupt to the CPU whose
virtual processor index is more than 255. IO-APIC interrupt still has
8-bit APIC ID limitation.

This patch is to add Hyper-V stub IOMMU driver in order to enable
X2APIC mode successfully in Hyper-V Linux guest. The driver returns X2APIC
interrupt remapping capability when X2APIC mode is available. Otherwise,
it creates a Hyper-V irq domain to limit IO-APIC interrupts' affinity
and make sure cpus assigned with IO-APIC interrupt have 8-bit APIC ID.

Define 24 IO-APIC remapping entries because Hyper-V only expose one
single IO-APIC and one IO-APIC has 24 pins according IO-APIC spec(
https://pdos.csail.mit.edu/6.828/2016/readings/ia32/ioapic.pdf).

Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Lan Tianyu <Tianyu.Lan@microsoft.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/Kconfig
drivers/iommu/Makefile
drivers/iommu/hyperv-iommu.c [new file with mode: 0644]
drivers/iommu/irq_remapping.c
drivers/iommu/irq_remapping.h