Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2019-09-23 17:28:20 +0200
committerJoerg Roedel <jroedel@suse.de>2019-09-23 17:28:44 +0200
commitea9cc185749e1a977829840c88e3b4a0bf9f7fe1 (patch)
tree2064890413c832764024e6e7e7c0a0eabe810e78
parentece190202172ca14c7012d8c55ba3706f837be43 (diff)
iommu: Don't use sme_active() in generic code (bsc#1151700).
-rw-r--r--patches.suse/iommu-don-t-use-sme_active-in-generic-code33
-rw-r--r--series.conf1
2 files changed, 34 insertions, 0 deletions
diff --git a/patches.suse/iommu-don-t-use-sme_active-in-generic-code b/patches.suse/iommu-don-t-use-sme_active-in-generic-code
new file mode 100644
index 0000000000..d721659852
--- /dev/null
+++ b/patches.suse/iommu-don-t-use-sme_active-in-generic-code
@@ -0,0 +1,33 @@
+From: Joerg Roedel <jroedel@suse.de>
+Date: Tue, 3 Sep 2019 15:15:44 +0200
+Subject: iommu: Don't use sme_active() in generic code
+Git-commit: 2896ba40d0becdb72b45f096cad70633abc014f6
+Patch-mainline: v5.4-rc1
+References: bsc#1151700
+
+Switch to the generic function mem_encrypt_active() because
+sme_active() is x86 specific and can't be called from
+generic code on other platforms than x86.
+
+Fixes: 2cc13bb4f59f ("iommu: Disable passthrough mode when SME is active")
+Signed-off-by: Joerg Roedel <jroedel@suse.de>
+---
+ drivers/iommu/iommu.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
+index 66cfacaa483d..d658c7c6a2ab 100644
+--- a/drivers/iommu/iommu.c
++++ b/drivers/iommu/iommu.c
+@@ -120,8 +120,8 @@ static int __init iommu_subsys_init(void)
+ else
+ iommu_set_default_translated(false);
+
+- if (iommu_default_passthrough() && sme_active()) {
+- pr_info("SME detected - Disabling default IOMMU Passthrough\n");
++ if (iommu_default_passthrough() && mem_encrypt_active()) {
++ pr_info("Memory encryption detected - Disabling default IOMMU Passthrough\n");
+ iommu_set_default_translated(false);
+ }
+ }
+
diff --git a/series.conf b/series.conf
index 4e5d813be3..6e21ea86b8 100644
--- a/series.conf
+++ b/series.conf
@@ -50575,6 +50575,7 @@
patches.suse/0009-iommu-Set-default-domain-type-at-runtime.patch
patches.suse/0010-iommu-Disable-passthrough-mode-when-SME-is-active.patch
patches.suse/0011-Documentation-Update-Documentation-for-iommu.passthr.patch
+ patches.suse/iommu-don-t-use-sme_active-in-generic-code
########################################################
# kABI consistency patches