Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34993 )
Change subject: arch/x86: Include cbmem region into postcar_frame ......................................................................
arch/x86: Include cbmem region into postcar_frame
This patch signals to the system that cbmem region also needs to be accounted for as it holds cbmem metadata.
Change-Id: Ibd2ded90f4faa5d4996f3aefb4da9083a42e0aa8 Signed-off-by: Subrata Banik subrata.banik@intel.com --- M src/arch/x86/include/arch/cpu.h M src/arch/x86/postcar_loader.c 2 files changed, 8 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/93/34993/1
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h index 075e890..42c8a97 100644 --- a/src/arch/x86/include/arch/cpu.h +++ b/src/arch/x86/include/arch/cpu.h @@ -300,6 +300,8 @@ struct postcar_frame { uintptr_t stack_top; uintptr_t stack; + uintptr_t cbmem_top; + size_t cbmem_size; uint32_t upper_mask; int max_var_mtrrs; int num_var_mtrrs; diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c index d017260..94fde20 100644 --- a/src/arch/x86/postcar_loader.c +++ b/src/arch/x86/postcar_loader.c @@ -69,6 +69,9 @@ /* Keep track of stack top to calculate size used */ pcf->stack_top = pcf->stack; pcf->stack_top += stack_size; + /* Keep track of cbem top and its size */ + pcf->cbmem_top = (uintptr_t) cbmem_top(); + pcf->cbmem_size = cbmem_overhead_size();
return 0; } @@ -158,6 +161,9 @@ SEG_FINAL); /* Also signal the stack region that was written as well */ prog_segment_loaded(pcf->stack, pcf->stack_top - pcf->stack, SEG_FINAL); + /* Also signal that cbmem region that was written as well */ + prog_segment_loaded(pcf->cbmem_top - pcf->cbmem_size, pcf->cbmem_size, + SEG_FINAL); }
static void load_postcar_cbfs(struct prog *prog, struct postcar_frame *pcf)