diff options
author | Tianyu Lan <tiala@microsoft.com> | 2023-08-18 12:29:11 +0200 |
---|---|---|
committer | Wei Liu <wei.liu@kernel.org> | 2023-08-22 02:38:20 +0200 |
commit | d6e2d652443751e290b2edb70173ec3c22f78fbe (patch) | |
tree | 3474f50f6559470984ae59cc5b077dfc430b0573 /arch/x86/hyperv | |
parent | hv_balloon: Update the balloon driver to use the SBRM API (diff) | |
download | linux-d6e2d652443751e290b2edb70173ec3c22f78fbe.tar.xz linux-d6e2d652443751e290b2edb70173ec3c22f78fbe.zip |
x86/hyperv: Add sev-snp enlightened guest static key
Introduce static key isolation_type_en_snp for enlightened
sev-snp guest check.
Reviewed-by: Dexuan Cui <decui@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Tianyu Lan <tiala@microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Link: https://lore.kernel.org/r/20230818102919.1318039-2-ltykernel@gmail.com
Diffstat (limited to 'arch/x86/hyperv')
-rw-r--r-- | arch/x86/hyperv/ivm.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/hyperv/ivm.c b/arch/x86/hyperv/ivm.c index 14f46ad2ca64..b2b5cb19fac9 100644 --- a/arch/x86/hyperv/ivm.c +++ b/arch/x86/hyperv/ivm.c @@ -413,3 +413,14 @@ bool hv_isolation_type_snp(void) { return static_branch_unlikely(&isolation_type_snp); } + +DEFINE_STATIC_KEY_FALSE(isolation_type_en_snp); +/* + * hv_isolation_type_en_snp - Check system runs in the AMD SEV-SNP based + * isolation enlightened VM. + */ +bool hv_isolation_type_en_snp(void) +{ + return static_branch_unlikely(&isolation_type_en_snp); +} + |