From: Rohan McLure <rmclure@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org, linux-xtensa@linux.xtensa.org
Cc: chris@zankel.net, elver@google.com, npiggin@gmail.com,
jcmvbkbc@gmail.com, Rohan McLure <rmclure@linux.ibm.com>
Subject: [PATCH v4 2/7] xtensa: kcsan: Remove kcsan stubs for atomic builtins
Date: Wed, 8 Feb 2023 14:21:57 +1100 [thread overview]
Message-ID: <20230208032202.1357949-3-rmclure@linux.ibm.com> (raw)
In-Reply-To: <20230208032202.1357949-1-rmclure@linux.ibm.com>
A prior patch implemented stubs in place of the __atomic_* builtins in
generic code, as it is useful for other 32-bit architectures such as
32-bit powerpc.
Remove the kcsan-stubs.c translation unit and instead use
the generic implementation.
Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
---
V4: New patch
---
arch/xtensa/lib/Makefile | 1 -
arch/xtensa/lib/kcsan-stubs.c | 54 -----------------------------------
kernel/kcsan/Makefile | 5 +---
3 files changed, 1 insertion(+), 59 deletions(-)
delete mode 100644 arch/xtensa/lib/kcsan-stubs.c
diff --git a/arch/xtensa/lib/Makefile b/arch/xtensa/lib/Makefile
index 7ecef0519a27..d69356dc97df 100644
--- a/arch/xtensa/lib/Makefile
+++ b/arch/xtensa/lib/Makefile
@@ -8,5 +8,4 @@ lib-y += memcopy.o memset.o checksum.o \
divsi3.o udivsi3.o modsi3.o umodsi3.o mulsi3.o umulsidi3.o \
usercopy.o strncpy_user.o strnlen_user.o
lib-$(CONFIG_PCI) += pci-auto.o
-lib-$(CONFIG_KCSAN) += kcsan-stubs.o
KCSAN_SANITIZE_kcsan-stubs.o := n
diff --git a/arch/xtensa/lib/kcsan-stubs.c b/arch/xtensa/lib/kcsan-stubs.c
deleted file mode 100644
index 2b08faa62b86..000000000000
--- a/arch/xtensa/lib/kcsan-stubs.c
+++ /dev/null
@@ -1,54 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-
-#include <linux/bug.h>
-#include <linux/types.h>
-
-void __atomic_store_8(volatile void *p, u64 v, int i)
-{
- BUG();
-}
-
-u64 __atomic_load_8(const volatile void *p, int i)
-{
- BUG();
-}
-
-u64 __atomic_exchange_8(volatile void *p, u64 v, int i)
-{
- BUG();
-}
-
-bool __atomic_compare_exchange_8(volatile void *p1, void *p2, u64 v, bool b, int i1, int i2)
-{
- BUG();
-}
-
-u64 __atomic_fetch_add_8(volatile void *p, u64 v, int i)
-{
- BUG();
-}
-
-u64 __atomic_fetch_sub_8(volatile void *p, u64 v, int i)
-{
- BUG();
-}
-
-u64 __atomic_fetch_and_8(volatile void *p, u64 v, int i)
-{
- BUG();
-}
-
-u64 __atomic_fetch_or_8(volatile void *p, u64 v, int i)
-{
- BUG();
-}
-
-u64 __atomic_fetch_xor_8(volatile void *p, u64 v, int i)
-{
- BUG();
-}
-
-u64 __atomic_fetch_nand_8(volatile void *p, u64 v, int i)
-{
- BUG();
-}
diff --git a/kernel/kcsan/Makefile b/kernel/kcsan/Makefile
index 5dfc5825aae9..377b81be94fa 100644
--- a/kernel/kcsan/Makefile
+++ b/kernel/kcsan/Makefile
@@ -11,10 +11,7 @@ CFLAGS_core.o := $(call cc-option,-fno-conserve-stack) \
$(call cc-option,-mno-outline-atomics) \
-fno-stack-protector -DDISABLE_BRANCH_PROFILING
-obj-y := core.o debugfs.o report.o
-ifndef XTENSA
- obj-y += stubs.o
-endif
+obj-y := core.o debugfs.o report.o stubs.o
KCSAN_INSTRUMENT_BARRIERS_selftest.o := y
obj-$(CONFIG_KCSAN_SELFTEST) += selftest.o
--
2.37.2
next prev parent reply other threads:[~2023-02-08 3:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 3:21 [PATCH v4 0/7] powerpc: Add KCSAN Support Rohan McLure
2023-02-08 3:21 ` [PATCH v4 1/7] kcsan: Add atomic builtin stubs for 32-bit systems Rohan McLure
2023-02-08 4:23 ` Max Filippov
2023-02-08 12:23 ` Christophe Leroy
2023-02-08 23:14 ` Rohan McLure
2023-02-09 23:36 ` Rohan McLure
2023-02-08 3:21 ` Rohan McLure [this message]
2023-02-08 4:24 ` [PATCH v4 2/7] xtensa: kcsan: Remove kcsan stubs for atomic builtins Max Filippov
2023-02-08 3:21 ` [PATCH v4 3/7] powerpc: kcsan: Add exclusions from instrumentation Rohan McLure
2023-02-08 3:21 ` [PATCH v4 4/7] powerpc: kcsan: Exclude udelay to prevent recursive instrumentation Rohan McLure
2023-02-08 3:22 ` [PATCH v4 5/7] powerpc: kcsan: Memory barriers semantics Rohan McLure
2023-02-08 3:22 ` [PATCH v4 6/7] powerpc: kcsan: Prevent recursive instrumentation with IRQ save/restores Rohan McLure
2023-02-08 3:22 ` [PATCH v4 7/7] powerpc: kcsan: Add KCSAN Support Rohan McLure
2023-02-08 10:10 ` Marco Elver
2023-02-08 12:25 ` Christophe Leroy
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=20230208032202.1357949-3-rmclure@linux.ibm.com \
--to=rmclure@linux.ibm.com \
--cc=chris@zankel.net \
--cc=elver@google.com \
--cc=jcmvbkbc@gmail.com \
--cc=linux-xtensa@linux.xtensa.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@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;
as well as URLs for NNTP newsgroup(s).