summaryrefslogtreecommitdiff
path: root/src/security/intel/txt
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2021-11-30 18:34:32 +0100
committerPatrick Georgi <patrick@coreboot.org>2021-12-06 12:37:48 +0000
commit5b334b88a635e46d47ce3f3b703d2470d6e8514c (patch)
treee57abd4d22b9ccaa7c771de1ad18845991521b9f /src/security/intel/txt
parentc7f0bca9c23ac8d96ffc5ec0fcaddf9190d7dbff (diff)
x86_64 assembly: Don't touch %gs
With CPU_INFO_V2 enabled %gs holds the pointer to the cpu_info struct, so don't clobber it. Backup and restore %gs where possible. Fixes a crash in MPinit seen after calling FSP-S. Change-Id: If9fc999b34530de5d8b6ad27b9af25fc552e9420 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/59764 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/security/intel/txt')
-rw-r--r--src/security/intel/txt/getsec_enteraccs.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/security/intel/txt/getsec_enteraccs.S b/src/security/intel/txt/getsec_enteraccs.S
index 09f9f389e6..cbb24b6511 100644
--- a/src/security/intel/txt/getsec_enteraccs.S
+++ b/src/security/intel/txt/getsec_enteraccs.S
@@ -227,6 +227,10 @@ cond_clear_var_mtrrs:
movd %esp, %xmm0
movd %ebp, %xmm1
+ /* Backup %gs used by CPU_INFO_V2 */
+ movl %gs, %eax
+ movd %eax, %xmm2
+
/*
* Get function arguments.
* It's important to pass the exact ACM size as it's used by getsec to verify
@@ -261,6 +265,8 @@ cond_clear_var_mtrrs:
movl %eax, %es
movl %eax, %ss
movl %eax, %fs
+ /* Restore %gs used by CPU_INFO_V2 */
+ movd %xmm2, %eax
movl %eax, %gs
/* Disable cache */