Hi,
FW reserved regions are needed for OS to access FW data such as ACPI APEI (ACPI Platform Error Interface) data. The ACPI APEI data may include previous boot error record (BERT), or error record reported through firmware runtime component (such as SMI handler). Such FW reserved region needs to be: a. Updateable by firmware bootloader or firmware runtime component. b. Updateable by OS drivers (for instance, the Linux ACPI BERT driver needs to be able to grab and clear the record. c. Reserved from being used as normal memory by OS.
If I just add BERT memory region through cbmem_add(), I get this OS error message: [ 12.899311] APEI: Can not request [mem 0x75319000-0x7531911b] for APEI BERT registers
If I also make this change: diff --git a/src/lib/bootmem.c b/src/lib/bootmem.c index 1fe23c2828..721d74ac75 100644 --- a/src/lib/bootmem.c +++ b/src/lib/bootmem.c @@ -49,7 +49,7 @@ static uint32_t bootmem_to_lb_tag(const enum bootmem_type tag) case BM_MEM_BL31: return LB_MEM_RESERVED; case BM_MEM_TABLE: - return LB_MEM_TABLE; + return LB_MEM_RESERVED;
Then it works fine, I get this: [ 12.902253] BERT: Error records from previous boot: [ 12.912270] [Hardware Error]: event severity: fatal [ 12.922288] [Hardware Error]: precise tstamp: 2020-08-13 21:56:18 [ 12.934980] [Hardware Error]: Error 0, type: fatal [ 12.944995] [Hardware Error]: section_type: general processor error [ 12.958227] [Hardware Error]: processor_type: 0, IA32/X64 [ 12.969674] [Hardware Error]: error_type: 0x02 [ 12.979157] [Hardware Error]: TLB error [ 12.987390] [Hardware Error]: version_info: 0x000000000005065a [ 12.999733] [Hardware Error]: processor_id: 0x0000000000000000
So the question is why we need to make memory attribute of cbmem as LB_MEM_TABLE, instead of LB_MEM_RESERVED?
Thank you, Jonathan