linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Extend KCSAN to all powerpc
@ 2023-05-12 15:31 Christophe Leroy
  2023-05-12 15:31 ` [PATCH 1/3] kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures Christophe Leroy
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Christophe Leroy @ 2023-05-12 15:31 UTC (permalink / raw)
  To: Marco Elver, Dmitry Vyukov, Paul E. McKenney, Michael Ellerman,
	Nicholas Piggin, Chris Zankel, Max Filippov
  Cc: Rohan McLure, kasan-dev, linuxppc-dev, linux-kernel

This series enables KCSAN on all powerpc.

To do this, a fix is required to KCSAN core.

Once that fix is done, the stubs can also be removed from xtensa.

It would be nice if patch 1 could go in v6.4 as a fix, then patches 2 and 3
could be handled separately in each architecture in next cycle.

Christophe Leroy (2):
  kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures
  xtensa: Remove 64 bits atomic builtins stubs

Rohan McLure (1):
  powerpc/{32,book3e}: kcsan: Extend KCSAN Support

 arch/powerpc/Kconfig          |  2 +-
 arch/xtensa/lib/Makefile      |  2 --
 arch/xtensa/lib/kcsan-stubs.c | 54 -----------------------------------
 kernel/kcsan/core.c           |  2 ++
 4 files changed, 3 insertions(+), 57 deletions(-)
 delete mode 100644 arch/xtensa/lib/kcsan-stubs.c

-- 
2.40.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/3] kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures
  2023-05-12 15:31 [PATCH 0/3] Extend KCSAN to all powerpc Christophe Leroy
@ 2023-05-12 15:31 ` Christophe Leroy
  2023-05-12 16:09   ` Marco Elver
  2023-05-12 15:31 ` [PATCH 2/3] powerpc/{32,book3e}: kcsan: Extend KCSAN Support Christophe Leroy
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Christophe Leroy @ 2023-05-12 15:31 UTC (permalink / raw)
  To: Marco Elver, Dmitry Vyukov, Paul E. McKenney, Michael Ellerman,
	Nicholas Piggin, Chris Zankel, Max Filippov
  Cc: Rohan McLure, kasan-dev, linuxppc-dev, linux-kernel

Activating KCSAN on a 32 bits architecture leads to the following
link-time failure:

    LD      .tmp_vmlinux.kallsyms1
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_load':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_load_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_store':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_store_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_exchange':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_exchange_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_add':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_add_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_sub':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_sub_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_and':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_and_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_or':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_or_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_xor':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_xor_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_nand':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_nand_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_strong':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_weak':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_val':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'

32 bits architectures don't have 64 bits atomic builtins. Only
include DEFINE_TSAN_ATOMIC_OPS(64) on 64 bits architectures.

Fixes: 0f8ad5f2e934 ("kcsan: Add support for atomic builtins")
Suggested-by: Marco Elver <elver@google.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 kernel/kcsan/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/kcsan/core.c b/kernel/kcsan/core.c
index 5a60cc52adc0..8a7baf4e332e 100644
--- a/kernel/kcsan/core.c
+++ b/kernel/kcsan/core.c
@@ -1270,7 +1270,9 @@ static __always_inline void kcsan_atomic_builtin_memorder(int memorder)
 DEFINE_TSAN_ATOMIC_OPS(8);
 DEFINE_TSAN_ATOMIC_OPS(16);
 DEFINE_TSAN_ATOMIC_OPS(32);
+#ifdef CONFIG_64BIT
 DEFINE_TSAN_ATOMIC_OPS(64);
