[tip: x86/sev] x86/sev: Add Enhanced SMT Protection fields to the VMSA
From: tip-bot2 for Pratik R. Sampat
Date: Thu Dec 03 2026 - 13:06:40 EST
The following commit has been merged into the x86/sev branch of tip:
Commit-ID: 8509996df26124d9c36fad4d1541115c31036876
Gitweb: https://git.kernel.org/tip/8509996df26124d9c36fad4d1541115c31036876
Author: Pratik R. Sampat <prsampat@xxxxxxx>
AuthorDate: Tue, 17 Nov 2026 17:56:58
Committer: Borislav Petkov (AMD) <bp@xxxxxxxxx>
CommitterDate: Thu, 03 Dec 2026 09:32:36 -08:00
x86/sev: Add Enhanced SMT Protection fields to the VMSA
Enhanced SMT Protection (ESMTP) adds two VMSA fields that carry an SEV-SNP
vCPU's co-residency policy. VCPU_ID identifies the vCPU within the guest and
VCPU_SIBLING_MASK selects which of its peers it may share a physical core
with. Two ESMTP vCPUs of the same guest are legal siblings when their
VCPU_SIBLING_MASK values match and their VCPU_IDs agree outside that mask.
Add both fields to struct sev_es_save_area so that the guest can
populate them in the AP VMSAs it builds and the hypervisor can populate
them in the VMSAs it builds.
Refer to the AMD64 APM Vol 2, section "AMD64 Enhanced SMT Protection".
Signed-off-by: Pratik R. Sampat <prsampat@xxxxxxx>
Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>
Reviewed-by: Tom Lendacky <thomas.lendacky@xxxxxxx>
Link: https://lore.kernel.org/r/cover.1794935627.git.prsampat@xxxxxxx
---
arch/x86/include/asm/svm.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h
index 83fd49b..aceb405 100644
--- a/arch/x86/include/asm/svm.h
+++ b/arch/x86/include/asm/svm.h
@@ -486,6 +486,11 @@ struct sev_es_save_area {
u8 fpreg_x87[80];
u8 fpreg_xmm[256];
u8 fpreg_ymm[256];
+ u8 reserved_0x670[560];
+
+ /* Enhanced SMT Protection */
+ u32 vcpu_id;
+ u32 vcpu_sibling_mask;
} __packed;
struct ghcb_save_area {
@@ -558,7 +563,7 @@ struct vmcb {
#define EXPECTED_VMCB_SAVE_AREA_SIZE 744
#define EXPECTED_GHCB_SAVE_AREA_SIZE 1032
-#define EXPECTED_SEV_ES_SAVE_AREA_SIZE 1648
+#define EXPECTED_SEV_ES_SAVE_AREA_SIZE 2216
#define EXPECTED_VMCB_CONTROL_AREA_SIZE 1024
#define EXPECTED_GHCB_SIZE PAGE_SIZE
@@ -593,6 +598,7 @@ static inline void __unused_size_checks(void)
BUILD_BUG_RESERVED_OFFSET(sev_es_save_area, 0x320);
BUILD_BUG_RESERVED_OFFSET(sev_es_save_area, 0x380);
BUILD_BUG_RESERVED_OFFSET(sev_es_save_area, 0x3f0);
+ BUILD_BUG_RESERVED_OFFSET(sev_es_save_area, 0x670);
BUILD_BUG_RESERVED_OFFSET(ghcb_save_area, 0x0);
BUILD_BUG_RESERVED_OFFSET(ghcb_save_area, 0xcc);