diff options
author | Joerg Roedel <jroedel@suse.de> | 2020-09-07 15:15:37 +0200 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2020-09-07 23:00:20 +0200 |
commit | b57de6cd16395be1ebdaa9b489ffbf462bb585c4 (patch) | |
tree | 24169b5dddc82ac87771fec6d1b9f6818fc92879 /arch/x86/include/asm/msr-index.h | |
parent | x86/head/64: Move early exception dispatch to C code (diff) | |
download | linux-b57de6cd16395be1ebdaa9b489ffbf462bb585c4.tar.xz linux-b57de6cd16395be1ebdaa9b489ffbf462bb585c4.zip |
x86/sev-es: Add SEV-ES Feature Detection
Add a sev_es_active() function for checking whether SEV-ES is enabled.
Also cache the value of MSR_AMD64_SEV at boot to speed up the feature
checking in the running code.
[ bp: Remove "!!" in sev_active() too. ]
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lkml.kernel.org/r/20200907131613.12703-37-joro@8bytes.org
Diffstat (limited to 'arch/x86/include/asm/msr-index.h')
-rw-r--r-- | arch/x86/include/asm/msr-index.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index da34fdba7c5a..249a4147c4b2 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -469,7 +469,9 @@ #define MSR_AMD64_SEV_ES_GHCB 0xc0010130 #define MSR_AMD64_SEV 0xc0010131 #define MSR_AMD64_SEV_ENABLED_BIT 0 +#define MSR_AMD64_SEV_ES_ENABLED_BIT 1 #define MSR_AMD64_SEV_ENABLED BIT_ULL(MSR_AMD64_SEV_ENABLED_BIT) +#define MSR_AMD64_SEV_ES_ENABLED BIT_ULL(MSR_AMD64_SEV_ES_ENABLED_BIT) #define MSR_AMD64_VIRT_SPEC_CTRL 0xc001011f |