lkml.org 
[lkml]   [2022]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] riscv: Allow to downgrade paging mode from the command line
Date
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

\
 
 \ /
  Last update: 2022-12-14 16:39    [W:0.084 / U:3.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site