+#endif
 
 void __tsan_atomic_thread_fence(int memorder);
 void __tsan_atomic_thread_fence(int memorder)
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/3] powerpc/{32,book3e}: kcsan: Extend KCSAN Support
  2023-05-12 15:31 [PATCH 0/3] Extend KCSAN to all powerpc Christophe Leroy
  2023-05-12 15:31 ` [PATCH 1/3] kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures Christophe Leroy
@ 2023-05-12 15:31 ` Christophe Leroy
  2023-05-12 15:31 ` [PATCH 3/3] xtensa: Remove 64 bits atomic builtins stubs Christophe Leroy
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Christophe Leroy @ 2023-05-12 15:31 UTC (permalink / raw)
  To: Marco Elver, Dmitry Vyukov, Paul E. McKenney, Michael Ellerman,
	Nicholas Piggin, Chris Zankel, Max Filippov
  Cc: Rohan McLure, kasan-dev, linuxppc-dev, linux-kernel

From: Rohan McLure <rmclure@linux.ibm.com>

Enable HAVE_ARCH_KCSAN on all powerpc platforms, permitting use of the
kernel concurrency sanitiser through the CONFIG_KCSAN_* kconfig options.

Boots and passes selftests on 32-bit and 64-bit platforms. See
documentation in Documentation/dev-tools/kcsan.rst for more information.

Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/powerpc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 539d1f03ff42..2f6af3cb75d6 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -211,7 +211,7 @@ config PPC
 	select HAVE_ARCH_KASAN			if PPC_RADIX_MMU
 	select HAVE_ARCH_KASAN			if PPC_BOOK3E_64
 	select HAVE_ARCH_KASAN_VMALLOC		if HAVE_ARCH_KASAN
-	select HAVE_ARCH_KCSAN            	if PPC_BOOK3S_64
+	select HAVE_ARCH_KCSAN
 	select HAVE_ARCH_KFENCE			if ARCH_SUPPORTS_DEBUG_PAGEALLOC
 	select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
 	select HAVE_ARCH_WITHIN_STACK_FRAMES
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/3] xtensa: Remove 64 bits atomic builtins stubs
  2023-05-12 15:31 [PATCH 0/3] Extend KCSAN to all powerpc Christophe Leroy
  2023-05-12 15:31 ` [PATCH 1/3] kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures Christophe Leroy
  2023-05-12 15:31 ` [PATCH 2/3] powerpc/{32,book3e}: kcsan: Extend KCSAN Support Christophe Leroy
@ 2023-05-12 15:31 ` Christophe Leroy
  2023-05-12 16:38   ` Max Filippov
  2023-05-12 16:22 ` [PATCH 0/3] Extend KCSAN to all powerpc Marco Elver
  2023-07-03  5:26 ` Michael Ellerman
  4 siblings, 1 reply; 10+ messages in thread
From: Christophe Leroy @ 2023-05-12 15:31 UTC (permalink / raw)
  To: Marco Elver, Dmitry Vyukov, Paul E. McKenney, Michael Ellerman,
	Nicholas Piggin, Chris Zankel, Max Filippov
  Cc: Rohan McLure, kasan-dev, linuxppc-dev, linux-kernel

The stubs were provided by commit 725aea873261 ("xtensa: enable KCSAN")
to make linker happy allthought they are not meant to be used at all.

KCSAN core has been fixed to not require them anymore on
32 bits architectures.

Then they can be removed.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/xtensa/lib/Makefile      |  2 --
 arch/xtensa/lib/kcsan-stubs.c | 54 -----------------------------------
 2 files changed, 56 deletions(-)
 delete mode 100644 arch/xtensa/lib/kcsan-stubs.c

diff --git a/arch/xtensa/lib/Makefile b/arch/xtensa/lib/Makefile
index 7ecef0519a27..23c22411d1d9 100644
--- a/arch/xtensa/lib/Makefile
+++ b/arch/xtensa/lib/Makefile
@@ -8,5 +8,3 @@ 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();
-}
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures
  2023-05-12 15:31 ` [PATCH 1/3] kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures Christophe Leroy
@ 2023-05-12 16:09   ` Marco Elver
  2023-05-12 18:39     ` Christophe Leroy
  0 siblings, 1 reply; 10+ messages in thread
