From: Dmitry Skorodumov <sdmitry-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
To: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: sdmitry-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org
Subject: [PATCH] [v2] x86_64/efi: Use all 64 bit of efi_memmap in setup_e820()
Date: Wed, 22 Jul 2015 19:31:08 +0400 [thread overview]
Message-ID: <1437579068-14982-1-git-send-email-sdmitry@parallels.com> (raw)
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 bits 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.
Signed-off-by: Dmitry Skorodumov <sdmitry-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
tested in Parallels virtual machine with more then 3GB of memory
---
arch/x86/boot/compressed/eboot.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 2c82bd1..9108fe5 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -1184,6 +1184,12 @@ static efi_status_t setup_e820(struct boot_params *params,
u32 nr_entries;
u32 nr_desc;
int i;
+ unsigned long m;
+
+ m = efi->efi_memmap;
+#ifdef CONFIG_X86_64
+ m |= (u64)efi->efi_memmap_hi << 32;
+#endif
nr_entries = 0;
nr_desc = efi->efi_memmap_size / efi->efi_memdesc_size;
@@ -1191,7 +1197,6 @@ static efi_status_t setup_e820(struct boot_params *params,
for (i = 0; i < nr_desc; i++) {
efi_memory_desc_t *d;
unsigned int e820_type = 0;
- unsigned long m = efi->efi_memmap;
d = (efi_memory_desc_t *)(m + (i * efi->efi_memdesc_size));
switch (d->type) {
--
1.7.9.1
next reply other threads:[~2015-07-22 15:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 15:31 Dmitry Skorodumov [this message]
[not found] ` <1437579068-14982-1-git-send-email-sdmitry-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2015-07-28 11:24 ` [PATCH] [v2] x86_64/efi: Use all 64 bit of efi_memmap in setup_e820() Matt Fleming
[not found] ` <20150728112413.GA645-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-07-28 13:18 ` Dmitry Skorodumov
[not found] ` <BY1PR0301MB1255463A9A89D6247A81D242A18D0-M1kb196zaopYAF46dOS0O5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2015-07-28 20:42 ` [PATCH] " Matt Fleming
2015-07-28 14:16 ` Dmitry Skorodumov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1437579068-14982-1-git-send-email-sdmitry@parallels.com \
--to=sdmitry-bzqdu9zft3wakbo8gow8eq@public.gmane.org \
--cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox