From 7af8aca2460c5ad138484bc3f37891fac454d8b1 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 14 Oct 2020 09:51:29 +0200 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/46375 Reviewed-by: Angel Pons Reviewed-by: Christian Walter Tested-by: build bot (Jenkins) --- src/security/intel/txt/getsec_enteraccs.S | 8 ++------ 1 file 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