Skip to content

Commit 4ccd326

Browse files
tlendackymdroth
authored andcommitted
KVM: SEV: Add known supported SEV-SNP policy bits
Add to the known supported SEV-SNP policy bits that don't require any implementation support from KVM in order to successfully use them. At this time, this includes: - CXL_ALLOW - MEM_AES_256_XTS - RAPL_DIS - CIPHERTEXT_HIDING_DRAM - PAGE_SWAP_DISABLE Arguably, RAPL_DIS and CIPHERTEXT_HIDING_DRAM require KVM and the CCP driver to enable these features in order for the setting of the policy bits to be successfully handled. But, a guest owner may not wish their guest to run on a system that doesn't provide support for those features, so allowing the specification of these bits accomplishes that. Whether or not the bit is supported by SEV firmware, a system that doesn't support these features will either fail during the KVM validation of supported policy bits before issuing the LAUNCH_START or fail during the LAUNCH_START. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Michael Roth <michael.roth@amd.com>
1 parent 088f53d commit 4ccd326

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

arch/x86/kvm/svm/sev.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,22 @@ module_param_named(ciphertext_hiding_asids, nr_ciphertext_hiding_asids, uint, 04
6666
#define AP_RESET_HOLD_NAE_EVENT 1
6767
#define AP_RESET_HOLD_MSR_PROTO 2
6868

69-
#define KVM_SNP_POLICY_MASK_VALID (SNP_POLICY_MASK_API_MINOR | \
70-
SNP_POLICY_MASK_API_MAJOR | \
71-
SNP_POLICY_MASK_SMT | \
72-
SNP_POLICY_MASK_RSVD_MBO | \
73-
SNP_POLICY_MASK_DEBUG | \
74-
SNP_POLICY_MASK_SINGLE_SOCKET)
69+
/*
70+
* SEV-SNP policy bits that can be supported by KVM. These include policy bits
71+
* that have implementation support within KVM or policy bits that do not rely
72+
* on any implementation support within KVM.
73+
*/
74+
#define KVM_SNP_POLICY_MASK_VALID (SNP_POLICY_MASK_API_MINOR | \
75+
SNP_POLICY_MASK_API_MAJOR | \
76+
SNP_POLICY_MASK_SMT | \
77+
SNP_POLICY_MASK_RSVD_MBO | \
78+
SNP_POLICY_MASK_DEBUG | \
79+
SNP_POLICY_MASK_SINGLE_SOCKET | \
80+
SNP_POLICY_MASK_CXL_ALLOW | \
81+
SNP_POLICY_MASK_MEM_AES_256_XTS | \
82+
SNP_POLICY_MASK_RAPL_DIS | \
83+
SNP_POLICY_MASK_CIPHERTEXT_HIDING_DRAM | \
84+
SNP_POLICY_MASK_PAGE_SWAP_DISABLE)
7585

7686
static u64 snp_supported_policy_bits;
7787

0 commit comments

Comments
 (0)