From: tip-bot for Yinghai Lu <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
yinghai@kernel.org, tglx@linutronix.de, rydberg@euromail.se
Subject: [tip:x86/urgent] x86, mm: Make sure to find a 2M free block for the first mapped area
Date: Wed, 6 Mar 2013 20:28:07 -0800 [thread overview]
Message-ID: <tip-98e7a989979b185f49e86ddaed2ad6890299d9f0@git.kernel.org> (raw)
In-Reply-To: <CAE9FiQX4nQ7_1kg5RL_vh56rmcSHXUi1ExrZX7CwED4NGMnHfg@mail.gmail.com>
Commit-ID: 98e7a989979b185f49e86ddaed2ad6890299d9f0
Gitweb: http://git.kernel.org/tip/98e7a989979b185f49e86ddaed2ad6890299d9f0
Author: Yinghai Lu <yinghai@kernel.org>
AuthorDate: Wed, 6 Mar 2013 20:18:21 -0800
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Wed, 6 Mar 2013 20:18:32 -0800
x86, mm: Make sure to find a 2M free block for the first mapped area
Henrik reported that his MacAir 3.1 would not boot with
| commit 8d57470d8f859635deffe3919d7d4867b488b85a
| Date: Fri Nov 16 19:38:58 2012 -0800
|
| x86, mm: setup page table in top-down
It turns out that we do not calculate the real_end properly:
We try to get 2M size with 4K alignment, and later will round down
to 2M, so we will get less then 2M for first mapping, in extreme
case could be only 4K only. In Henrik's system it has (1M-32K) as
last usable rage is [mem 0x7f9db000-0x7fef8fff].
The problem is exposed when EFI booting have several holes and it
will force mapping to use PTE instead as we only map usable areas.
To fix it, just make it be 2M aligned, so we can be guaranteed to be
able to use large pages to map it.
Reported-by: Henrik Rydberg <rydberg@euromail.se>
Bisected-by: Henrik Rydberg <rydberg@euromail.se>
Tested-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/CAE9FiQX4nQ7_1kg5RL_vh56rmcSHXUi1ExrZX7CwED4NGMnHfg@mail.gmail.com
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
arch/x86/mm/init.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 4903a03..59b7fc4 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -410,9 +410,8 @@ void __init init_mem_mapping(void)
/* the ISA range is always mapped regardless of memory holes */
init_memory_mapping(0, ISA_END_ADDRESS);
- /* xen has big range in reserved near end of ram, skip it at first */
- addr = memblock_find_in_range(ISA_END_ADDRESS, end, PMD_SIZE,
- PAGE_SIZE);
+ /* xen has big range in reserved near end of ram, skip it at first.*/
+ addr = memblock_find_in_range(ISA_END_ADDRESS, end, PMD_SIZE, PMD_SIZE);
real_end = addr + PMD_SIZE;
/* step_size need to be small so pgt_buf from BRK could cover it */
next prev parent reply other threads:[~2013-03-07 4:29 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-04 0:28 Linux 3.9-rc1 Linus Torvalds
2013-03-04 1:17 ` Jiri Kosina
2013-03-04 1:42 ` Linus Torvalds
2013-03-04 2:32 ` Randy Dunlap
2013-03-04 2:55 ` Linus Torvalds
2013-03-04 3:39 ` Linus Torvalds
2013-03-04 4:22 ` linux-next stats (Was: Linux 3.9-rc1) Stephen Rothwell
2013-03-04 5:02 ` Stephen Rothwell
2013-03-04 9:54 ` Regression from 3.8.0 - USB mouse (was: " Harald Arnesen
2013-03-06 8:06 ` Linux 3.9-rc1 Henrik Rydberg
2013-03-06 9:17 ` H. Peter Anvin
2013-03-06 10:07 ` Henrik Rydberg
2013-03-06 17:51 ` Yinghai Lu
2013-03-06 19:36 ` Henrik Rydberg
2013-03-06 19:34 ` H. Peter Anvin
2013-03-06 19:54 ` Henrik Rydberg
2013-03-06 20:00 ` Yinghai Lu
2013-03-06 20:45 ` Henrik Rydberg
2013-03-06 20:58 ` H. Peter Anvin
2013-03-06 21:33 ` Yinghai Lu
2013-03-06 21:49 ` H. Peter Anvin
2013-03-06 22:04 ` Henrik Rydberg
2013-03-06 22:27 ` H. Peter Anvin
2013-03-06 22:44 ` Yinghai Lu
2013-03-06 22:48 ` H. Peter Anvin
2013-03-06 22:54 ` Yinghai Lu
2013-03-07 4:28 ` tip-bot for Yinghai Lu [this message]
2013-03-06 22:14 ` Yinghai Lu
2013-03-06 22:19 ` Yinghai Lu
2013-03-06 22:28 ` H. Peter Anvin
2013-03-06 22:46 ` Yinghai Lu
2013-03-06 22:47 ` H. Peter Anvin
2013-03-06 16:08 ` Linus Torvalds
2013-03-06 16:57 ` H. Peter Anvin
2013-03-06 21:07 ` Henrik Rydberg
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-98e7a989979b185f49e86ddaed2ad6890299d9f0@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rydberg@euromail.se \
--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
Powered by JetHome