Why do we pass memory map both in e820 and efi_info
dyoung at redhat.com
Wed May 7 19:24:50 PDT 2014
On 05/07/14 at 01:58pm, Vivek Goyal wrote:
> Hi Dave/Chao,
> I am going through kexec-tools code and it looks like that for EFI
> systems, we pass memory map entries both in bootparams e820 memory map
> as well as efi_info. I am wondering why that's the case?
Most UEFI firmware have a CSM (Compatibility Support Module) that could
have provided a suitable E820-style memory map to the kernel.
Linux kernel use E820 always either for legacy bios boot or UEFI boot.
For the machine firmware which does not provide E820 interface user can
specify 'add_efi_memmap' kernel cmdline thus kernel can add efi memmaps
to E820 array.
For the efi memmap in efi_info, it's necessary for efi boot because
efi initialization will use it. UEFI has a lot of mem types, E820 only
have several RAM,RESERVED, ACPI, etc. efi_init need the special UEFI
specific mem ranges ie. for boot services, runtime services etc. I believe
the UEFI specific mem ranges could be contained in the RESERVED E820 ranges
though I did not verify it.
> IOW, I am also trying to figure out as a bootloader, when should we
> pass memmap in e820 and when should it be passed in efi_info.
E820 is mandatory usually. efi_info only for UEFI boot.
More information about the kexec