summaryrefslogtreecommitdiffstats
path: root/src/soc/intel/common
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2021-06-23 10:48:28 +0200
committerPatrick Georgi <pgeorgi@google.com>2021-06-24 09:00:50 +0000
commitcd96fed5dc3a203b076cbc74b337e59020d924ae (patch)
treefca38fa2ea217bcd7bffaa22cf20957208992685 /src/soc/intel/common
parent0007fa96a1a720fa1938259135d6a864452198f4 (diff)
downloadcoreboot-cd96fed5dc3a203b076cbc74b337e59020d924ae.tar.gz
coreboot-cd96fed5dc3a203b076cbc74b337e59020d924ae.tar.bz2
coreboot-cd96fed5dc3a203b076cbc74b337e59020d924ae.zip
soc/intel/cache_as_ram.S: Add macro to detect bootguard nem
Change-Id: I3867fce29d23b647fad9845b9a5c08bb949fa354 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55783 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/common')
-rw-r--r--src/soc/intel/common/block/cpu/car/cache_as_ram.S20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/soc/intel/common/block/cpu/car/cache_as_ram.S b/src/soc/intel/common/block/cpu/car/cache_as_ram.S
index 60ec6c591997..d880c2588d1c 100644
--- a/src/soc/intel/common/block/cpu/car/cache_as_ram.S
+++ b/src/soc/intel/common/block/cpu/car/cache_as_ram.S
@@ -59,6 +59,18 @@
rep stosl
.endm
+/*
+ * macro: is_bootguard_nem
+ * Checks if the Bootguard ACM has enabled non eviction mode
+ * Clobbers %eax, %ecx, %edx
+ * Returns %eax and sets/unsets zero flag
+ */
+.macro is_bootguard_nem
+ movl $MSR_BOOT_GUARD_SACM_INFO, %ecx
+ rdmsr
+ andl $B_BOOT_GUARD_SACM_INFO_NEM_ENABLED, %eax
+.endm
+
.global bootblock_pre_c_entry
bootblock_pre_c_entry:
@@ -66,9 +78,7 @@ bootblock_pre_c_entry:
/* Bootguard sets up its own CAR and needs separate handling */
check_boot_guard:
- movl $MSR_BOOT_GUARD_SACM_INFO, %ecx
- rdmsr
- andl $B_BOOT_GUARD_SACM_INFO_NEM_ENABLED, %eax
+ is_bootguard_nem
jz no_bootguard
/* Disable PBE timer */
@@ -204,9 +214,7 @@ setup_car_mtrr:
#endif
post_code(0x25)
- movl $MSR_BOOT_GUARD_SACM_INFO, %ecx
- rdmsr
- andl $B_BOOT_GUARD_SACM_INFO_NEM_ENABLED, %eax
+ is_bootguard_nem
jz no_bootguard_car_continue
clear_car