From: tip-bot for Jeremy Fitzhardinge <jeremy@goop.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
yinghai@kernel.org, jeremy.fitzhardinge@citrix.com,
jeremy@goop.org, tglx@linutronix.de, hpa@linux.intel.com,
mingo@elte.hu
Subject: [tip:core/memblock] x86-64: Only set max_pfn_mapped to 512 MiB if we enter via head_64.S
Date: Thu, 14 Oct 2010 07:42:14 GMT [thread overview]
Message-ID: <tip-67e87f0a1c5cbc750f81ebf6a128e8ff6f4376cc@git.kernel.org> (raw)
In-Reply-To: <4CB6AB24.9020504@kernel.org>
Commit-ID: 67e87f0a1c5cbc750f81ebf6a128e8ff6f4376cc
Gitweb: http://git.kernel.org/tip/67e87f0a1c5cbc750f81ebf6a128e8ff6f4376cc
Author: Jeremy Fitzhardinge <jeremy@goop.org>
AuthorDate: Wed, 13 Oct 2010 16:34:15 -0700
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 14 Oct 2010 09:06:49 +0200
x86-64: Only set max_pfn_mapped to 512 MiB if we enter via head_64.S
head_64.S maps up to 512 MiB, but that is not necessarity true for
other entry paths, such as Xen.
Thus, co-locate the setting of max_pfn_mapped with the code to
actually set up the page tables in head_64.S. The 32-bit code is
already so co-located. (The Xen code already sets max_pfn_mapped
correctly for its own use case.)
-v2:
Yinghai fixed the following bug in this patch:
|
| max_pfn_mapped is in .bss section, so we need to set that
| after bss get cleared. Without that we crash on bootup.
|
| That is safe because Xen does not call x86_64_start_kernel().
|
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Fixed-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
LKML-Reference: <4CB6AB24.9020504@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/head64.c | 2 ++
arch/x86/kernel/setup.c | 1 -
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 97adf98..2d2673c 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -80,6 +80,8 @@ void __init x86_64_start_kernel(char * real_mode_data)
/* Cleanup the over mapped high alias */
cleanup_highmap();
+ max_pfn_mapped = KERNEL_IMAGE_SIZE >> PAGE_SHIFT;
+
for (i = 0; i < NUM_EXCEPTION_VECTORS; i++) {
#ifdef CONFIG_EARLY_PRINTK
set_intr_gate(i, &early_idt_handlers[i]);
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index b11a238..c3cebfe 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -932,7 +932,6 @@ void __init setup_arch(char **cmdline_p)
max_low_pfn = max_pfn;
high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1;
- max_pfn_mapped = KERNEL_IMAGE_SIZE >> PAGE_SHIFT;
#endif
/*
prev parent reply other threads:[~2010-10-14 7:42 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-04 21:57 [PATCH 0/4] memblock related fixes for -tip Yinghai Lu
2010-10-06 22:52 ` Jeremy Fitzhardinge
2010-10-06 22:57 ` Yinghai Lu
2010-10-06 22:59 ` H. Peter Anvin
2010-10-07 18:31 ` Jeremy Fitzhardinge
2010-11-03 5:05 ` Debug patches for memblock Yinghai Lu
2010-11-03 5:13 ` Jeremy Fitzhardinge
2010-10-12 0:01 ` [tip:core/memblock] memblock: Allow memblock_init to be called early tip-bot for Jeremy Fitzhardinge
2010-10-12 18:41 ` [PATCH 0/4] memblock related fixes for -tip Jeremy Fitzhardinge
2010-10-12 18:45 ` Yinghai Lu
2010-10-12 21:12 ` Yinghai Lu
2010-10-12 21:42 ` Jeremy Fitzhardinge
2010-10-12 21:50 ` H. Peter Anvin
2010-10-12 22:02 ` Yinghai Lu
2010-10-12 21:42 ` H. Peter Anvin
2010-10-12 22:01 ` Yinghai Lu
2010-10-12 22:10 ` H. Peter Anvin
2010-10-12 23:37 ` Jeremy Fitzhardinge
2010-10-13 5:40 ` Yinghai Lu
2010-10-13 16:31 ` Jeremy Fitzhardinge
2010-10-13 18:12 ` Yinghai Lu
2010-10-13 18:20 ` H. Peter Anvin
2010-10-13 20:03 ` Jeremy Fitzhardinge
2010-10-13 21:03 ` H. Peter Anvin
2010-10-13 23:02 ` Jeremy Fitzhardinge
2010-10-13 23:07 ` H. Peter Anvin
2010-10-14 0:31 ` [tip:core/memblock] xen: Cope with unmapped pages when initializing kernel pagetable tip-bot for Jeremy Fitzhardinge
2010-10-13 22:06 ` [PATCH 0/4] memblock related fixes for -tip Yinghai Lu
2010-10-13 23:07 ` Jeremy Fitzhardinge
2010-10-13 23:14 ` Jeremy Fitzhardinge
2010-10-13 23:18 ` H. Peter Anvin
2010-10-13 23:34 ` Jeremy Fitzhardinge
2010-10-14 0:08 ` Yinghai
2010-10-14 0:24 ` Jeremy Fitzhardinge
2010-10-14 0:27 ` H. Peter Anvin
2010-10-14 0:31 ` [tip:core/memblock] x86-64: Only set max_pfn_mapped to 512 MiB if we enter via head_64.S tip-bot for Jeremy Fitzhardinge
2010-10-14 5:57 ` Ingo Molnar
2010-10-14 5:59 ` Ingo Molnar
2010-10-14 6:06 ` Ingo Molnar
2010-10-14 6:07 ` Yinghai Lu
2010-10-14 6:37 ` Ingo Molnar
2010-10-14 7:03 ` Yinghai Lu
2010-10-14 7:42 ` tip-bot for Jeremy Fitzhardinge [this message]
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=tip-67e87f0a1c5cbc750f81ebf6a128e8ff6f4376cc@git.kernel.org \
--to=jeremy@goop.org \
--cc=hpa@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jeremy.fitzhardinge@citrix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--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