[Devel] [PATCH RHEL7 COMMIT] ms/x86/efi: Use all 64 bit of efi_memmap in setup_e820()

Konstantin Khorenko khorenko at virtuozzo.com
Wed Oct 28 09:28:57 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.9.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.9.4
------>
commit 24975b2edc075ad1afd9b4df90178298a1e7b298
Author: Dmitry Skorodumov <sdmitry at parallels.com>
Date:   Tue Jul 28 18:38:32 2015 +0400

    ms/x86/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.
    
    Signed-off-by: Dmitry Skorodumov <sdmitry at parallels.com>
    Cc: Denis V. Lunev <den at openvz.org>
    Cc: <stable at vger.kernel.org>
    Signed-off-by: Matt Fleming <matt.fleming at intel.com>
    
    https://jira.sw.ru/browse/PSBM-34786
---
 arch/x86/boot/compressed/eboot.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index dc3694d..c58c80d 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -634,6 +634,10 @@ static efi_status_t setup_e820(struct boot_params *params,
 		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) {
 		case EFI_RESERVED_TYPE:



More information about the Devel mailing list