Skip to content

Commit 70bad34

Browse files
spasswolfjoergroedel
authored andcommitted
iommu: Fix compilation without CONFIG_IOMMU_INTEL
When the kernel is comiled with CONFIG_IRQ_REMAP=y but without CONFIG_IOMMU_INTEL compilation fails since commit def054b with an undefined reference to device_rbtree_find(). This patch makes sure that intel specific code is only compiled with CONFIG_IOMMU_INTEL=y. Signed-off-by: Bert Karwatzki <[email protected]> Fixes: 80a9b50 ("iommu/vt-d: Improve ITE fault handling if target device isn't present") Reviewed-by: Lu Baolu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 80ca79f commit 70bad34

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

drivers/iommu/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ source "drivers/iommu/iommufd/Kconfig"
196196
config IRQ_REMAP
197197
bool "Support for Interrupt Remapping"
198198
depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
199-
select DMAR_TABLE
199+
select DMAR_TABLE if INTEL_IOMMU
200200
help
201201
Supports Interrupt remapping for IO-APIC and MSI devices.
202202
To use x2apic mode in the CPU's which support x2APIC enhancements or

drivers/iommu/intel/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ obj-$(CONFIG_DMAR_TABLE) += trace.o cap_audit.o
55
obj-$(CONFIG_DMAR_PERF) += perf.o
66
obj-$(CONFIG_INTEL_IOMMU_DEBUGFS) += debugfs.o
77
obj-$(CONFIG_INTEL_IOMMU_SVM) += svm.o
8+
ifdef CONFIG_INTEL_IOMMU
89
obj-$(CONFIG_IRQ_REMAP) += irq_remapping.o
10+
endif
911
obj-$(CONFIG_INTEL_IOMMU_PERF_EVENTS) += perfmon.o

drivers/iommu/irq_remapping.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ int __init irq_remapping_prepare(void)
9999
if (disable_irq_remap)
100100
return -ENOSYS;
101101

102-
if (intel_irq_remap_ops.prepare() == 0)
102+
if (IS_ENABLED(CONFIG_INTEL_IOMMU) &&
103+
intel_irq_remap_ops.prepare() == 0)
103104
remap_ops = &intel_irq_remap_ops;
104105
else if (IS_ENABLED(CONFIG_AMD_IOMMU) &&
105106
amd_iommu_irq_ops.prepare() == 0)

0 commit comments

Comments
 (0)