File tree Expand file tree Collapse file tree 4 files changed +17
-0
lines changed Expand file tree Collapse file tree 4 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,9 @@ static bool amd_cc_platform_has(enum cc_attr attr)
5757 return (sev_status & MSR_AMD64_SEV_ENABLED ) &&
5858 !(sev_status & MSR_AMD64_SEV_ES_ENABLED );
5959
60+ case CC_ATTR_GUEST_SEV_SNP :
61+ return sev_status & MSR_AMD64_SEV_SNP_ENABLED ;
62+
6063 default :
6164 return false;
6265 }
Original file line number Diff line number Diff line change 502502#define MSR_AMD64_SEV 0xc0010131
503503#define MSR_AMD64_SEV_ENABLED_BIT 0
504504#define MSR_AMD64_SEV_ES_ENABLED_BIT 1
505+ #define MSR_AMD64_SEV_SNP_ENABLED_BIT 2
505506#define MSR_AMD64_SEV_ENABLED BIT_ULL(MSR_AMD64_SEV_ENABLED_BIT)
506507#define MSR_AMD64_SEV_ES_ENABLED BIT_ULL(MSR_AMD64_SEV_ES_ENABLED_BIT)
508+ #define MSR_AMD64_SEV_SNP_ENABLED BIT_ULL(MSR_AMD64_SEV_SNP_ENABLED_BIT)
507509
508510#define MSR_AMD64_VIRT_SPEC_CTRL 0xc001011f
509511
Original file line number Diff line number Diff line change @@ -62,6 +62,10 @@ static void print_mem_encrypt_feature_info(void)
6262 if (cc_platform_has (CC_ATTR_GUEST_STATE_ENCRYPT ))
6363 pr_cont (" SEV-ES" );
6464
65+ /* Secure Nested Paging */
66+ if (cc_platform_has (CC_ATTR_GUEST_SEV_SNP ))
67+ pr_cont (" SEV-SNP" );
68+
6569 pr_cont ("\n" );
6670}
6771
Original file line number Diff line number Diff line change @@ -72,6 +72,14 @@ enum cc_attr {
7272 * Examples include TDX guest & SEV.
7373 */
7474 CC_ATTR_GUEST_UNROLL_STRING_IO ,
75+
76+ /**
77+ * @CC_ATTR_SEV_SNP: Guest SNP is active.
78+ *
79+ * The platform/OS is running as a guest/virtual machine and actively
80+ * using AMD SEV-SNP features.
81+ */
82+ CC_ATTR_GUEST_SEV_SNP ,
7583};
7684
7785#ifdef CONFIG_ARCH_HAS_CC_PLATFORM
You can’t perform that action at this time.
0 commit comments