From 11ff753407ee7fd1cb2da06f8bedc5ac40ebbd95 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Tue, 6 Jun 2023 00:29:58 +0200 Subject: soc/amd/common/block/cpu/noncar: add get_usable_physical_address_bits() In case the secure memory encryption is enabled, some of the upper usable address bits of the host can't be used any more. Bits 11..6 in CPUID_EBX_MEM_ENCRYPT indicate how many of the address bits are taken away from the usable address bits in the case the secure memory encryption is enabled. Signed-off-by: Felix Held Change-Id: Ia810b0984972216095da2ad8f9c19e37684f2a2e Reviewed-on: https://review.coreboot.org/c/coreboot/+/75623 Reviewed-by: Arthur Heymans Reviewed-by: Raul Rangel Tested-by: build bot (Jenkins) --- src/include/cpu/amd/cpuid.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/include/cpu/amd/cpuid.h') diff --git a/src/include/cpu/amd/cpuid.h b/src/include/cpu/amd/cpuid.h index b593562a09..81d008de77 100644 --- a/src/include/cpu/amd/cpuid.h +++ b/src/include/cpu/amd/cpuid.h @@ -121,4 +121,8 @@ #define CPUID_EBX_THREADS_SHIFT 8 #define CPUID_EBX_THREADS_MASK (0xff << CPUID_EBX_THREADS_SHIFT) +#define CPUID_EBX_MEM_ENCRYPT 0x8000001f +#define CPUID_EBX_MEM_ENCRYPT_ADDR_BITS_SHIFT 6 +#define CPUID_EBX_MEM_ENCRYPT_ADDR_BITS_MASK (0x3f << CPUID_EBX_MEM_ENCRYPT_ADDR_BITS_SHIFT) + #endif /* CPU_AMD_CPUID_H */ -- cgit v1.2.3