summaryrefslogtreecommitdiff
path: root/src/security
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2020-10-14 09:51:29 +0200
committerPhilipp Deppenwiese <zaolin.daisuki@gmail.com>2020-10-15 08:33:23 +0000
commit7af8aca2460c5ad138484bc3f37891fac454d8b1 (patch)
treea390d858385eec12a635831d81f6aae3ec14927a /src/security
parent4b290b7b6f763f369b78cb83054e6ad65d83c4a3 (diff)
sec/intel/txt/getsec_enteraccs.S: Save and restore MTRR_DEF_TYPE
This needs to be saved and restored, otherwise the BSP might have an inconsistent MTRR setup with regards to the AP's which results in weird errors and slowdowns in the operating system. TESTED: Fixes booting OCP/Deltalake with Linux 5.8. Change-Id: Iace636ec6fca3b4d7b2856f0f054947c5b3bc8de Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46375 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Christian Walter <christian.walter@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/security')
-rw-r--r--src/security/intel/txt/getsec_enteraccs.S8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/security/intel/txt/getsec_enteraccs.S b/src/security/intel/txt/getsec_enteraccs.S
index 3135de79b2..563dc08a15 100644
--- a/src/security/intel/txt/getsec_enteraccs.S
+++ b/src/security/intel/txt/getsec_enteraccs.S
@@ -58,6 +58,7 @@ getsec_enteraccs:
/* Reserve space on stack for GDT */
subl $8, %esp
+ PUSH_MSR MTRR_DEF_TYPE_MSR
PUSH_MSR IA32_MISC_ENABLE
PUSH_MSR MTRR_FIX_64K_00000
PUSH_MSR MTRR_FIX_16K_80000
@@ -290,12 +291,7 @@ cond_pop_var_mtrrs:
POP_MSR MTRR_FIX_16K_80000
POP_MSR MTRR_FIX_64K_00000
POP_MSR IA32_MISC_ENABLE
-
- /* Enable fixed MTRRs */
- movl $(MTRR_DEF_TYPE_MSR), %ecx
- rdmsr
- orl $(MTRR_DEF_TYPE_FIX_EN), %eax
- wrmsr
+ POP_MSR MTRR_DEF_TYPE_MSR
/* Enable cache */
movl %cr0, %eax