diff options
Diffstat (limited to 'arch/powerpc/platforms/pseries/svm.c')
| -rw-r--r-- | arch/powerpc/platforms/pseries/svm.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pseries/svm.c b/arch/powerpc/platforms/pseries/svm.c index 40c0637203d5..384c9dc1899a 100644 --- a/arch/powerpc/platforms/pseries/svm.c +++ b/arch/powerpc/platforms/pseries/svm.c @@ -7,10 +7,14 @@ */ #include <linux/mm.h> +#include <linux/memblock.h> +#include <linux/mem_encrypt.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 +29,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 +40,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 +53,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; |
