summaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorTom Lendacky <thomas.lendacky@amd.com>2017-10-20 09:30:44 -0500
committerThomas Gleixner <tglx@linutronix.de>2017-11-07 15:35:54 +0100
commitd8aa7eea78a1401cce39b3bb61ead0150044a3df (patch)
tree8578eb975c77968db7003b83d1c670ff27b35451 /arch/x86/include
parent33e63acc119d15c2fac3e3775f32d1ce7a01021b (diff)
downloadlinux-stable-d8aa7eea78a1401cce39b3bb61ead0150044a3df.tar.gz
linux-stable-d8aa7eea78a1401cce39b3bb61ead0150044a3df.tar.bz2
linux-stable-d8aa7eea78a1401cce39b3bb61ead0150044a3df.zip
x86/mm: Add Secure Encrypted Virtualization (SEV) support
Provide support for Secure Encrypted Virtualization (SEV). This initial support defines a flag that is used by the kernel to determine if it is running with SEV active. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Borislav Petkov <bp@suse.de> Tested-by: Borislav Petkov <bp@suse.de> Cc: kvm@vger.kernel.org Cc: Borislav Petkov <bp@alien8.de> Cc: Andy Lutomirski <luto@kernel.org> Link: https://lkml.kernel.org/r/20171020143059.3291-3-brijesh.singh@amd.com
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/mem_encrypt.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h
index 6a77c63540f7..2b024741bce9 100644
--- a/arch/x86/include/asm/mem_encrypt.h
+++ b/arch/x86/include/asm/mem_encrypt.h
@@ -47,6 +47,9 @@ void __init mem_encrypt_init(void);
void swiotlb_set_mem_attributes(void *vaddr, unsigned long size);
+bool sme_active(void);
+bool sev_active(void);
+
#else /* !CONFIG_AMD_MEM_ENCRYPT */
#define sme_me_mask 0ULL
@@ -64,6 +67,9 @@ static inline void __init sme_early_init(void) { }
static inline void __init sme_encrypt_kernel(void) { }
static inline void __init sme_enable(struct boot_params *bp) { }
+static inline bool sme_active(void) { return false; }
+static inline bool sev_active(void) { return false; }
+
#endif /* CONFIG_AMD_MEM_ENCRYPT */
/*