From: Sandipan Das Define the new VMCB fields that will be used to save and restore the state of the following Last Branch Record Extension Version 2 (LbrExtV2) related MSRs. * Last Branch Stack Select (MSR 0xc000010e) * Debug Extension Control (MSR 0xc000010f) * LBRv2 Branch FROM (MSRs 0xc0010300..0xc001031e) * LBRv2 Branch To (MSRs 0xc0010301..0xc001031f) Signed-off-by: Sandipan Das Signed-off-by: Shivansh Dhiman --- arch/x86/include/asm/svm.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h index 83fd49b26a4b..d76844224745 100644 --- a/arch/x86/include/asm/svm.h +++ b/arch/x86/include/asm/svm.h @@ -372,8 +372,15 @@ struct vmcb_save_area { u64 br_to; u64 last_excp_from; u64 last_excp_to; - u8 reserved_0x298[72]; + u64 dbg_extn_cfg; + u8 reserved_0x2a0[64]; u64 spec_ctrl; /* Guest version of SPEC_CTRL at 0x2E0 */ + u8 reserved_0x2e8[904]; + struct { + u64 lbr_stack_from; + u64 lbr_stack_to; + } __packed lbr[16]; + u64 lbr_select; } __packed; /* Save area definition for SEV-ES and SEV-SNP guests */ @@ -556,7 +563,7 @@ struct vmcb { }; } __packed; -#define EXPECTED_VMCB_SAVE_AREA_SIZE 744 +#define EXPECTED_VMCB_SAVE_AREA_SIZE 1912 #define EXPECTED_GHCB_SAVE_AREA_SIZE 1032 #define EXPECTED_SEV_ES_SAVE_AREA_SIZE 1648 #define EXPECTED_VMCB_CONTROL_AREA_SIZE 1024 @@ -581,7 +588,8 @@ static inline void __unused_size_checks(void) BUILD_BUG_RESERVED_OFFSET(vmcb_save_area, 0xd8); BUILD_BUG_RESERVED_OFFSET(vmcb_save_area, 0x180); BUILD_BUG_RESERVED_OFFSET(vmcb_save_area, 0x248); - BUILD_BUG_RESERVED_OFFSET(vmcb_save_area, 0x298); + BUILD_BUG_RESERVED_OFFSET(vmcb_save_area, 0x2a0); + BUILD_BUG_RESERVED_OFFSET(vmcb_save_area, 0x2e8); BUILD_BUG_RESERVED_OFFSET(sev_es_save_area, 0xc8); BUILD_BUG_RESERVED_OFFSET(sev_es_save_area, 0xcc); -- 2.43.0