Messages in this thread | | | Subject | Re: [Patch v4] x86: make 'mem=' option to work for efi platform | From | Matt Fleming <> | Date | Wed, 05 Dec 2012 16:44:19 +0000 |
| |
On Tue, 2012-11-13 at 18:58 +0800, Wen Congyang wrote: > diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c > index ad44391..7592163 100644 > --- a/arch/x86/platform/efi/efi.c > +++ b/arch/x86/platform/efi/efi.c > @@ -314,10 +314,17 @@ static void __init do_add_efi_memmap(void) > int e820_type; > > switch (md->type) { > - case EFI_LOADER_CODE: > - case EFI_LOADER_DATA: > case EFI_BOOT_SERVICES_CODE: > case EFI_BOOT_SERVICES_DATA: > + /* EFI_BOOT_SERVICES_{CODE,DATA} needs to be mapped */ > + if (md->attribute & EFI_MEMORY_WB) > + e820_type = E820_RAM; > + else > + e820_type = E820_RESERVED; > + e820_add_region(start, size, e820_type); > + continue; > + case EFI_LOADER_CODE: > + case EFI_LOADER_DATA: > case EFI_CONVENTIONAL_MEMORY: > if (md->attribute & EFI_MEMORY_WB) > e820_type = E820_RAM;
This chunk seems to cause one of my EFI machines to crash. If I include EFI_LOADER_{CODE,DATA} in the same clause as EFI_BOOT_SERVICES* things work. I'm not sure why that is since the e820_type is E820_RAM.
Maybe I need to use memmap= too when booting?
| |