From: Jerry Hoemann <jerry.hoemann@hp.com>
To: rob@landley.net, tglx@linutronix.de, mingo@redhat.com,
hpa@zytor.com, x86@kernel.org, matt.fleming@intel.com,
yinghai@kernel.org, penberg@kernel.org,
akpm@linux-foundation.org, linux-doc@vger.kernel.org,
linux-efi@vger.kernel.org, vgoyal@redhat.com
Cc: linux-kernel@vger.kernel.org, jerry.hoemann@hp.com
Subject: [PATCH 3/3] x86, efi: Early use of boot service memory
Date: Mon, 11 Nov 2013 19:15:58 -0700 [thread overview]
Message-ID: <1384222558-38527-4-git-send-email-jerry.hoemann@hp.com> (raw)
In-Reply-To: <1384222558-38527-1-git-send-email-jerry.hoemann@hp.com>
Extend the kernel parameter add_efi_memmap to have additional
optional arguement "correct." EFI memmaps that are "correct"
aren't accessed by platform firmware after a call to Exit Boot
Services.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hp.com>
---
Documentation/kernel-parameters.txt | 8 ++++++++
arch/x86/platform/efi/efi.c | 13 +++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index fcbb736..ae1bde6 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -346,6 +346,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
add_efi_memmap [EFI; X86] Include EFI memory map in
kernel's map of available physical RAM.
+ add_efi_memmap= [EFI; X86] Include EFI memory map in
+ kernel's map of available physical RAM.
+ Additional Modifies:
+
+ correct: Platform firmware correctly doesn't reuse
+ boot service code or data segments after Exit Boot
+ Services.
+
agp= [AGP]
{ off | try_unsupported }
off: disable AGP support
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index c7e22ab..0cb1cce 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -103,6 +103,10 @@ EXPORT_SYMBOL(add_efi_memmap);
static int __init setup_add_efi_memmap(char *arg)
{
add_efi_memmap = 1;
+ if (arg && strstr(arg, "correct")) {
+ pr_info("%s: setting EFI_MEMMAP_CORRECT\n", __func__);
+ set_bit(EFI_MEMMAP_CORRECT, &x86_efi_facility);
+ }
return 0;
}
early_param("add_efi_memmap", setup_add_efi_memmap);
@@ -422,6 +426,8 @@ static void __init print_efi_memmap(void)
}
#endif /* EFI_DEBUG */
+static int efi_boot_services_reservations;
+
void __init efi_reserve_boot_services(void)
{
void *p;
@@ -449,8 +455,10 @@ void __init efi_reserve_boot_services(void)
memblock_dbg("Could not reserve boot range "
"[0x%010llx-0x%010llx]\n",
start, start+size-1);
- } else
+ } else {
memblock_reserve(start, size);
+ efi_boot_services_reservations++;
+ }
}
}
@@ -467,7 +475,7 @@ void __init efi_free_boot_services(void)
{
void *p;
- if (!efi_is_native())
+ if (!efi_is_native() || !efi_boot_services_reservations)
return;
for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
@@ -484,6 +492,7 @@ void __init efi_free_boot_services(void)
continue;
free_bootmem_late(start, size);
+ efi_boot_services_reservations--;
}
efi_unmap_memmap();
--
1.7.11.3
next prev parent reply other threads:[~2013-11-12 2:16 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-12 2:15 [PATCH 0/3] " Jerry Hoemann
2013-11-12 2:15 ` [PATCH 1/3] efi: " Jerry Hoemann
2013-11-12 2:15 ` [PATCH 2/3] x86: avoid efi_reserve_boot_services Jerry Hoemann
2013-11-12 2:15 ` Jerry Hoemann [this message]
2013-11-12 10:37 ` [PATCH 0/3] Early use of boot service memory Pekka Enberg
2013-11-12 17:55 ` jerry.hoemann
2013-11-12 18:48 ` Pekka Enberg
2013-11-12 21:52 ` jerry.hoemann
2013-11-12 18:58 ` H. Peter Anvin
2013-11-13 22:45 ` jerry.hoemann
2013-11-13 22:49 ` H. Peter Anvin
2013-11-13 23:57 ` jerry.hoemann
2013-11-14 0:05 ` H. Peter Anvin
2013-11-14 1:40 ` jerry.hoemann
2014-08-01 9:54 ` Yuhong Bao
2013-11-14 8:24 ` Pekka Enberg
2013-11-14 18:04 ` jerry.hoemann
2013-11-14 18:44 ` Pekka Enberg
2013-11-14 18:45 ` H. Peter Anvin
2013-11-15 0:50 ` jerry.hoemann
2013-11-15 6:24 ` Ingo Molnar
2013-11-15 6:55 ` Yinghai Lu
2013-11-15 6:59 ` H. Peter Anvin
2013-11-15 14:07 ` Vivek Goyal
2013-11-15 17:33 ` Yinghai Lu
2013-11-15 17:40 ` H. Peter Anvin
2013-11-15 18:30 ` Vivek Goyal
2013-11-15 18:46 ` H. Peter Anvin
2013-11-15 19:16 ` H. Peter Anvin
2013-11-18 15:22 ` Vivek Goyal
2013-11-18 18:29 ` H. Peter Anvin
2013-11-18 18:52 ` Vivek Goyal
2013-11-19 1:32 ` H. Peter Anvin
2013-11-19 3:02 ` Yinghai Lu
2013-11-15 18:03 ` Vivek Goyal
2013-11-15 22:24 ` Yinghai Lu
2013-11-15 22:55 ` jerry.hoemann
2013-11-15 23:43 ` Yinghai Lu
2013-11-18 15:32 ` Vivek Goyal
2013-11-18 19:34 ` Yinghai Lu
2013-11-18 19:39 ` Vivek Goyal
2013-11-15 18:16 ` jerry.hoemann
2013-11-15 19:13 ` jerry.hoemann
2013-11-18 15:42 ` Vivek Goyal
2013-11-15 8:36 ` Pekka Enberg
2013-11-14 15:26 ` Vivek Goyal
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=1384222558-38527-4-git-send-email-jerry.hoemann@hp.com \
--to=jerry.hoemann@hp.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt.fleming@intel.com \
--cc=mingo@redhat.com \
--cc=penberg@kernel.org \
--cc=rob@landley.net \
--cc=tglx@linutronix.de \
--cc=vgoyal@redhat.com \
--cc=x86@kernel.org \
--cc=yinghai@kernel.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
all inboxes | Powered by JetHome®