stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [tip:x86/asm] x86/efi: Use all 64 bit of efi_memmap in setup_e820 ()
@ 2015-07-31 13:55 tip-bot for Dmitry Skorodumov
  0 siblings, 0 replies; only message in thread
From: tip-bot for Dmitry Skorodumov @ 2015-07-31 13:55 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: hpa, matt.fleming, sdmitry, mingo, den, stable, tglx

Commit-ID:  7cc03e48965453b5df1cce5062c826189b04b960
Gitweb:     http://git.kernel.org/tip/7cc03e48965453b5df1cce5062c826189b04b960
Author:     Dmitry Skorodumov <sdmitry@parallels.com>
AuthorDate: Tue, 28 Jul 2015 18:38:32 +0400
Committer:  Matt Fleming <matt.fleming@intel.com>
CommitDate: Thu, 30 Jul 2015 18:07:10 +0100

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@parallels.com>
Cc: Denis V. Lunev <den@openvz.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
---
 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 2c82bd1..7d69afd 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -1193,6 +1193,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:

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-31 13:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-31 13:55 [tip:x86/asm] x86/efi: Use all 64 bit of efi_memmap in setup_e820 () tip-bot for Dmitry Skorodumov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).