From: Yinghai Lu <yinghai@kernel.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, ying.huang@intel.com,
hpa@zytor.com, mingo@redhat.com, yinghai@kernel.org,
bmaly@redhat.com, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:x86/urgent] x86: fix init_memory_mapping() to handle small ranges
Date: Tue, 3 Mar 2009 07:51:41 GMT [thread overview]
Message-ID: <tip-0fc59d3a01820765e5f3a723733728758b0cf577@git.kernel.org> (raw)
In-Reply-To: <49ACDDED.1060508@kernel.org>
Commit-ID: 0fc59d3a01820765e5f3a723733728758b0cf577
Gitweb: http://git.kernel.org/tip/0fc59d3a01820765e5f3a723733728758b0cf577
Author: "Yinghai Lu" <yinghai@kernel.org>
AuthorDate: Mon, 2 Mar 2009 23:36:13 -0800
Commit: Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 3 Mar 2009 08:50:22 +0100
x86: fix init_memory_mapping() to handle small ranges
Impact: fix failed EFI bootup in certain circumstances
Ying Huang found init_memory_mapping() has problem with small ranges
less than 2M when he tried to direct map the EFI runtime code out of
max_low_pfn_mapped.
It turns out we never considered that case and didn't check the range...
Reported-by: Ying Huang <ying.huang@intel.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Brian Maly <bmaly@redhat.com>
LKML-Reference: <49ACDDED.1060508@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/mm/init_64.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index e6d36b4..b135225 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -714,6 +714,8 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
pos = start_pfn << PAGE_SHIFT;
end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT)
<< (PMD_SHIFT - PAGE_SHIFT);
+ if (end_pfn > (end >> PAGE_SHIFT))
+ end_pfn = end >> PAGE_SHIFT;
if (start_pfn < end_pfn) {
nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0);
pos = end_pfn << PAGE_SHIFT;
next prev parent reply other threads:[~2009-03-03 7:53 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-28 16:26 [PATCH] Fix e820 end address with EFI Brian Maly
2009-03-01 4:14 ` Yinghai Lu
2009-03-01 5:42 ` Yinghai Lu
2009-03-01 18:44 ` Brian Maly
2009-03-01 20:13 ` Brian Maly
2009-03-01 20:16 ` Yinghai Lu
2009-03-02 1:07 ` Huang Ying
2009-03-02 1:41 ` Brian Maly
2009-03-02 1:45 ` Brian Maly
[not found] ` <49AB38E7.60305@redhat.com>
2009-03-02 2:13 ` Huang Ying
2009-03-02 2:16 ` Yinghai Lu
2009-03-02 2:25 ` Huang Ying
2009-03-02 2:32 ` Yinghai Lu
2009-03-02 2:37 ` Huang Ying
2009-03-02 2:51 ` Yinghai Lu
2009-03-02 7:45 ` Huang Ying
2009-03-02 21:38 ` Yinghai Lu
2009-03-03 1:07 ` Huang Ying
2009-03-03 1:28 ` Yinghai Lu
2009-03-03 2:22 ` Huang Ying
2009-03-03 2:53 ` Yinghai Lu
2009-03-03 3:06 ` Huang Ying
2009-03-03 3:57 ` Yinghai Lu
2009-03-03 5:32 ` Huang Ying
2009-03-03 5:37 ` Yinghai Lu
2009-03-03 5:40 ` Huang Ying
2009-03-03 5:51 ` Yinghai Lu
2009-03-03 6:37 ` Huang Ying
2009-03-03 7:36 ` [PATCH] x86: make init_memory_mapping could handle small range Yinghai Lu
2009-03-03 7:51 ` Yinghai Lu [this message]
2009-03-02 2:57 ` [PATCH] Fix e820 end address with EFI Brian Maly
2009-03-02 3:06 ` Huang Ying
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-0fc59d3a01820765e5f3a723733728758b0cf577@git.kernel.org \
--to=yinghai@kernel.org \
--cc=bmaly@redhat.com \
--cc=hpa@zytor.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=ying.huang@intel.com \
/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
Powered by JetHome