AMD EPYC 5th generation processors have introduced a feature that allows the hypervisor to control the SEV_FEATURES that are set for, or by, a guest. ALLOWED_SEV_FEATURES can be used by the hypervisor to enforce that SEV-ES and SEV-SNP guests cannot enable features that the hypervisor does not want to be enabled. Patch 1/2 adds support to detect the feature. Patch 2/2 configures the ALLOWED_SEV_FEATURES field in the VMCB according to the features the hypervisor supports. Based on tip/master commit a2767e7f31ad ("Merge branch into tip/master: 'x86/timers'") v2: - Added some SEV_FEATURES require to be explicitly allowed by ALLOWED_SEV_FEATURES wording (Sean). - Added Nikunj's Reviewed-by. v1: https://lore.kernel.org/lkml/20240802015732.3192877-1-kim.phillips@xxxxxxx/ Kim Phillips (2): x86/cpufeatures: Add "Allowed SEV Features" Feature KVM: SEV: Configure "ALLOWED_SEV_FEATURES" VMCB Field arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/include/asm/svm.h | 6 +++++- arch/x86/kvm/svm/sev.c | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) -- 2.34.1