Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59764 )
Change subject: x86_64 assembly: Don't touch %gs ......................................................................
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. Fixes a crash in MPinit seen after calling FSP-S.
Change-Id: If9fc999b34530de5d8b6ad27b9af25fc552e9420 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/cpu/x86/64bit/exit32.inc M src/security/intel/txt/getsec_enteraccs.S 2 files changed, 6 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/59764/1
diff --git a/src/cpu/x86/64bit/exit32.inc b/src/cpu/x86/64bit/exit32.inc index 4d1149e..3ac86a9 100644 --- a/src/cpu/x86/64bit/exit32.inc +++ b/src/cpu/x86/64bit/exit32.inc @@ -68,7 +68,6 @@ movl %eax, %es movl %eax, %ss movl %eax, %fs - movl %eax, %gs
/* Disable paging. */ movl %cr0, %eax diff --git a/src/security/intel/txt/getsec_enteraccs.S b/src/security/intel/txt/getsec_enteraccs.S index 09f9f38..cbb24b6 100644 --- a/src/security/intel/txt/getsec_enteraccs.S +++ b/src/security/intel/txt/getsec_enteraccs.S @@ -227,6 +227,10 @@ 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 @@ movl %eax, %es movl %eax, %ss movl %eax, %fs + /* Restore %gs used by CPU_INFO_V2 */ + movd %xmm2, %eax movl %eax, %gs
/* Disable cache */