sev.h (990B)
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * AMD Secure Encrypted Virtualization 4 * 5 * Author: Brijesh Singh <brijesh.singh@amd.com> 6 */ 7 8#ifndef __LINUX_SEV_H 9#define __LINUX_SEV_H 10 11/* RMUPDATE detected 4K page and 2MB page overlap. */ 12#define RMPUPDATE_FAIL_OVERLAP 7 13 14#ifdef CONFIG_AMD_MEM_ENCRYPT 15int snp_lookup_rmpentry(u64 pfn, int *level); 16int psmash(u64 pfn); 17int rmp_make_private(u64 pfn, u64 gpa, enum pg_level level, int asid, bool immutable); 18int rmp_make_shared(u64 pfn, enum pg_level level); 19void dump_rmpentry(u64 pfn); 20#else 21static inline int snp_lookup_rmpentry(u64 pfn, int *level) { return 0; } 22static inline int psmash(u64 pfn) { return -ENXIO; } 23static inline int rmp_make_private(u64 pfn, u64 gpa, enum pg_level level, int asid, 24 bool immutable) 25{ 26 return -ENODEV; 27} 28static inline int rmp_make_shared(u64 pfn, enum pg_level level) { return -ENODEV; } 29static inline void dump_rmpentry(u64 pfn) { } 30 31#endif /* CONFIG_AMD_MEM_ENCRYPT */ 32#endif /* __LINUX_SEV_H */