Skip to content

powerpc: Add KCSAN Support

Rohan McLure linuxppc-dev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest7 patches 7 repliesIn review
  2. v35 patches 3 repliesApplied
  3. v25 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v10 of 5 patches0 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7kcsan: Add atomic builtin stubs for 32-bit systemskernel/kcsan/Makefile kernel/kcsan/stubs.c+81 -04 replies
2/7xtensa: kcsan: Remove kcsan stubs for atomic builtinsarch/xtensa/lib/Makefile arch/xtensa/lib/kcsan-stubs.c kernel/kcsan/Makefile+1 -591 reply
3/7powerpc: kcsan: Add exclusions from instrumentationarch/powerpc/kernel/Makefile arch/powerpc/kernel/trace/Makefile arch/powerpc/kernel/vdso/Makefile +3 more+16 -00 replies
4/7powerpc: kcsan: Exclude udelay to prevent recursive instrumentationarch/powerpc/kernel/time.c+2 -20 replies
5/7powerpc: kcsan: Memory barriers semanticsarch/powerpc/include/asm/barrier.h+6 -60 replies
6/7powerpc: kcsan: Prevent recursive instrumentation with IRQ save/restoresarch/powerpc/kernel/irq_64.c+3 -30 replies
7/7powerpc: kcsan: Add KCSAN Supportarch/powerpc/Kconfig+1 -02 replies

Reviews trailers per patch

2 of 7 patches have a Reviewed-by or Acked-by.

PatchMax Filippov
1/7R-b
2/7A-b
3/7
4/7
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/7] powerpc: Add KCSAN Support

Add Kernel Concurrency Sanitiser support for PPC64. Doing so involves exclusion of a number of compilation units from instrumentation, as was done with KASAN.

KCSAN uses watchpoints on memory accesses to enforce the semantics of the Linux kernel memory model, notifying the user of observed data races which have not been declared to be intended in source through the data_race() macro, in order to remove false positives.

A number of such race conditions are identified. This patch series provides support for the instrumentation, with bug fixes as well as removal of false positives to be issued in future patches.

As of v4, provide stubs for __atomic_* builtins for 8-byte values for 32-bit systems without toolchain support. This generalises xtensa's stubs, and causes xtensa to use generic implementation.

v3: Restrict support to PPC64 as kcsan code expects support for __atomic* builtins for 64-bit atomic types.

v2: Implement __smp_mb() in terms of __mb() to avoid multiple calls to kcsan_mb().

v1: https://lore.kernel.org/linuxppc-dev/[email protected]/

Rohan McLure (7):
kcsan: Add atomic builtin stubs for 32-bit systems
xtensa: kcsan: Remove kcsan stubs for atomic builtins
powerpc: kcsan: Add exclusions from instrumentation
powerpc: kcsan: Exclude udelay to prevent recursive instrumentation
powerpc: kcsan: Memory barriers semantics
powerpc: kcsan: Prevent recursive instrumentation with IRQ
save/restores
powerpc: kcsan: Add KCSAN Support

 arch/powerpc/Kconfig                          |  1 +
 arch/powerpc/include/asm/barrier.h            | 12 ++++-----
 arch/powerpc/kernel/Makefile                  | 10 +++++++
 arch/powerpc/kernel/irq_64.c                  |  6 ++---
 arch/powerpc/kernel/time.c                    |  4 +--
 arch/powerpc/kernel/trace/Makefile            |  1 +
 arch/powerpc/kernel/vdso/Makefile             |  1 +
 arch/powerpc/lib/Makefile                     |  2 ++
 arch/powerpc/purgatory/Makefile               |  1 +
 arch/powerpc/xmon/Makefile                    |  1 +
 arch/xtensa/lib/Makefile                      |  1 -
 kernel/kcsan/Makefile                         |  2 +-
 .../lib/kcsan-stubs.c => kernel/kcsan/stubs.c | 26 ++++++++++++++++++-
 13 files changed, 54 insertions(+), 14 deletions(-)
 rename arch/xtensa/lib/kcsan-stubs.c => kernel/kcsan/stubs.c (58%)
Signature · 1 line
2.37.2