From: Marco Elver @ 2023-05-12 16:09 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Chris Zankel, Paul E. McKenney, linux-kernel, Nicholas Piggin,
	Max Filippov, Rohan McLure, kasan-dev, linuxppc-dev,
	Dmitry Vyukov

On Fri, 12 May 2023 at 17:31, Christophe Leroy
<christophe.leroy@csgroup.eu> wrote:
>
> Activating KCSAN on a 32 bits architecture leads to the following
> link-time failure:
>
>     LD      .tmp_vmlinux.kallsyms1
>   powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_load':
>   kernel/kcsan/core.c:1273: undefined reference to `__atomic_load_8'
>   powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_store':
>   kernel/kcsan/core.c:1273: undefined reference to `__atomic_store_8'
>   powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_exchange':
>   kernel/kcsan/core.c:1273: undefined reference to `__atomic_exchange_8'
>   powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_add':
>   kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_add_8'
>   powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_sub':
>   kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_sub_8'
>   powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_and':
>   kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_and_8'
>   powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_or':
>   kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_or_8'
>   powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_xor':
>   kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_xor_8'
>   powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_nand':
>   kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_nand_8'
>   powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_strong':
>   kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'
>   powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_weak':
>   kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'
>   powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_val':
>   kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'
>
> 32 bits architectures don't have 64 bits atomic builtins. Only
> include DEFINE_TSAN_ATOMIC_OPS(64) on 64 bits architectures.
>
> Fixes: 0f8ad5f2e934 ("kcsan: Add support for atomic builtins")
> Suggested-by: Marco Elver <elver@google.com>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>

Reviewed-by: Marco Elver <elver@google.com>

Do you have your own tree to take this through with the other patches?

> ---
>  kernel/kcsan/core.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/kernel/kcsan/core.c b/kernel/kcsan/core.c
> index 5a60cc52adc0..8a7baf4e332e 100644
> --- a/kernel/kcsan/core.c
> +++ b/kernel/kcsan/core.c
> @@ -1270,7 +1270,9 @@ static __always_inline void kcsan_atomic_builtin_memorder(int memorder)
>  DEFINE_TSAN_ATOMIC_OPS(8);
>  DEFINE_TSAN_ATOMIC_OPS(16);
>  DEFINE_TSAN_ATOMIC_OPS(32);
> +#ifdef CONFIG_64BIT
>  DEFINE_TSAN_ATOMIC_OPS(64);
> +#endif
>
>  void __tsan_atomic_thread_fence(int memorder);
>  void __tsan_atomic_thread_fence(int memorder)
> --
> 2.40.1
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/3] Extend KCSAN to all powerpc
  2023-05-12 15:31 [PATCH 0/3] Extend KCSAN to all powerpc Christophe Leroy
                   ` (2 preceding siblings ...)
  2023-05-12 15:31 ` [PATCH 3/3] xtensa: Remove 64 bits atomic builtins stubs Christophe Leroy
@ 2023-05-12 16:22 ` Marco Elver
  2023-07-03  5:26 ` Michael Ellerman
  4 siblings, 0 replies; 10+ messages in thread
From: Marco Elver @ 2023-05-12 16:22 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Chris Zankel, Paul E. McKenney, linux-kernel, Nicholas Piggin,
	Max Filippov, Rohan McLure, kasan-dev, linuxppc-dev,
	Dmitry Vyukov

On Fri, 12 May 2023 at 17:31, Christophe Leroy
<christophe.leroy@csgroup.eu> wrote:
>
> This series enables KCSAN on all powerpc.
>
> To do this, a fix is required to KCSAN core.
>
> Once that fix is done, the stubs can also be removed from xtensa.
>
> It would be nice if patch 1 could go in v6.4 as a fix, then patches 2 and 3
> could be handled separately in each architecture in next cycle.
>
> Christophe Leroy (2):
>   kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures
>   xtensa: Remove 64 bits atomic builtins stubs
>
> Rohan McLure (1):
>   powerpc/{32,book3e}: kcsan: Extend KCSAN Support

Acked-by: Marco Elver <elver@google.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3] xtensa: Remove 64 bits atomic builtins stubs
  2023-05-12 15:31 ` [PATCH 3/3] xtensa: Remove 64 bits atomic builtins stubs Christophe Leroy
