Skip to content

Commit f670634

Browse files
Kullu14sean-jc
authored andcommitted
KVM: SVM: correct the size of spec_ctrl field in VMCB save area
Correct the spec_ctrl field in the VMCB save area based on the AMD Programmer's manual. Originally, the spec_ctrl was listed as u32 with 4 bytes of reserved area. The AMD Programmer's Manual now lists the spec_ctrl as 8 bytes in VMCB save area. The Public Processor Programming reference for Genoa, shows SPEC_CTRL as 64b register, but the AMD Programmer's Manual lists SPEC_CTRL as 32b register. This discrepancy will be cleaned up in next revision of the AMD Programmer's Manual. Since remaining bits above bit 7 are reserved bits in SPEC_CTRL MSR and thus, not being used, the spec_ctrl added as u32 in the VMCB save area is currently not an issue. Fixes: 3dd2775 ("KVM: SVM: Create a separate mapping for the SEV-ES save area") Suggested-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Manali Shukla <manali.shukla@amd.com> Link: https://lore.kernel.org/r/20230717041903.85480-1-manali.shukla@amd.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent f3cebc7 commit f670634

File tree

1 file changed

+2
-2
lines changed
  • arch/x86/include/asm

1 file changed

+2
-2
lines changed

arch/x86/include/asm/svm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ struct vmcb_save_area {
346346
u64 last_excp_from;
347347
u64 last_excp_to;
348348
u8 reserved_0x298[72];
349-
u32 spec_ctrl; /* Guest version of SPEC_CTRL at 0x2E0 */
349+
u64 spec_ctrl; /* Guest version of SPEC_CTRL at 0x2E0 */
350350
} __packed;
351351

352352
/* Save area definition for SEV-ES and SEV-SNP guests */
@@ -513,7 +513,7 @@ struct ghcb {
513513
} __packed;
514514

515515

516-
#define EXPECTED_VMCB_SAVE_AREA_SIZE 740
516+
#define EXPECTED_VMCB_SAVE_AREA_SIZE 744
517517
#define EXPECTED_GHCB_SAVE_AREA_SIZE 1032
518518
#define EXPECTED_SEV_ES_SAVE_AREA_SIZE 1648
519519
#define EXPECTED_VMCB_CONTROL_AREA_SIZE 1024

0 commit comments

Comments
 (0)