The hypervisor uses the SEV_FEATURES field (offset 3B0h) in the Save State Area to control the SEV-SNP guest features such as SNPActive, vTOM, ReflectVC etc. An SEV-SNP guest can read the SEV_FEATURES fields through the SEV_STATUS MSR.
See APM2 Table 15-34 and B-4 for more details. Cc: Thomas Gleixner <t...@linutronix.de> Cc: Ingo Molnar <mi...@redhat.com> Cc: Borislav Petkov <b...@alien8.de> Cc: Joerg Roedel <jroe...@suse.de> Cc: "H. Peter Anvin" <h...@zytor.com> Cc: Tony Luck <tony.l...@intel.com> Cc: Dave Hansen <dave.han...@intel.com> Cc: "Peter Zijlstra (Intel)" <pet...@infradead.org> Cc: Paolo Bonzini <pbonz...@redhat.com> Cc: Tom Lendacky <thomas.lenda...@amd.com> Cc: David Rientjes <rient...@google.com> Cc: Sean Christopherson <sea...@google.com> Cc: Vitaly Kuznetsov <vkuzn...@redhat.com> Cc: Wanpeng Li <wanpen...@tencent.com> Cc: Jim Mattson <jmatt...@google.com> Cc: x...@kernel.org Cc: k...@vger.kernel.org Signed-off-by: Brijesh Singh <brijesh.si...@amd.com> --- arch/x86/include/asm/svm.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h index 1c561945b426..c38783a1d24f 100644 --- a/arch/x86/include/asm/svm.h +++ b/arch/x86/include/asm/svm.h @@ -212,6 +212,15 @@ struct __attribute__ ((__packed__)) vmcb_control_area { #define SVM_NESTED_CTL_SEV_ENABLE BIT(1) #define SVM_NESTED_CTL_SEV_ES_ENABLE BIT(2) +#define SVM_SEV_FEATURES_SNP_ACTIVE BIT(0) +#define SVM_SEV_FEATURES_VTOM BIT(1) +#define SVM_SEV_FEATURES_REFLECT_VC BIT(2) +#define SVM_SEV_FEATURES_RESTRICTED_INJECTION BIT(3) +#define SVM_SEV_FEATURES_ALTERNATE_INJECTION BIT(4) +#define SVM_SEV_FEATURES_DEBUG_SWAP BIT(5) +#define SVM_SEV_FEATURES_PREVENT_HOST_IBS BIT(6) +#define SVM_SEV_FEATURES_BTB_ISOLATION BIT(7) + struct vmcb_seg { u16 selector; u16 attrib; @@ -293,7 +302,8 @@ struct vmcb_save_area { u64 sw_exit_info_1; u64 sw_exit_info_2; u64 sw_scratch; - u8 reserved_11[56]; + u64 sev_features; + u8 reserved_11[48]; u64 xcr0; u8 valid_bitmap[16]; u64 x87_state_gpa; -- 2.17.1