linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Rohan McLure <rmclure@linux.ibm.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Cc: "npiggin@gmail.com" <npiggin@gmail.com>
Subject: Re: [PATCH v3 5/5] powerpc: kcsan: Add KCSAN Support
Date: Mon, 6 Feb 2023 08:13:53 +0000	[thread overview]
Message-ID: <636251cf-7c4a-53cb-dab7-a11e65863f30@csgroup.eu> (raw)
In-Reply-To: <20230206021801.105268-6-rmclure@linux.ibm.com>



Le 06/02/2023 à 03:18, Rohan McLure a écrit :
> Enable HAVE_ARCH_KCSAN on all powerpc platforms, permitting use of the
> kernel concurrency sanitiser through the CONFIG_KCSAN_* kconfig options.
> KCSAN requires compiler builtins __atomic_* 64-bit values, and so only
> report support on PPC64.
> 
> See documentation in Documentation/dev-tools/kcsan.rst for more
> information.
> 
> Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
> ---
> v3: Restrict support to 64-bit, as TSAN expects 64-bit __atomic_* compiler
> built-ins.

Support for PPC32 should be kept.

See commit 725aea873261 ("xtensa: enable KCSAN")
xtensa is a 32 bits architecture, they have implemented stubs for 64-bit 
atomics.

Maybe those stubs should be made generic by moving them into 
kernel/kcsan/ and building them for all 32 bit architectures.

Christophe

> ---
>   arch/powerpc/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index b8c4ac56bddc..55bc2d724c73 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -198,6 +198,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 PPC64
>   	select HAVE_ARCH_KFENCE			if ARCH_SUPPORTS_DEBUG_PAGEALLOC
>   	select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
>   	select HAVE_ARCH_KGDB

  reply	other threads:[~2023-02-06  8:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06  2:17 [PATCH v3 0/5] powerpc: Add KCSAN support Rohan McLure
2023-02-06  2:17 ` [PATCH v3 1/5] powerpc: kcsan: Add exclusions from instrumentation Rohan McLure
2023-02-06  2:17 ` [PATCH v3 2/5] powerpc: kcsan: Exclude udelay to prevent recursive instrumentation Rohan McLure
2023-02-06  2:17 ` [PATCH v3 3/5] powerpc: kcsan: Memory barriers semantics Rohan McLure
2023-02-06  2:18 ` [PATCH v3 4/5] powerpc: kcsan: Prevent recursive instrumentation with IRQ save/restores Rohan McLure
2023-02-06  2:18 ` [PATCH v3 5/5] powerpc: kcsan: Add KCSAN Support Rohan McLure
2023-02-06  8:13   ` Christophe Leroy [this message]
2023-02-06  8:12 ` [PATCH v3 0/5] powerpc: Add KCSAN support Christophe Leroy
2023-02-15 12:41 ` Michael Ellerman

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=636251cf-7c4a-53cb-dab7-a11e65863f30@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    --cc=rmclure@linux.ibm.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).