Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752537AbdCTC0Z (ORCPT ); Sun, 19 Mar 2017 22:26:25 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34506 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752051AbdCTC0Y (ORCPT ); Sun, 19 Mar 2017 22:26:24 -0400 Date: Mon, 20 Mar 2017 10:26:19 +0800 From: Wei Yang To: Wei Yang Cc: Borislav Petkov , 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() Message-ID: <20170320022619.GA29907@WeideMacBook-Pro.local> Reply-To: Wei Yang References: <20170217143033.95412-1-richard.weiyang@gmail.com> <20170313185021.oxl3ybuiiuqnyg5e@pd.tnic> <20170314035639.GA30208@WeideMacBook-Pro.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline In-Reply-To: <20170314035639.GA30208@WeideMacBook-Pro.local> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2729 Lines: 88 --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, Borislav Do you still have some concern on this change? On Tue, Mar 14, 2017 at 11:56:39AM +0800, Wei Yang wrote: >On Mon, Mar 13, 2017 at 07:50:21PM +0100, Borislav Petkov wrote: >>On Fri, Feb 17, 2017 at 10:30:33PM +0800, Wei Yang wrote: >>> In case (last_start <=3D step_size), start is for sure to be 0. So, it = is >> > >Hmm, I may write it more specific: > >"start" is for sure to be set to 0 with round_down(last_start - 1, step_si= ze). > >>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 <=3D 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 >>@@ -527,8 +531,13 @@ static void __init memory_map_top_down(unsigned long= map_start, >> start =3D round_down(last_start - 1, step_size); >> if (start < map_start) >> start =3D map_start; >>- } else >>+ } else { >>+ pr_info("%s: last_start: 0x%lx <=3D step_size: 0x%lx, start: 0x%lx\n", >>+ __func__, last_start, step_size, start); >>+ > >If you change this log with the following > > pr_err("%s: last_start: 0x%lx <=3D step_size: 0x%lx, start: 0x%lx\n", > __func__, last_start, step_size, > round_down(last_start - 1, step_size)); > >You could see after calculation, start is 0 when (last_start <=3D step_siz= e). > >--=20 >Wei Yang >Help you, Help me --=20 Wei Yang Help you, Help me --Kj7319i9nmIyA2yE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYzz3LAAoJEKcLNpZP5cTdkfMP/0l+dKX30XgTKMMFTyoc8GxY 0v1PBTV11BMP/AWyr9Iyb/CKvj4iN2DdtAZqzuHNKv3wcBzaneSM/6IBGWuH8eFZ tX3vPAFCYZUSc2B0S6f9WRVRIVmga9FFHLMzWoVx8jTfogFZ5p2JBGsuoTU62Ve0 cfh19v2ruBtT02N0IdpwrZ6ey7VmLT5hK6Hq6sCdoav238Rhf6LiMkQ9j3G0KiNH QgXhJtXCiv7XLz9iov0C8tA9TtKgUL/vngnny76i5SeqeH4cLNhvBP08xBn8Ijzn FfV0Q+Yo5toBEaZstCNJS9b103mX5nHxE/oGqMkH5MuRq6Ocb3Vu+fXkN5BMqd3O d1P3oBH6VVk22zcOLB7c648k5nFPoW7KgkfKVqc/IEmbnKNEcOjh2e1p2FOhhqQi YcdJlguQeH1MD/tqFjpWNubMDaz91L/Sk5fMwV+6WDsGj2Qnv5fRlPvKBwgg+9WA 0wATsZ5U2aNpNFv9PTDcPjQ5Pf8QX5BOX7U1Wu96w9MRcA5NAUFc/yjIOk5W3oA1 xNM3cbJCpiCXmZ3/NZyHJ0IpOSHKlIqKsn+XRJZxg57xb4SpaaYhCk+6WqLF7Oxg pt7u7qgaqrxn3GK382xFgXHupmkSsh66BGloNcCCR/NA+n+RQHqOAiVtM8cALWD6 JaRmyfHa62HCghUKVjke =9HZ3 -----END PGP SIGNATURE----- --Kj7319i9nmIyA2yE--