All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Huang Ying <ying.huang@intel.com>
Cc: Brian Maly <bmaly@redhat.com>, Ingo Molnar <mingo@elte.hu>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Fix e820 end address with EFI
Date: Mon, 02 Mar 2009 21:51:41 -0800	[thread overview]
Message-ID: <49ACC56D.8050304@kernel.org> (raw)
In-Reply-To: <1236058858.6204.273.camel@yhuang-dev.sh.intel.com>

Huang Ying wrote:
> On Tue, 2009-03-03 at 13:37 +0800, Yinghai Lu wrote:
> [...]
>>> The dmesg with ignore_loglevel in kernel parameters is attached with the
>>> mail.
>>>
>>> init_memory_mapping: 0000000000000000-000000003f700000
>>>  0000000000 - 003f600000 page 2M
>>>  003f600000 - 003f700000 page 4k
>>> kernel direct mapping tables up to 3f700000 @ 8000-b000
>>> last_map_addr: 3f700000 end: 3f700000
>>>
>>> init_memory_mapping: 00000000fffb0000-00000000fffba000
>>>  00fffb0000 - 0100000000 page 4k
>>> last_map_addr: 100000000 end: fffba000
>> that is funny, the range calculating has some problem...when the range size < 2M...
> 
> Yes. Can you fix that? If you have no time, I can do that.
> 

please try

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index c9d4466..25a7be8 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -748,6 +748,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;

  reply	other threads:[~2009-03-03  5:52 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 [this message]
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                                                   ` [tip:x86/urgent] x86: fix init_memory_mapping() to handle small ranges Yinghai Lu
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=49ACC56D.8050304@kernel.org \
    --to=yinghai@kernel.org \
    --cc=bmaly@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.