From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp1040.oracle.com ([156.151.31.81]:48622 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753957AbbH0Psl (ORCPT ); Thu, 27 Aug 2015 11:48:41 -0400 From: Sasha Levin To: stable@vger.kernel.org, stable-commits@vger.kernel.org Cc: Dmitry Skorodumov , "Denis V. Lunev" , Matt Fleming , Sasha Levin Subject: [added to the 3.18 stable tree] x86/efi: Use all 64 bit of efi_memmap in setup_e820() Date: Thu, 27 Aug 2015 11:38:29 -0400 Message-Id: <1440689954-10813-71-git-send-email-sasha.levin@oracle.com> In-Reply-To: <1440689954-10813-1-git-send-email-sasha.levin@oracle.com> References: <1440689954-10813-1-git-send-email-sasha.levin@oracle.com> Sender: stable-owner@vger.kernel.org List-ID: From: Dmitry Skorodumov This patch has been added to the 3.18 stable tree. If you have any objections, please let us know. =============== [ Upstream commit 7cc03e48965453b5df1cce5062c826189b04b960 ] 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 Cc: Denis V. Lunev Cc: Signed-off-by: Matt Fleming Signed-off-by: Sasha Levin --- 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 3790a66..acdf06b 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c @@ -1194,6 +1194,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: -- 2.1.4