aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorEugene D. Myers <edmyers@cyberpackventures.com>2023-11-02 13:34:56 -0700
committerFelix Held <felix-coreboot@felixheld.de>2023-11-10 15:27:13 +0000
commitd205cf7e4ef6ebec49d45ec97f501f7de843ac94 (patch)
tree0445ffa9161c2aba05caf2e92fbeb6eb2fcacd00 /src/include
parent42f1fef5a620e98e7ece6a60744992265cc409d7 (diff)
cpu/x86/smm: Fix get_save_state calculation
When the SMI transfer monitor (STM) is configured, get_save_state returns an incorrect pointer to the cpu save state because the size (rounded up to 0x100) of the processor System Management Mode (SMM) descriptor needs to be subtracted out in this case. This patch addresses the issue identified in CB:76601, which means that SMMSTOREv2 now works with the STM. Thanks to Jeremy Compostella for suggesting this version of the patch. Resolves: https://ticket.coreboot.org/issues/511 Change-Id: I0233c6d13bdffb3853845ac6ef25c066deaab747 Signed-off-by: Eugene D. Myers <edmyers@cyberpackventures.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78889 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/cpu/x86/smm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h
index 68c7c3bba7..a240ac2f51 100644
--- a/src/include/cpu/x86/smm.h
+++ b/src/include/cpu/x86/smm.h
@@ -33,6 +33,15 @@
#define SMM_PCI_RESOURCE_STORE_NUM_RESOURCES 6
+/*
+ * SMI Transfer Monitor (STM) descriptor reserved in SMM save state.
+ */
+#if CONFIG(STM)
+#define STM_PSD_SIZE ALIGN_UP(sizeof(TXT_PROCESSOR_SMM_DESCRIPTOR), 0x100)
+#else
+#define STM_PSD_SIZE 0
+#endif
+
/* Send cmd to APM_CNT with HAVE_SMI_HANDLER checking. */
int apm_control(u8 cmd);
u8 apm_get_apmc(void);