Skip to content

Commit 792fb43

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Enable Intel IOMMU scalable mode by default
The commit 8950dcd ("iommu/vt-d: Leave scalable mode default off") leaves the scalable mode default off and end users could turn it on with "intel_iommu=sm_on". Using the Intel IOMMU scalable mode for kernel DMA, user-level device access and Shared Virtual Address have been enabled. This enables the scalable mode by default if the hardware advertises the support and adds kernel options of "intel_iommu=sm_on/sm_off" for end users to configure it through the kernel parameters. Suggested-by: Ashok Raj <[email protected]> Suggested-by: Sanjay Kumar <[email protected]> Signed-off-by: Lu Baolu <[email protected]> Cc: Kevin Tian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 01dac2d commit 792fb43

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,11 +1946,12 @@
19461946
By default, super page will be supported if Intel IOMMU
19471947
has the capability. With this option, super page will
19481948
not be supported.
1949-
sm_on [Default Off]
1950-
By default, scalable mode will be disabled even if the
1951-
hardware advertises that it has support for the scalable
1952-
mode translation. With this option set, scalable mode
1953-
will be used on hardware which claims to support it.
1949+
sm_on
1950+
Enable the Intel IOMMU scalable mode if the hardware
1951+
advertises that it has support for the scalable mode
1952+
translation.
1953+
sm_off
1954+
Disallow use of the Intel IOMMU scalable mode.
19541955
tboot_noforce [Default Off]
19551956
Do not force the Intel IOMMU enabled under tboot.
19561957
By default, tboot will force Intel IOMMU on, which

drivers/iommu/intel/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ config INTEL_IOMMU_FLOPPY_WA
8484

8585
config INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
8686
bool "Enable Intel IOMMU scalable mode by default"
87+
default y
8788
help
8889
Selecting this option will enable by default the scalable mode if
8990
hardware presents the capability. The scalable mode is defined in

drivers/iommu/intel/iommu.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,11 @@ static int __init intel_iommu_setup(char *str)
432432
pr_info("Disable supported super page\n");
433433
intel_iommu_superpage = 0;
434434
} else if (!strncmp(str, "sm_on", 5)) {
435-
pr_info("Intel-IOMMU: scalable mode supported\n");
435+
pr_info("Enable scalable mode if hardware supports\n");
436436
intel_iommu_sm = 1;
437+
} else if (!strncmp(str, "sm_off", 6)) {
438+
pr_info("Scalable mode is disallowed\n");
439+
intel_iommu_sm = 0;
437440
} else if (!strncmp(str, "tboot_noforce", 13)) {
438441
pr_info("Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n");
439442
intel_iommu_tboot_noforce = 1;

0 commit comments

Comments
 (0)