[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20c1e656-512e-4424-9d4e-176af18bb7d6@ghiti.fr>
Date: Tue, 5 Aug 2025 18:06:41 +0200
From: Alexandre Ghiti <alex@...ti.fr>
To: Sabyrzhan Tasbolatov <snovitoll@...il.com>, ryabinin.a.a@...il.com,
hca@...ux.ibm.com, christophe.leroy@...roup.eu, andreyknvl@...il.com,
agordeev@...ux.ibm.com, akpm@...ux-foundation.org, zhangqing@...ngson.cn,
chenhuacai@...ngson.cn, trishalfonso@...gle.com, davidgow@...gle.com
Cc: glider@...gle.com, dvyukov@...gle.com, kasan-dev@...glegroups.com,
linux-kernel@...r.kernel.org, loongarch@...ts.linux.dev,
linuxppc-dev@...ts.ozlabs.org, linux-riscv@...ts.infradead.org,
linux-s390@...r.kernel.org, linux-um@...ts.infradead.org, linux-mm@...ck.org
Subject: Re: [PATCH v4 9/9] kasan/riscv: call kasan_init_generic in kasan_init
Hi Sabyrzhan,
On 8/5/25 16:26, Sabyrzhan Tasbolatov wrote:
> Call kasan_init_generic() which handles Generic KASAN initialization
> and prints the banner. Since riscv doesn't select ARCH_DEFER_KASAN,
> kasan_enable() will be a no-op, and kasan_enabled() will return
> IS_ENABLED(CONFIG_KASAN) for optimal compile-time behavior.
>
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217049
> Signed-off-by: Sabyrzhan Tasbolatov <snovitoll@...il.com>
> ---
> arch/riscv/mm/kasan_init.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c
> index 41c635d6aca..ba2709b1eec 100644
> --- a/arch/riscv/mm/kasan_init.c
> +++ b/arch/riscv/mm/kasan_init.c
> @@ -530,6 +530,7 @@ void __init kasan_init(void)
>
> memset(kasan_early_shadow_page, KASAN_SHADOW_INIT, PAGE_SIZE);
> init_task.kasan_depth = 0;
> + kasan_init_generic();
This is right before actually setting the new mapping to the mmu (which
is done below by setting a register called SATP). It does not seem to be
a problem though, just wanted to let you know.
It boots fine with defconfig + kasan inline so:
Tested-by: Alexandre Ghiti <alexghiti@...osinc.com>
Thanks,
Alex
>
> csr_write(CSR_SATP, PFN_DOWN(__pa(swapper_pg_dir)) | satp_mode);
> local_flush_tlb_all();
Powered by blists - more mailing lists