public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor.dooley@microchip.com>
To: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Song Shuai <suagrfillet@gmail.com>,
	<linux-riscv@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] riscv: Start of DRAM should at least be aligned on PMD size for the direct mapping
Date: Tue, 4 Jul 2023 13:26:12 +0100	[thread overview]
Message-ID: <20230704-emblem-rubble-e4a3a87cb98e@wendy> (raw)
In-Reply-To: <20230704121837.248976-1-alexghiti@rivosinc.com>


[-- Attachment #1.1: Type: text/plain, Size: 1404 bytes --]

Hey Alex,

On Tue, Jul 04, 2023 at 02:18:37PM +0200, Alexandre Ghiti wrote:
> So that we do not end up mapping the whole linear mapping using 4K
> pages, which is slow at boot time, and also very likely at runtime.
> 
> So make sure we align the start of DRAM on a PMD boundary.
> 
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>

Obviously correct me if I am wrong here, but was this not reported by
Song Shuai as a regression?
Accordingly, should this not have Reported-by, Closes/Link & Fixes tags?

Cheers,
Conor.

> ---
>  arch/riscv/mm/init.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 4fa420faa780..4a43ec275c6d 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -214,8 +214,13 @@ static void __init setup_bootmem(void)
>  	memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start);
>  
>  	phys_ram_end = memblock_end_of_DRAM();
> +
> +	/*
> +	 * Make sure we align the start of the memory on a PMD boundary so that
> +	 * at worst, we map the linear mapping with PMD mappings.
> +	 */
>  	if (!IS_ENABLED(CONFIG_XIP_KERNEL))
> -		phys_ram_base = memblock_start_of_DRAM();
> +		phys_ram_base = memblock_start_of_DRAM() & PMD_MASK;
>  
>  	/*
>  	 * In 64-bit, any use of __va/__pa before this point is wrong as we
> -- 
> 2.39.2
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

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

  reply	other threads:[~2023-07-04 12:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-04 12:18 [PATCH] riscv: Start of DRAM should at least be aligned on PMD size for the direct mapping Alexandre Ghiti
2023-07-04 12:26 ` Conor Dooley [this message]
2023-07-04 13:16   ` Alexandre Ghiti
2023-07-05 10:19     ` Song Shuai
2023-07-06 17:05 ` Palmer Dabbelt
2023-07-11 10:51   ` Alexandre Ghiti
2023-08-03 14:45 ` Palmer Dabbelt
2023-08-03 15:10 ` patchwork-bot+linux-riscv

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=20230704-emblem-rubble-e4a3a87cb98e@wendy \
    --to=conor.dooley@microchip.com \
    --cc=alexghiti@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=suagrfillet@gmail.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