Attention is currently required from: Jérémy Compostella.
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/84040?usp=email )
Change subject: ext_stage_cache: Make sure variables are initializated ......................................................................
ext_stage_cache: Make sure variables are initializated
GCC LTO incorrectly warns about this it seems.
Change-Id: Ib1851295646258e97c489dc7402b9df3fcf092c1 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/cpu/x86/smm/tseg_region.c M src/lib/ext_stage_cache.c 2 files changed, 10 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/84040/1
diff --git a/src/cpu/x86/smm/tseg_region.c b/src/cpu/x86/smm/tseg_region.c index 413d5fc..e7c9832 100644 --- a/src/cpu/x86/smm/tseg_region.c +++ b/src/cpu/x86/smm/tseg_region.c @@ -53,8 +53,6 @@ sub_size = ied_size; break; default: - *start = 0; - *size = 0; return -1; }
@@ -65,10 +63,10 @@
void stage_cache_external_region(void **base, size_t *size) { + *base = NULL; + *size = 0; if (smm_subregion(SMM_SUBREGION_CACHE, (uintptr_t *)base, size)) { printk(BIOS_ERR, "No cache SMM subregion.\n"); - *base = NULL; - *size = 0; } }
diff --git a/src/lib/ext_stage_cache.c b/src/lib/ext_stage_cache.c index 462a635..470e4bd 100644 --- a/src/lib/ext_stage_cache.c +++ b/src/lib/ext_stage_cache.c @@ -16,6 +16,10 @@
imd = &imd_stage_cache; stage_cache_external_region(&base, &size); + if (base == NULL || size == 0) { + printk(BIOS_ERR, "Could not find external stage cache"); + return; + } imd_handle_init(imd, (void *)(size + (uintptr_t)base));
printk(BIOS_DEBUG, "External stage cache:\n"); @@ -32,6 +36,10 @@
imd = &imd_stage_cache; stage_cache_external_region(&base, &size); + if (base == NULL || size == 0) { + printk(BIOS_ERR, "Could not find external stage cache"); + return; + } imd_handle_init(imd, (void *)(size + (uintptr_t)base)); if (imd_recover(imd)) printk(BIOS_DEBUG, "Unable to recover external stage cache.\n");