From: Borislav Petkov <bp@alien8.de>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/mm: trivial code cleanup for memory_map_top_doown()
Date: Mon, 13 Mar 2017 19:50:21 +0100 [thread overview]
Message-ID: <20170313185021.oxl3ybuiiuqnyg5e@pd.tnic> (raw)
In-Reply-To: <20170217143033.95412-1-richard.weiyang@gmail.com>
On Fri, Feb 17, 2017 at 10:30:33PM +0800, Wei Yang wrote:
> In case (last_start <= step_size), start is for sure to be 0. So, it is
Well, lemme see:
[ 0.000000] memory_map_top_down: entry, [0x100000:0x7ffdf000)
[ 0.000000] memory_map_top_down: addr: 0x7fc00000, real_end: 0x7fe00000
[ 0.000000] memory_map_top_down: last_start: 0x40000000 <= step_size: 0x2000000000, start: 0x40000000
^^^^^^^^^^
It doesn't look like 0 to me.
---
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 2193799ca800..d3b02a416df3 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -506,10 +506,14 @@ static void __init memory_map_top_down(unsigned long map_start,
unsigned long addr;
unsigned long mapped_ram_size = 0;
+ pr_info("%s: entry, [0x%lx:0x%lx)\n", __func__, map_start, map_end);
+
/* xen has big range in reserved near end of ram, skip it at first.*/
addr = memblock_find_in_range(map_start, map_end, PMD_SIZE, PMD_SIZE);
real_end = addr + PMD_SIZE;
+ pr_info("%s: addr: 0x%lx, real_end: 0x%lx\n", __func__, addr, real_end);
+
/* step_size need to be small so pgt_buf from BRK could cover it */
step_size = PMD_SIZE;
max_pfn_mapped = 0; /* will get exact value next */
@@ -527,8 +531,13 @@ static void __init memory_map_top_down(unsigned long map_start,
start = round_down(last_start - 1, step_size);
if (start < map_start)
start = map_start;
- } else
+ } else {
+ pr_info("%s: last_start: 0x%lx <= step_size: 0x%lx, start: 0x%lx\n",
+ __func__, last_start, step_size, start);
+
start = map_start;
+ }
+
mapped_ram_size += init_range_memory_mapping(start,
last_start);
last_start = start;
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
next prev parent reply other threads:[~2017-03-13 18:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-17 14:30 [PATCH] x86/mm: trivial code cleanup for memory_map_top_doown() Wei Yang
2017-03-13 18:50 ` Borislav Petkov [this message]
2017-03-14 3:56 ` Wei Yang
2017-03-20 2:26 ` Wei Yang
2017-05-02 13:26 ` Wei Yang
2017-08-03 7:12 ` Wei Yang
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=20170313185021.oxl3ybuiiuqnyg5e@pd.tnic \
--to=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=richard.weiyang@gmail.com \
--cc=tglx@linutronix.de \
--cc=x86@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;
as well as URLs for NNTP newsgroup(s).