mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Muchun Song <smuchun@gmail.com>
Cc: will.deacon@arm.com, akpm@linux-foundation.org,
	rppt@linux.vnet.ibm.com, ard.biesheuvel@linaro.org,
	f.fainelli@gmail.com, logang@deltatee.com, robin.murphy@arm.com,
	ghackmann@android.com, hannes@cmpxchg.org, stefan@agner.ch,
	david@redhat.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: mm: fix max_mapnr is assigned the wrong value
Date: Mon, 1 Apr 2019 11:44:32 +0100	[thread overview]
Message-ID: <20190401104432.GB14874@arrakis.emea.arm.com> (raw)
In-Reply-To: <20190330131346.40289-1-smuchun@gmail.com>

On Sat, Mar 30, 2019 at 09:13:46PM +0800, Muchun Song wrote:
> When we not use flat memory, the mem_map will be NULL and
> pfn_to_page(max_pfn) is a pointer which is located in kernel space. So
> max_mapnr is assigned a very large number(e.g., 0xffffxxxx_xxxxxxxx) - fix
> it.
> 
> Signed-off-by: Muchun Song <smuchun@gmail.com>
> ---
>  arch/arm64/mm/init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index bc02818fa48b..e86c21a44c88 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -535,7 +535,7 @@ void __init mem_init(void)
>  	else
>  		swiotlb_force = SWIOTLB_NO_FORCE;
>  
> -	set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
> +	set_max_mapnr(max_pfn - PHYS_PFN_OFFSET);
>  
>  #ifndef CONFIG_SPARSEMEM_VMEMMAP
>  	free_unused_memmap();

The patch looks fine but did you actually hit any problem? max_mapnr
seems to only be used in the generic pfn_valid() which we do not use on
arm64 (just wondering if it needs a cc stable; it doesn't look like as
it's not a regression).

-- 
Catalin

  reply	other threads:[~2019-04-01 10:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-30 13:13 Muchun Song
2019-04-01 10:44 ` Catalin Marinas [this message]
2019-04-01 14:21   ` Muchun Song
2019-04-01 14:32     ` Catalin Marinas

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=20190401104432.GB14874@arrakis.emea.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=david@redhat.com \
    --cc=f.fainelli@gmail.com \
    --cc=ghackmann@android.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=logang@deltatee.com \
    --cc=robin.murphy@arm.com \
    --cc=rppt@linux.vnet.ibm.com \
    --cc=smuchun@gmail.com \
    --cc=stefan@agner.ch \
    --cc=will.deacon@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®