All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] iommu/vt-d: Leave scalable mode default off
@ 2019-01-24  2:31 ` Lu Baolu
  0 siblings, 0 replies; 5+ messages in thread
From: Lu Baolu @ 2019-01-24  2:31 UTC (permalink / raw)
  To: Joerg Roedel, David Woodhouse
  Cc: ashok.raj, iommu, linux-kernel, Lu Baolu, Liu Yi L, Jacob Pan

Commit 765b6a98c1de3 ("iommu/vt-d: Enumerate the scalable
mode capability") enables VT-d scalable mode if hardware
advertises the capability. As we will bring up different
features and use cases to upstream in different patch
series, it will leave some intermediate kernel versions
which support partial features. Hence, end user might run
into problems when they use such kernels on bare metals
or virtualization environments.

This leaves scalable mode default off and end users could
turn it on with "intel-iommu=sm_on" only when they have
clear ideas about which scalable features are supported
in the kernel.

Cc: Liu Yi L <yi.l.liu@intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Suggested-by: Ashok Raj <ashok.raj@intel.com>
Suggested-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 Documentation/admin-guide/kernel-parameters.txt | 7 +++----
 drivers/iommu/intel-iommu.c                     | 8 ++++----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index b799bcf67d7b..858b6c0b9a15 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1696,12 +1696,11 @@
 			By default, super page will be supported if Intel IOMMU
 			has the capability. With this option, super page will
 			not be supported.
-		sm_off [Default Off]
-			By default, scalable mode will be supported if the
+		sm_on [Default Off]
+			By default, scalable mode will be disabled even if the
 			hardware advertises that it has support for the scalable
 			mode translation. With this option set, scalable mode
-			will not be used even on hardware which claims to support
-			it.
+			will be used on hardware which claims to support it.
 		tboot_noforce [Default Off]
 			Do not force the Intel IOMMU enabled under tboot.
 			By default, tboot will force Intel IOMMU on, which
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 2bd9ac285c0d..8d31d3e25e30 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -363,7 +363,7 @@ static int dmar_map_gfx = 1;
 static int dmar_forcedac;
 static int intel_iommu_strict;
 static int intel_iommu_superpage = 1;
-static int intel_iommu_sm = 1;
+static int intel_iommu_sm;
 static int iommu_identity_mapping;
 
 #define IDENTMAP_ALL		1
@@ -456,9 +456,9 @@ static int __init intel_iommu_setup(char *str)
 		} else if (!strncmp(str, "sp_off", 6)) {
 			pr_info("Disable supported super page\n");
 			intel_iommu_superpage = 0;
-		} else if (!strncmp(str, "sm_off", 6)) {
-			pr_info("Intel-IOMMU: disable scalable mode support\n");
-			intel_iommu_sm = 0;
+		} else if (!strncmp(str, "sm_on", 5)) {
+			pr_info("Intel-IOMMU: scalable mode supported\n");
+			intel_iommu_sm = 1;
 		} else if (!strncmp(str, "tboot_noforce", 13)) {
 			printk(KERN_INFO
 				"Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n");
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 1/1] iommu/vt-d: Leave scalable mode default off
@ 2019-01-24  2:31 ` Lu Baolu
  0 siblings, 0 replies; 5+ messages in thread
From: Lu Baolu @ 2019-01-24  2:31 UTC (permalink / raw)
  To: Joerg Roedel, David Woodhouse
  Cc: ashok.raj-ral2JQCrhuEAvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

Commit 765b6a98c1de3 ("iommu/vt-d: Enumerate the scalable
mode capability") enables VT-d scalable mode if hardware
advertises the capability. As we will bring up different
features and use cases to upstream in different patch
series, it will leave some intermediate kernel versions
which support partial features. Hence, end user might run
into problems when they use such kernels on bare metals
or virtualization environments.

This leaves scalable mode default off and end users could
turn it on with "intel-iommu=sm_on" only when they have
clear ideas about which scalable features are supported
in the kernel.

Cc: Liu Yi L <yi.l.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Jacob Pan <jacob.jun.pan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Suggested-by: Ashok Raj <ashok.raj-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Suggested-by: Kevin Tian <kevin.tian-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Lu Baolu <baolu.lu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 Documentation/admin-guide/kernel-parameters.txt | 7 +++----
 drivers/iommu/intel-iommu.c                     | 8 ++++----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index b799bcf67d7b..858b6c0b9a15 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1696,12 +1696,11 @@
 			By default, super page will be supported if Intel IOMMU
 			has the capability. With this option, super page will
 			not be supported.
-		sm_off [Default Off]
-			By default, scalable mode will be supported if the
+		sm_on [Default Off]
+			By default, scalable mode will be disabled even if the
 			hardware advertises that it has support for the scalable
 			mode translation. With this option set, scalable mode
-			will not be used even on hardware which claims to support
-			it.
+			will be used on hardware which claims to support it.
 		tboot_noforce [Default Off]
 			Do not force the Intel IOMMU enabled under tboot.
 			By default, tboot will force Intel IOMMU on, which
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 2bd9ac285c0d..8d31d3e25e30 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -363,7 +363,7 @@ static int dmar_map_gfx = 1;
 static int dmar_forcedac;
 static int intel_iommu_strict;
 static int intel_iommu_superpage = 1;
-static int intel_iommu_sm = 1;
+static int intel_iommu_sm;
 static int iommu_identity_mapping;
 
 #define IDENTMAP_ALL		1
@@ -456,9 +456,9 @@ static int __init intel_iommu_setup(char *str)
 		} else if (!strncmp(str, "sp_off", 6)) {
 			pr_info("Disable supported super page\n");
 			intel_iommu_superpage = 0;
-		} else if (!strncmp(str, "sm_off", 6)) {
-			pr_info("Intel-IOMMU: disable scalable mode support\n");
-			intel_iommu_sm = 0;
+		} else if (!strncmp(str, "sm_on", 5)) {
+			pr_info("Intel-IOMMU: scalable mode supported\n");
+			intel_iommu_sm = 1;
 		} else if (!strncmp(str, "tboot_noforce", 13)) {
 			printk(KERN_INFO
 				"Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n");
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] iommu/vt-d: Leave scalable mode default off
  2019-01-24  2:31 ` Lu Baolu
  (?)
@ 2019-01-24 13:22 ` Joerg Roedel
  2019-01-25  2:02   ` Lu Baolu
  -1 siblings, 1 reply; 5+ messages in thread
From: Joerg Roedel @ 2019-01-24 13:22 UTC (permalink / raw)
  To: Lu Baolu
  Cc: David Woodhouse, ashok.raj, iommu, linux-kernel, Liu Yi L, Jacob Pan

On Thu, Jan 24, 2019 at 10:31:32AM +0800, Lu Baolu wrote:
> Commit 765b6a98c1de3 ("iommu/vt-d: Enumerate the scalable
> mode capability") enables VT-d scalable mode if hardware
> advertises the capability. As we will bring up different
> features and use cases to upstream in different patch
> series, it will leave some intermediate kernel versions
> which support partial features. Hence, end user might run
> into problems when they use such kernels on bare metals
> or virtualization environments.

I don't get it, can you be more specific about the problems that users
might run into? And is this patch needed as a fix for v5.0 or is it just
a precaution because future patches might break something for users?


Regards,

	Joerg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] iommu/vt-d: Leave scalable mode default off
  2019-01-24 13:22 ` Joerg Roedel