@ 2023-05-12 16:38   ` Max Filippov
  0 siblings, 0 replies; 10+ messages in thread
From: Max Filippov @ 2023-05-12 16:38 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Chris Zankel, Marco Elver, Paul E. McKenney, linux-kernel,
	Nicholas Piggin, Rohan McLure, kasan-dev, linuxppc-dev,
	Dmitry Vyukov

On Fri, May 12, 2023 at 8:31 AM Christophe Leroy
<christophe.leroy@csgroup.eu> wrote:
>
> The stubs were provided by commit 725aea873261 ("xtensa: enable KCSAN")
> to make linker happy allthought they are not meant to be used at all.
>
> KCSAN core has been fixed to not require them anymore on
> 32 bits architectures.
>
> Then they can be removed.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
>  arch/xtensa/lib/Makefile      |  2 --
>  arch/xtensa/lib/kcsan-stubs.c | 54 -----------------------------------
>  2 files changed, 56 deletions(-)
>  delete mode 100644 arch/xtensa/lib/kcsan-stubs.c

Acked-by: Max Filippov <jcmvbkbc@gmail.com>

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures
  2023-05-12 16:09   ` Marco Elver
@ 2023-05-12 18:39     ` Christophe Leroy
  2023-06-09 12:55       ` Michael Ellerman
  0 siblings, 1 reply; 10+ messages in thread
From: Christophe Leroy @ 2023-05-12 18:39 UTC (permalink / raw)
  To: Marco Elver, Michael Ellerman
  Cc: Chris Zankel, Paul E. McKenney, linux-kernel@vger.kernel.org,
	Nicholas Piggin, Max Filippov, Rohan McLure,
	kasan-dev@googlegroups.com, linuxppc-dev@lists.ozlabs.org,
	Dmitry Vyukov



Le 12/05/2023 à 18:09, Marco Elver a écrit :
> On Fri, 12 May 2023 at 17:31, Christophe Leroy
> <christophe.leroy@csgroup.eu> wrote:
>>
>> Activating KCSAN on a 32 bits architecture leads to the following
>> link-time failure:
>>
>>      LD      .tmp_vmlinux.kallsyms1
>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_load':
>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_load_8'
>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_store':
>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_store_8'
>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_exchange':
>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_exchange_8'
>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_add':
>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_add_8'
>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_sub':
>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_sub_8'
>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_and':
>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_and_8'
>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_or':
>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_or_8'
>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_xor':
>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_xor_8'
>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_nand':
>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_nand_8'
>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_strong':
>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'
>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_weak':
>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'
>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_val':
>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'
>>
>> 32 bits architectures don't have 64 bits atomic builtins. Only
>> include DEFINE_TSAN_ATOMIC_OPS(64) on 64 bits architectures.
>>
>> Fixes: 0f8ad5f2e934 ("kcsan: Add support for atomic builtins")
>> Suggested-by: Marco Elver <elver@google.com>
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> 
> Reviewed-by: Marco Elver <elver@google.com>
> 
> Do you have your own tree to take this through with the other patches?

I don't have my own tree but I guess that it can be taken by Michael for 
6.5 via powerpc tree with acks from you and Max.

Michael is that ok for you ?

