diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2021-06-23 10:48:28 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-06-24 09:00:50 +0000 |
commit | cd96fed5dc3a203b076cbc74b337e59020d924ae (patch) | |
tree | fca38fa2ea217bcd7bffaa22cf20957208992685 /src/soc/intel | |
parent | 0007fa96a1a720fa1938259135d6a864452198f4 (diff) |
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')
-rw-r--r-- | src/soc/intel/common/block/cpu/car/cache_as_ram.S | 20 |
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 60ec6c5919..d880c2588d 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 |