18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * SVM helper functions 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright 2018 IBM Corporation 68c2ecf20Sopenharmony_ci */ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#ifndef _ASM_POWERPC_MEM_ENCRYPT_H 98c2ecf20Sopenharmony_ci#define _ASM_POWERPC_MEM_ENCRYPT_H 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#include <asm/svm.h> 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_cistatic inline bool mem_encrypt_active(void) 148c2ecf20Sopenharmony_ci{ 158c2ecf20Sopenharmony_ci return is_secure_guest(); 168c2ecf20Sopenharmony_ci} 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_cistatic inline bool force_dma_unencrypted(struct device *dev) 198c2ecf20Sopenharmony_ci{ 208c2ecf20Sopenharmony_ci return is_secure_guest(); 218c2ecf20Sopenharmony_ci} 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ciint set_memory_encrypted(unsigned long addr, int numpages); 248c2ecf20Sopenharmony_ciint set_memory_decrypted(unsigned long addr, int numpages); 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci#endif /* _ASM_POWERPC_MEM_ENCRYPT_H */ 27