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>
This commit is contained in:
Arthur Heymans 2020-10-14 09:51:29 +02:00 committed by Philipp Deppenwiese
parent 4b290b7b6f
commit 7af8aca246
1 changed files with 2 additions and 6 deletions

View File

@ -58,6 +58,7 @@ getsec_enteraccs:
/* Reserve space on stack for GDT */ /* Reserve space on stack for GDT */
subl $8, %esp subl $8, %esp
PUSH_MSR MTRR_DEF_TYPE_MSR
PUSH_MSR IA32_MISC_ENABLE PUSH_MSR IA32_MISC_ENABLE
PUSH_MSR MTRR_FIX_64K_00000 PUSH_MSR MTRR_FIX_64K_00000
PUSH_MSR MTRR_FIX_16K_80000 PUSH_MSR MTRR_FIX_16K_80000
@ -290,12 +291,7 @@ cond_pop_var_mtrrs:
POP_MSR MTRR_FIX_16K_80000 POP_MSR MTRR_FIX_16K_80000
POP_MSR MTRR_FIX_64K_00000 POP_MSR MTRR_FIX_64K_00000
POP_MSR IA32_MISC_ENABLE POP_MSR IA32_MISC_ENABLE
POP_MSR MTRR_DEF_TYPE_MSR
/* Enable fixed MTRRs */
movl $(MTRR_DEF_TYPE_MSR), %ecx
rdmsr
orl $(MTRR_DEF_TYPE_FIX_EN), %eax
wrmsr
/* Enable cache */ /* Enable cache */
movl %cr0, %eax movl %cr0, %eax