Christophe

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures
  2023-05-12 18:39     ` Christophe Leroy
@ 2023-06-09 12:55       ` Michael Ellerman
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Ellerman @ 2023-06-09 12:55 UTC (permalink / raw)
  To: Christophe Leroy, Marco Elver
  Cc: Chris Zankel, Paul E. McKenney, linux-kernel@vger.kernel.org,
	Nicholas Piggin, Max Filippov, Rohan McLure,
	kasan-dev@googlegroups.com, linuxppc-dev@lists.ozlabs.org,
	Dmitry Vyukov

Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> Le 12/05/2023 à 18:09, Marco Elver a écrit :
>> On Fri, 12 May 2023 at 17:31, Christophe Leroy
>> <christophe.leroy@csgroup.eu> wrote:
>>>
>>> Activating KCSAN on a 32 bits architecture leads to the following
>>> link-time failure:
>>>
>>>      LD      .tmp_vmlinux.kallsyms1
>>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_load':
>>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_load_8'
>>>    powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_store':
>>>    kernel/kcsan/core.c:1273: undefined reference to `__atomic_store_8'
...
>>>
>>> 32 bits architectures don't have 64 bits atomic builtins. Only
>>> include DEFINE_TSAN_ATOMIC_OPS(64) on 64 bits architectures.
>>>
>>> Fixes: 0f8ad5f2e934 ("kcsan: Add support for atomic builtins")
>>> Suggested-by: Marco Elver <elver@google.com>
>>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> 
>> Reviewed-by: Marco Elver <elver@google.com>
>> 
>> Do you have your own tree to take this through with the other patches?
>
> I don't have my own tree but I guess that it can be taken by Michael for 
> 6.5 via powerpc tree with acks from you and Max.
>
> Michael is that ok for you ?

Yeah I can take it.

cheers

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/3] Extend KCSAN to all powerpc
  2023-05-12 15:31 [PATCH 0/3] Extend KCSAN to all powerpc Christophe Leroy
                   ` (3 preceding siblings ...)
  2023-05-12 16:22 ` [PATCH 0/3] Extend KCSAN to all powerpc Marco Elver
@ 2023-07-03  5:26 ` Michael Ellerman
  4 siblings, 0 replies; 10+ messages in thread
From: Michael Ellerman @ 2023-07-03  5:26 UTC (permalink / raw)
  To: Marco Elver, Dmitry Vyukov, Paul E. McKenney, Nicholas Piggin,
	Chris Zankel, Max Filippov, Christophe Leroy
  Cc: Rohan McLure, linuxppc-dev, linux-kernel, kasan-dev

On Fri, 12 May 2023 17:31:16 +0200, Christophe Leroy wrote:
> This series enables KCSAN on all powerpc.
> 
> To do this, a fix is required to KCSAN core.
> 
> Once that fix is done, the stubs can also be removed from xtensa.
> 
> It would be nice if patch 1 could go in v6.4 as a fix, then patches 2 and 3
> could be handled separately in each architecture in next cycle.
> 
> [...]

Applied to powerpc/next.

[1/3] kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures
      https://git.kernel.org/powerpc/c/353e7300a1db928e427462f2745f9a2cd1625b3d
[2/3] powerpc/{32,book3e}: kcsan: Extend KCSAN Support
      https://git.kernel.org/powerpc/c/95567f46b4d20c047750a5e3029461afcdc67697
[3/3] xtensa: Remove 64 bits atomic builtins stubs
      https://git.kernel.org/powerpc/c/bcea4f7a70dc800e769ef02d8c3bc4df357ed893

cheers

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-07-03  5:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-12 15:31 [PATCH 0/3] Extend KCSAN to all powerpc Christophe Leroy
2023-05-12 15:31 ` [PATCH 1/3] kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures Christophe Leroy
2023-05-12 16:09   ` Marco Elver
2023-05-12 18:39     ` Christophe Leroy
2023-06-09 12:55       ` Michael Ellerman
2023-05-12 15:31 ` [PATCH 2/3] powerpc/{32,book3e}: kcsan: Extend KCSAN Support Christophe Leroy
2023-05-12 15:31 ` [PATCH 3/3] xtensa: Remove 64 bits atomic builtins stubs Christophe Leroy
2023-05-12 16:38   ` Max Filippov
2023-05-12 16:22 ` [PATCH 0/3] Extend KCSAN to all powerpc Marco Elver
2023-07-03  5:26 ` Michael Ellerman

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).