diff options
Diffstat (limited to 'arch/powerpc/platforms/pseries/svm.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/svm.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pseries/svm.c b/arch/powerpc/platforms/pseries/svm.c index 40c0637203d5..3b4045d508ec 100644 --- a/arch/powerpc/platforms/pseries/svm.c +++ b/arch/powerpc/platforms/pseries/svm.c @@ -7,10 +7,13 @@ */ #include <linux/mm.h> +#include <linux/memblock.h> +#include <linux/cc_platform.h> #include <asm/machdep.h> #include <asm/svm.h> #include <asm/swiotlb.h> #include <asm/ultravisor.h> +#include <asm/dtl.h> static int __init init_svm(void) { @@ -25,7 +28,7 @@ static int __init init_svm(void) * need to use the SWIOTLB buffer for DMA even if dma_capable() says * otherwise. */ - swiotlb_force = SWIOTLB_FORCE; + ppc_swiotlb_flags |= SWIOTLB_ANY | SWIOTLB_FORCE; /* Share the SWIOTLB buffer with the host. */ swiotlb_update_mem_attributes(); @@ -36,6 +39,9 @@ machine_early_initcall(pseries, init_svm); int set_memory_encrypted(unsigned long addr, int numpages) { + if (!cc_platform_has(CC_ATTR_MEM_ENCRYPT)) + return 0; + if (!PAGE_ALIGNED(addr)) return -EINVAL; @@ -46,6 +52,9 @@ int set_memory_encrypted(unsigned long addr, int numpages) int set_memory_decrypted(unsigned long addr, int numpages) { + if (!cc_platform_has(CC_ATTR_MEM_ENCRYPT)) + return 0; + if (!PAGE_ALIGNED(addr)) return -EINVAL; |