x86_64/efi: Use all 64 bit of efi_memmap in setup_e820()
PATCH v3 1/1 x86_64/efi: Use all 64 bit of efi_memmap in setup_e820()
The efi_info structure stores low 32 bits of memory map in efi_memmap and high 32 bits in efi_memmap_hi.
While constructing pointer in the setup_e820(), need to take into account all 64 bit of the pointer.
It is because on 64bit machine the function efi_get_memory_map() may return full 64bit pointer and before the patch that pointer was truncated.
The issue is triggered on Parallles virtual machine and fixed with this patch
--- arch/x86/boot/compressed/eboot.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
arch/x86/boot/compressed/eboot.c +3 -0
@@ -1192,6 +1192,9 @@ static efi_status_t setup_e820(struct boot_params *params,efi_memory_desc_t *d;unsigned int e820_type =0 ;unsigned long m = efi->efi_memmap; +#ifdef CONFIG_X86_64 + m |= (u64 )efi->efi_memmap_hi <<32 ; +#endif d = (efi_memory_desc_t *)(m + (i * efi->efi_memdesc_size));switch (d->type) {
Signature · 1 line
1.7.9.1
A message that is not in the archive (sent off-list or not yet received): 1438094312-12833-1-git-send-email-sdmitry-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org
Matt Fleming
AppliedQuoted 10 lines · Dmitry Skorodumov
The
efi_infostructure stores low 32 bits of memory map inefi_memmapand high 32 bits inefi_memmap_hi.While constructing pointer in the
setup_e820(), need to take into account all 64 bit of the pointer.It is because on 64bit machine the function
efi_get_memory_map()may return full 64bit pointer and before the patch that pointer was truncated.
Quoted 8 lines
Signed-off-by Dmitry Skorodumov <[email protected]>CC Denis V. Lunev <[email protected]>The issue is triggered on Parallles virtual machine and fixed with this patch
--- arch/x86/boot/compressed/eboot.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
Applied to the EFI urgent queue, thanks!
Signature · 1 line
Matt Fleming, Intel Open Source Technology Center