Commit 792fb43c authored by Lu Baolu's avatar Lu Baolu Committed by Joerg Roedel

iommu/vt-d: Enable Intel IOMMU scalable mode by default

The commit 8950dcd8 ("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: default avatarAshok Raj <ashok.raj@intel.com>
Suggested-by: default avatarSanjay Kumar <sanjay.k.kumar@intel.com>
Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20210720013856.4143880-1-baolu.lu@linux.intel.com
Link: https://lore.kernel.org/r/20210818134852.1847070-5-baolu.lu@linux.intel.comSigned-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 01dac2d9
...@@ -1946,11 +1946,12 @@ ...@@ -1946,11 +1946,12 @@
By default, super page will be supported if Intel IOMMU By default, super page will be supported if Intel IOMMU
has the capability. With this option, super page will has the capability. With this option, super page will
not be supported. not be supported.
sm_on [Default Off] sm_on
By default, scalable mode will be disabled even if the Enable the Intel IOMMU scalable mode if the hardware
hardware advertises that it has support for the scalable advertises that it has support for the scalable mode
mode translation. With this option set, scalable mode translation.
will be used on hardware which claims to support it. sm_off
Disallow use of the Intel IOMMU scalable mode.
tboot_noforce [Default Off] tboot_noforce [Default Off]
Do not force the Intel IOMMU enabled under tboot. Do not force the Intel IOMMU enabled under tboot.
By default, tboot will force Intel IOMMU on, which By default, tboot will force Intel IOMMU on, which
......
...@@ -84,6 +84,7 @@ config INTEL_IOMMU_FLOPPY_WA ...@@ -84,6 +84,7 @@ config INTEL_IOMMU_FLOPPY_WA
config INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON config INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
bool "Enable Intel IOMMU scalable mode by default" bool "Enable Intel IOMMU scalable mode by default"
default y
help help
Selecting this option will enable by default the scalable mode if Selecting this option will enable by default the scalable mode if
hardware presents the capability. The scalable mode is defined in hardware presents the capability. The scalable mode is defined in
......
...@@ -432,8 +432,11 @@ static int __init intel_iommu_setup(char *str) ...@@ -432,8 +432,11 @@ static int __init intel_iommu_setup(char *str)
pr_info("Disable supported super page\n"); pr_info("Disable supported super page\n");
intel_iommu_superpage = 0; intel_iommu_superpage = 0;
} else if (!strncmp(str, "sm_on", 5)) { } else if (!strncmp(str, "sm_on", 5)) {
pr_info("Intel-IOMMU: scalable mode supported\n"); pr_info("Enable scalable mode if hardware supports\n");
intel_iommu_sm = 1; intel_iommu_sm = 1;
} else if (!strncmp(str, "sm_off", 6)) {
pr_info("Scalable mode is disallowed\n");
intel_iommu_sm = 0;
} else if (!strncmp(str, "tboot_noforce", 13)) { } else if (!strncmp(str, "tboot_noforce", 13)) {
pr_info("Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n"); pr_info("Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n");
intel_iommu_tboot_noforce = 1; intel_iommu_tboot_noforce = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment