iommu: Don't use sme_active() in generic code
authorJoerg Roedel <jroedel@suse.de>
Tue, 3 Sep 2019 13:15:44 +0000 (15:15 +0200)
committerJoerg Roedel <jroedel@suse.de>
Tue, 3 Sep 2019 13:15:44 +0000 (15:15 +0200)
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

index 66cfacaa483d5312c787a5e194b63291bae139ed..d658c7c6a2ab0a6d3d6fcffdb89edf03f9b9bda2 100644 (file)
@@ -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);
                }
        }