From: "Björn Töpel" <bjorn@kernel.org>
To: Alexandre Ghiti <alexghiti@rivosinc.com>,
Jonathan Corbet <corbet@lwn.net>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org
Cc: Alexandre Ghiti <alexghiti@rivosinc.com>
Subject: Re: [PATCH] riscv: Allow to downgrade paging mode from the command line
Date: Wed, 14 Dec 2022 16:38:57 +0100 [thread overview]
Message-ID: <87cz8m3sha.fsf@all.your.base.are.belong.to.us> (raw)
In-Reply-To: <20221214143311.960266-1-alexghiti@rivosinc.com>
Alexandre Ghiti <alexghiti@rivosinc.com> writes:
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index b56a0a75533f..8140fefe0e57 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -752,12 +752,35 @@ static void __init disable_pgtable_l4(void)
> * then read SATP to see if the configuration was taken into account
> * meaning sv48 is supported.
> */
> -static __init void set_satp_mode(void)
> +static __init void set_satp_mode(uintptr_t dtb_pa)
> {
> u64 identity_satp, hw_satp;
> uintptr_t set_satp_mode_pmd = ((unsigned long)set_satp_mode) & PMD_MASK;
> bool check_l4 = false;
>
> +#ifndef CONFIG_KASAN
> + /*
> + * The below fdt functions are kasan instrumented, since at this point
> + * there is no mapping for the kasan shadow memory, this can't be used
> + * when kasan is enabled.
> + */
> + int chosen_node;
> +
> + chosen_node = fdt_path_offset((void *)dtb_pa, "/chosen");
> + if (chosen_node >= 0) {
> + const char *cmdline = fdt_getprop((void *)dtb_pa, chosen_node,
> + "bootargs", NULL);
The command line handling needs to honor CONFIG_CMDLINE_FORCE and
CONFIG_CMDLINE_EXTEND (which makes it possible to use no{4,5}lvl *and*
KASAN ;-)).
Björn
next prev parent reply other threads:[~2022-12-14 15:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-14 14:33 Alexandre Ghiti
2022-12-14 15:38 ` Björn Töpel [this message]
2022-12-14 16:38 ` Alexandre Ghiti
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=87cz8m3sha.fsf@all.your.base.are.belong.to.us \
--to=bjorn@kernel.org \
--cc=alexghiti@rivosinc.com \
--cc=aou@eecs.berkeley.edu \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@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
all inboxes | Powered by JetHome®