@ 2019-01-25  2:02   ` Lu Baolu
  0 siblings, 0 replies; 5+ messages in thread
From: Lu Baolu @ 2019-01-25  2:02 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: baolu.lu, David Woodhouse, ashok.raj, iommu, linux-kernel,
	Liu Yi L, Jacob Pan

Hi Joerg,

On 1/24/19 9:22 PM, Joerg Roedel wrote:
> On Thu, Jan 24, 2019 at 10:31:32AM +0800, Lu Baolu wrote:
>> Commit 765b6a98c1de3 ("iommu/vt-d: Enumerate the scalable
>> mode capability") enables VT-d scalable mode if hardware
>> advertises the capability. As we will bring up different
>> features and use cases to upstream in different patch
>> series, it will leave some intermediate kernel versions
>> which support partial features. Hence, end user might run
>> into problems when they use such kernels on bare metals
>> or virtualization environments.
> 
> I don't get it, can you be more specific about the problems that users
> might run into?

Sorry, I didn't make it clear in the message.

Around VT-d scalable mode, we plan to enable several features.
For example,

(1)basic scalable mode support;
(2)aux domain;
(3)system level pasid allocation;
....

Since they will be submitted in different patch series for reviewing and
merging, users will face compatible problems. For example, when users
run kernel v5.0, they might fail to assign an ADI (Assignable Device
Interface) to a VM because the aux domain is not included yet. They will
complain "I have a kernel claimed to support scalable mode, but when I
tried to assign an ADI to a VM, ...".

So we decide to leave it off by default, and turn it default on later
when all the features get merged. Users could try scalable mode features
with "intel-iommu=sm_on" in kernel command line.

> And is this patch needed as a fix for v5.0 or is it just
> a precaution because future patches might break something for users?

It will be better if it can be a fix for v5.0.

Best regards,
Lu Baolu

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] iommu/vt-d: Leave scalable mode default off
  2019-01-24  2:31 ` Lu Baolu
  (?)
  (?)
@ 2019-01-30 16:24 ` Joerg Roedel
  -1 siblings, 0 replies; 5+ messages in thread
From: Joerg Roedel @ 2019-01-30 16:24 UTC (permalink / raw)
  To: Lu Baolu
  Cc: David Woodhouse, ashok.raj, iommu, linux-kernel, Liu Yi L, Jacob Pan

On Thu, Jan 24, 2019 at 10:31:32AM +0800, Lu Baolu wrote:
> Commit 765b6a98c1de3 ("iommu/vt-d: Enumerate the scalable
> mode capability") enables VT-d scalable mode if hardware
> advertises the capability. As we will bring up different
> features and use cases to upstream in different patch
> series, it will leave some intermediate kernel versions
> which support partial features. Hence, end user might run
> into problems when they use such kernels on bare metals
> or virtualization environments.
> 
> This leaves scalable mode default off and end users could
> turn it on with "intel-iommu=sm_on" only when they have
> clear ideas about which scalable features are supported
> in the kernel.
> 
> Cc: Liu Yi L <yi.l.liu@intel.com>
> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
> Suggested-by: Ashok Raj <ashok.raj@intel.com>
> Suggested-by: Kevin Tian <kevin.tian@intel.com>
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>

Applied to iommu/fixes, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-30 16:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-24  2:31 [PATCH 1/1] iommu/vt-d: Leave scalable mode default off Lu Baolu
2019-01-24  2:31 ` Lu Baolu
2019-01-24 13:22 ` Joerg Roedel
2019-01-25  2:02   ` Lu Baolu
2019-01-30 16:24 ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.