From: Baoquan He <bhe@redhat.com>
To: linux-mm@kvack.org
Cc: snovitoll@gmail.com, ryabinin.a.a@gmail.com,
christophe.leroy@csgroup.eu, hca@linux.ibm.com,
andreyknvl@gmail.com, akpm@linux-foundation.org,
chenhuacai@loongson.cn, davidgow@google.com, glider@google.com,
dvyukov@google.com, alexghiti@rivosinc.com,
kasan-dev@googlegroups.com, loongarch@lists.linux.dev,
linuxppc-dev@lists.ozlabs.org, linux-um@lists.infradead.org,
linux-kernel@vger.kernel.org, agordeev@linux.ibm.com,
Baoquan He <bhe@redhat.com>
Subject: [PATCH 2/4] arch/powerpc: remove kasan_arch_is_ready()
Date: Tue, 12 Aug 2025 21:09:31 +0800 [thread overview]
Message-ID: <20250812130933.71593-3-bhe@redhat.com> (raw)
In-Reply-To: <20250812130933.71593-1-bhe@redhat.com>
From: Sabyrzhan Tasbolatov <snovitoll@gmail.com>
With the help of static key kasan_flag_enabled, kasan_arch_is_ready()
is not needed any more. So reomve the unneeded kasan_arch_is_ready() and
the relevant codes.
Signed-off-by: Sabyrzhan Tasbolatov <snovitoll@gmail.com>
Signed-off-by: Baoquan He <bhe@redhat.com>
---
arch/powerpc/include/asm/kasan.h | 13 -------------
arch/powerpc/mm/kasan/init_book3s_64.c | 4 ----
2 files changed, 17 deletions(-)
diff --git a/arch/powerpc/include/asm/kasan.h b/arch/powerpc/include/asm/kasan.h
index b5bbb94c51f6..73466d3ff302 100644
--- a/arch/powerpc/include/asm/kasan.h
+++ b/arch/powerpc/include/asm/kasan.h
@@ -53,19 +53,6 @@
#endif
#ifdef CONFIG_KASAN
-#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 9c5cf2354c8b..c1b78a9cd0a9 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;
@@ -95,8 +93,6 @@ void __init kasan_init(void)
*/
memset(kasan_early_shadow_page, 0, PAGE_SIZE);
- static_branch_inc(&powerpc_kasan_enabled_key);
-
/* KASAN is now initialized, enable it. */
static_branch_enable(&kasan_flag_enabled);
--
2.41.0
next prev parent reply other threads:[~2025-08-12 13:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-12 13:09 [PATCH 0/4] mm/kasan: " Baoquan He
2025-08-12 13:09 ` [PATCH 1/4] arch/loongarch: " Baoquan He
2025-08-12 13:09 ` Baoquan He [this message]
2025-08-12 13:09 ` [PATCH 3/4] arch/um: " Baoquan He
2025-08-12 13:09 ` [PATCH 4/4] mm/kasan: " Baoquan He
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=20250812130933.71593-3-bhe@redhat.com \
--to=bhe@redhat.com \
--cc=agordeev@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=alexghiti@rivosinc.com \
--cc=andreyknvl@gmail.com \
--cc=chenhuacai@loongson.cn \
--cc=christophe.leroy@csgroup.eu \
--cc=davidgow@google.com \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=hca@linux.ibm.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-um@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=loongarch@lists.linux.dev \
--cc=ryabinin.a.a@gmail.com \
--cc=snovitoll@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