From 028c0b640f1dd148dd72ec69efec377dc5ee25a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Niew=C3=B6hner?= Date: Tue, 15 Sep 2020 12:11:15 +0200 Subject: [PATCH] soc/intel/common/block/sgx: make PRMRR size setting depend on SGX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PRMRR size shall only be set when SGX is enabled. Make PRMRR depend on SGX enablement in Kconfig. Change-Id: I551942fd9cb8e7123d00dbd752abffe24788148c Signed-off-by: Michael Niewöhner Reviewed-on: https://review.coreboot.org/c/coreboot/+/45412 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/soc/intel/common/block/cpu/cpulib.c | 2 +- src/soc/intel/common/block/sgx/Kconfig | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/soc/intel/common/block/cpu/cpulib.c b/src/soc/intel/common/block/cpu/cpulib.c index fd3919750f..9ff7923664 100644 --- a/src/soc/intel/common/block/cpu/cpulib.c +++ b/src/soc/intel/common/block/cpu/cpulib.c @@ -346,7 +346,7 @@ int get_prmrr_size(void) int i; int valid_size; - if (!CONFIG(SOC_INTEL_COMMON_BLOCK_SGX)) + if (!CONFIG(SOC_INTEL_COMMON_BLOCK_SGX_ENABLE)) return 0; msr = rdmsr(MSR_PRMRR_VALID_CONFIG); diff --git a/src/soc/intel/common/block/sgx/Kconfig b/src/soc/intel/common/block/sgx/Kconfig index 771c54caa5..ef3365f312 100644 --- a/src/soc/intel/common/block/sgx/Kconfig +++ b/src/soc/intel/common/block/sgx/Kconfig @@ -26,6 +26,7 @@ config SOC_INTEL_COMMON_BLOCK_SGX_ENABLE config SOC_INTEL_COMMON_BLOCK_SGX_PRMRR_SIZE int + depends on SOC_INTEL_COMMON_BLOCK_SGX_ENABLE default 256 if SOC_INTEL_COMMON_BLOCK_SGX_PRMRR_SIZE_MAX default 256 if SOC_INTEL_COMMON_BLOCK_SGX_PRMRR_SIZE_256MB default 128 if SOC_INTEL_COMMON_BLOCK_SGX_PRMRR_SIZE_128MB @@ -35,6 +36,7 @@ config SOC_INTEL_COMMON_BLOCK_SGX_PRMRR_SIZE choice prompt "PRMRR size" + depends on SOC_INTEL_COMMON_BLOCK_SGX_ENABLE default SOC_INTEL_COMMON_BLOCK_SGX_PRMRR_SIZE_MAX if SOC_INTEL_COMMON_BLOCK_SGX_ENABLE default SOC_INTEL_COMMON_BLOCK_SGX_PRMRR_DISABLED if !SOC_INTEL_COMMON_BLOCK_SGX_ENABLE help