linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Palmer Dabbelt <palmer@dabbelt.com>
To: Atish Patra <Atish.Patra@wdc.com>
Cc: aou@eecs.berkeley.edu, vincent.chen@sifive.com,
	Anup Patel <Anup.Patel@wdc.com>,
	linux-kernel@vger.kernel.org, sudeep.holla@arm.com,
	Atish Patra <Atish.Patra@wdc.com>,
	zong.li@sifive.com, Paul Walmsley <paul.walmsley@sifive.com>,
	greentime.hu@sifive.com, linux-riscv@lists.infradead.org
Subject: Re: [PATCH 2/4] RISC-V: Set maximum number of mapped pages correctly
Date: Fri, 24 Jul 2020 22:12:39 -0700 (PDT)	[thread overview]
Message-ID: <mhng-89ff7200-0f8c-4d3e-af79-f8fa1a9231db@palmerdabbelt-glaptop1> (raw)
In-Reply-To: <20200715233009.27183-3-atish.patra@wdc.com>

On Wed, 15 Jul 2020 16:30:07 PDT (-0700), Atish Patra wrote:
> Currently, maximum number of mapper pages are set to the pfn calculated
> from the memblock size of the memblock containing kernel. This will work
> until that memblock spans the entire memory. However, it will be set to
> a wrong value if there are multiple memblocks defined in kernel
> (e.g. with efi runtime services).
>
> Set the the maximum value to the pfn calculated from dram size.
>
> Signed-off-by: Atish Patra <atish.patra@wdc.com>
> ---
>  arch/riscv/mm/init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index f4adb3684f3d..8d22973bde40 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -150,9 +150,9 @@ void __init setup_bootmem(void)
>  	/* Reserve from the start of the kernel to the end of the kernel */
>  	memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start);
>
> -	set_max_mapnr(PFN_DOWN(mem_size));
>  	max_pfn = PFN_DOWN(memblock_end_of_DRAM());
>  	max_low_pfn = max_pfn;
> +	set_max_mapnr(max_low_pfn);
>
>  #ifdef CONFIG_BLK_DEV_INITRD
>  	setup_initrd();

This one I'm putting on fixes, as there's nothing preventing us from having
multiple memory regions in a current boot and this seems very safe.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2020-07-25  5:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 23:30 [PATCH 0/4] Few mm & exception handling fixes Atish Patra
2020-07-15 23:30 ` [PATCH 1/4] RISC-V: Setup exception vector early Atish Patra
2020-07-25  5:12   ` Palmer Dabbelt
2020-07-25  5:26     ` Atish Patra
2020-07-15 23:30 ` [PATCH 2/4] RISC-V: Set maximum number of mapped pages correctly Atish Patra
2020-07-25  5:12   ` Palmer Dabbelt [this message]
2020-07-15 23:30 ` [PATCH 3/4] RISC-V: Do not rely on initrd_start/end computed during early dt parsing Atish Patra
2020-07-25  5:12   ` Palmer Dabbelt
2020-07-25  5:44     ` Atish Patra
2020-07-15 23:30 ` [PATCH 4/4] riscv: Parse all memory blocks to remove unusable memory Atish Patra
2020-07-25  5:12   ` Palmer Dabbelt

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=mhng-89ff7200-0f8c-4d3e-af79-f8fa1a9231db@palmerdabbelt-glaptop1 \
    --to=palmer@dabbelt.com \
    --cc=Anup.Patel@wdc.com \
    --cc=Atish.Patra@wdc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=greentime.hu@sifive.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=paul.walmsley@sifive.com \
    --cc=sudeep.holla@arm.com \
    --cc=vincent.chen@sifive.com \
    --cc=zong.li@sifive.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;
as well as URLs for NNTP newsgroup(s).