Skip to content

Commit 0461825

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Add Kconfig option to enable/disable scalable mode
This adds Kconfig option INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON to make it easier for distributions to enable or disable the Intel IOMMU scalable mode by default during kernel build. Signed-off-by: Lu Baolu <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 46cf053 commit 0461825

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

drivers/iommu/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,18 @@ config INTEL_IOMMU_FLOPPY_WA
248248
workaround will setup a 1:1 mapping for the first
249249
16MiB to make floppy (an ISA device) work.
250250

251+
config INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
252+
bool "Enable Intel IOMMU scalable mode by default"
253+
depends on INTEL_IOMMU
254+
help
255+
Selecting this option will enable by default the scalable mode if
256+
hardware presents the capability. The scalable mode is defined in
257+
VT-d 3.0. The scalable mode capability could be checked by reading
258+
/sys/devices/virtual/iommu/dmar*/intel-iommu/ecap. If this option
259+
is not selected, scalable mode support could also be enabled by
260+
passing intel_iommu=sm_on to the kernel. If not sure, please use
261+
the default value.
262+
251263
config IRQ_REMAP
252264
bool "Support for Interrupt Remapping"
253265
depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI

drivers/iommu/intel-iommu.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,14 @@ static phys_addr_t intel_iommu_iova_to_phys(struct iommu_domain *domain,
355355
int dmar_disabled = 0;
356356
#else
357357
int dmar_disabled = 1;
358-
#endif /*CONFIG_INTEL_IOMMU_DEFAULT_ON*/
358+
#endif /* CONFIG_INTEL_IOMMU_DEFAULT_ON */
359359

360+
#ifdef INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
361+
int intel_iommu_sm = 1;
362+
#else
360363
int intel_iommu_sm;
364+
#endif /* INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON */
365+
361366
int intel_iommu_enabled = 0;
362367
EXPORT_SYMBOL_GPL(intel_iommu_enabled);
363368

0 commit comments

Comments
 (0)