[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3b6ff3a9-6b88-4a28-a0fd-31f31ae3e84b@csgroup.eu>
Date: Thu, 26 Jun 2025 12:52:37 +0200
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Sabyrzhan Tasbolatov <snovitoll@...il.com>, ryabinin.a.a@...il.com,
glider@...gle.com, andreyknvl@...il.com, dvyukov@...gle.com,
vincenzo.frascino@....com, catalin.marinas@....com, will@...nel.org,
chenhuacai@...nel.org, kernel@...0n.name, maddy@...ux.ibm.com,
mpe@...erman.id.au, npiggin@...il.com, hca@...ux.ibm.com, gor@...ux.ibm.com,
agordeev@...ux.ibm.com, borntraeger@...ux.ibm.com, svens@...ux.ibm.com,
richard@....at, anton.ivanov@...bridgegreys.com, johannes@...solutions.net,
dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, x86@...nel.org,
hpa@...or.com, chris@...kel.net, jcmvbkbc@...il.com,
akpm@...ux-foundation.org
Cc: guoweikang.kernel@...il.com, geert@...ux-m68k.org, rppt@...nel.org,
tiwei.btw@...group.com, richard.weiyang@...il.com, benjamin.berg@...el.com,
kevin.brodsky@....com, kasan-dev@...glegroups.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
loongarch@...ts.linux.dev, linuxppc-dev@...ts.ozlabs.org,
linux-s390@...r.kernel.org, linux-um@...ts.infradead.org, linux-mm@...ck.org
Subject: Re: [PATCH 9/9] kasan/powerpc: call kasan_init_generic in kasan_init
Le 25/06/2025 à 11:52, Sabyrzhan Tasbolatov a écrit :
> Call kasan_init_generic() which enables the static flag
> to mark generic KASAN initialized, otherwise it's an inline stub.
> Also prints the banner from the single place.
>
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218315
> Fixes: 55d77bae7342 ("kasan: fix Oops due to missing calls to kasan_arch_is_ready()")
> Signed-off-by: Sabyrzhan Tasbolatov <snovitoll@...il.com>
> ---
> arch/powerpc/include/asm/kasan.h | 14 --------------
> arch/powerpc/mm/kasan/init_book3s_64.c | 6 +-----
> 2 files changed, 1 insertion(+), 19 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/kasan.h b/arch/powerpc/include/asm/kasan.h
> index b5bbb94c51f..23a06fbec72 100644
> --- a/arch/powerpc/include/asm/kasan.h
> +++ b/arch/powerpc/include/asm/kasan.h
> @@ -52,20 +52,6 @@
>
> #endif
>
> -#ifdef CONFIG_KASAN
The above #ifdef must remain, at the moment I get:
CC arch/powerpc/kernel/asm-offsets.s
In file included from ./arch/powerpc/include/asm/nohash/32/pgtable.h:65,
from ./arch/powerpc/include/asm/nohash/pgtable.h:13,
from ./arch/powerpc/include/asm/pgtable.h:20,
from ./include/linux/pgtable.h:6,
from ./arch/powerpc/include/asm/kup.h:43,
from ./arch/powerpc/include/asm/uaccess.h:8,
from ./include/linux/uaccess.h:12,
from ./include/linux/sched/task.h:13,
from ./include/linux/sched/signal.h:9,
from ./include/linux/rcuwait.h:6,
from ./include/linux/percpu-rwsem.h:7,
from ./include/linux/fs.h:34,
from ./include/linux/compat.h:17,
from arch/powerpc/kernel/asm-offsets.c:12:
./arch/powerpc/include/asm/kasan.h:70:2: error: #endif without #if
#endif
^~~~~
In file included from ./include/linux/kasan.h:21,
from ./include/linux/slab.h:260,
from ./include/linux/fs.h:46,
from ./include/linux/compat.h:17,
from arch/powerpc/kernel/asm-offsets.c:12:
./arch/powerpc/include/asm/kasan.h:70:2: error: #endif without #if
#endif
^~~~~
make[2]: *** [scripts/Makefile.build:182:
arch/powerpc/kernel/asm-offsets.s] Error 1
> -#ifdef CONFIG_PPC_BOOK3S_64
> -DECLARE_STATIC_KEY_FALSE(powerpc_kasan_enabled_key);
> -
> -static __always_inline bool kasan_arch_is_ready(void)
> -{
> - if (static_branch_likely(&powerpc_kasan_enabled_key))
> - return true;
> - return false;
> -}
> -
> -#define kasan_arch_is_ready kasan_arch_is_ready
> -#endif
> -
> void kasan_early_init(void);
> void kasan_mmu_init(void);
> void kasan_init(void);
> diff --git a/arch/powerpc/mm/kasan/init_book3s_64.c b/arch/powerpc/mm/kasan/init_book3s_64.c
> index 7d959544c07..dcafa641804 100644
> --- a/arch/powerpc/mm/kasan/init_book3s_64.c
> +++ b/arch/powerpc/mm/kasan/init_book3s_64.c
> @@ -19,8 +19,6 @@
> #include <linux/memblock.h>
> #include <asm/pgalloc.h>
>
> -DEFINE_STATIC_KEY_FALSE(powerpc_kasan_enabled_key);
> -
> static void __init kasan_init_phys_region(void *start, void *end)
> {
> unsigned long k_start, k_end, k_cur;
> @@ -92,11 +90,9 @@ void __init kasan_init(void)
> */
> memset(kasan_early_shadow_page, 0, PAGE_SIZE);
>
> - static_branch_inc(&powerpc_kasan_enabled_key);
> -
> /* Enable error messages */
> init_task.kasan_depth = 0;
> - pr_info("KASAN init done\n");
> + kasan_init_generic();
> }
>
> void __init kasan_early_init(void) { }
Powered by blists - more mailing lists