lkml.org 
[lkml]   [2009]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] Fix e820 end address with EFI
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;

\
 
 \ /
  Last update: 2009-03-03 06:55    [from the cache]
©2003-2011 Jasper Spaans