From: "Huang, Ying" <ying.huang@intel.com>
To: "H. Peter Anvin" <hpa@zytor.com>,
andi@firstfloor.org, mingo@redhat.com, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] x86 boot: add E820_RESVD_KERN
Date: Thu, 26 Jun 2008 14:32:58 +0800 [thread overview]
Message-ID: <1214461978.10809.6.camel@caritas-dev.intel.com> (raw)
This patch add a new type to E820 table named E820_RESVD_KERN, which
is used for memory area reserved for kernel itself instead of BIOS.
This patch is based on latest x86/master branch of git-x86 tree and
has been tested on i386 and x86_64 platform.
Signed-off-by: Huang Ying <ying.huang@intel.com>
---
arch/x86/kernel/e820.c | 6 ++++--
include/asm-x86/e820.h | 3 +++
2 files changed, 7 insertions(+), 2 deletions(-)
--- a/include/asm-x86/e820.h
+++ b/include/asm-x86/e820.h
@@ -44,6 +44,9 @@
#define E820_ACPI 3
#define E820_NVS 4
+/* reserved RAM used by kernel itself */
+#define E820_RESVD_KERN 128
+
#ifndef __ASSEMBLY__
struct e820entry {
__u64 addr; /* start of memory segment */
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -120,6 +120,7 @@ void __init e820_print_map(char *who)
(e820.map[i].addr + e820.map[i].size));
switch (e820.map[i].type) {
case E820_RAM:
+ case E820_RESVD_KERN:
printk(KERN_CONT "(usable)\n");
break;
case E820_RESERVED:
@@ -611,7 +612,7 @@ void __init e820_mark_nosave_regions(uns
register_nosave_region(pfn, PFN_UP(ei->addr));
pfn = PFN_DOWN(ei->addr + ei->size);
- if (ei->type != E820_RAM)
+ if (ei->type != E820_RAM && ei->type != E820_RESVD_KERN)
register_nosave_region(PFN_UP(ei->addr), pfn);
if (pfn >= limit_pfn)
@@ -977,7 +978,7 @@ u64 __init early_reserve_e820(u64 startt
return 0;
addr = round_down(start + size - sizet, align);
- e820_update_range(addr, sizet, E820_RAM, E820_RESERVED);
+ e820_update_range(addr, sizet, E820_RAM, E820_RESVD_KERN);
printk(KERN_INFO "update e820 for early_reserve_e820\n");
update_e820();
@@ -1191,6 +1192,7 @@ void __init e820_reserve_resources(void)
res = alloc_bootmem_low(sizeof(struct resource) * e820.nr_map);
for (i = 0; i < e820.nr_map; i++) {
switch (e820.map[i].type) {
+ case E820_RESVD_KERN:
case E820_RAM: res->name = "System RAM"; break;
case E820_ACPI: res->name = "ACPI Tables"; break;
case E820_NVS: res->name = "ACPI Non-volatile Storage"; break;
next reply other threads:[~2008-06-26 6:29 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-26 6:32 Huang, Ying [this message]
2008-06-26 7:25 ` [PATCH 1/2] x86 boot: add E820_RESVD_KERN Yinghai Lu
2008-06-26 7:48 ` Huang, Ying
2008-06-26 9:47 ` Yinghai Lu
2008-06-27 2:22 ` Yinghai Lu
2008-06-27 2:48 ` Huang, Ying
2008-06-27 2:52 ` Yinghai Lu
2008-06-27 3:03 ` Huang, Ying
2008-06-27 5:36 ` Yinghai Lu
2008-06-27 22:05 ` Yinghai Lu
2008-06-30 7:03 ` Huang, Ying
2008-06-30 7:34 ` Yinghai Lu
2008-06-30 7:51 ` Huang, Ying
2008-06-30 9:15 ` Yinghai Lu
2008-06-30 9:31 ` Yinghai Lu
2008-06-30 9:38 ` Huang, Ying
2008-06-30 19:05 ` Yinghai Lu
2008-06-30 19:16 ` Ingo Molnar
2008-06-30 22:53 ` Yinghai Lu
2008-06-30 23:20 ` Yinghai Lu
2008-07-01 1:09 ` Huang, Ying
2008-07-01 1:21 ` Yinghai Lu
2008-07-01 8:34 ` Ingo Molnar
2008-07-01 2:45 ` Huang, Ying
2008-07-01 8:39 ` Ingo Molnar
2008-06-30 8:28 ` Ingo Molnar
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=1214461978.10809.6.camel@caritas-dev.intel.com \
--to=ying.huang@intel.com \
--cc=andi@firstfloor.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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