Skip to content

kmsan: Enable on powerpc

Nicholas Miehlbradt linux-mm linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13kmsan: Export kmsan_handle_dmamm/kmsan/hooks.c+1 -01 reply
2/13hvc: Fix use of uninitialized array in udbg_hvc_putcdrivers/tty/hvc/hvc_vio.c+1 -12 replies
3/13powerpc: Disable KMSAN santitization for prom_init, vdso and purgatoryarch/powerpc/kernel/Makefile arch/powerpc/kernel/vdso/Makefile arch/powerpc/purgatory/Makefile+4 -00 replies
4/13powerpc: Disable CONFIG_DCACHE_WORD_ACCESS when KMSAN is enabledarch/powerpc/Kconfig+1 -11 reply
5/13powerpc: Unpoison buffers populated by hcallsarch/powerpc/platforms/pseries/hvconsole.c arch/powerpc/sysdev/xive/spapr.c+5 -00 replies
6/13powerpc/pseries/nvram: Unpoison buffer populated by rtas_callarch/powerpc/platforms/pseries/nvram.c+4 -00 replies
7/13powerpc/kprobes: Unpoison instruction in kprobe structarch/powerpc/kernel/kprobes.c+2 -01 reply
8/13powerpc: Unpoison pt_regsarch/powerpc/include/asm/interrupt.h arch/powerpc/kernel/irq_64.c+4 -00 replies
9/13powerpc: Disable KMSAN checks on functions which walk the stackarch/powerpc/kernel/process.c arch/powerpc/kernel/stacktrace.c arch/powerpc/perf/callchain.c+10 -83 replies
10/13powerpc: Define KMSAN metadata address ranges for vmalloc and ioremaparch/powerpc/include/asm/book3s/64/pgtable.h arch/powerpc/kernel/module.c+43 -13 replies
11/13powerpc: Implement architecture specific KMSAN interfacearch/powerpc/include/asm/kmsan.h+44 -01 reply
12/13powerpc/string: Add KMSAN supportarch/powerpc/include/asm/kmsan.h arch/powerpc/include/asm/string.h arch/powerpc/lib/Makefile +4 more+32 -32 replies
13/13powerpc: Enable KMSAN on powerpcarch/powerpc/Kconfig+1 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/13] kmsan: Enable on powerpc

This series provides the minimal support for Kernal Memory Sanitizer on powerpc pseries le guests. Kernal Memory Sanitizer is a tool which detects uses of uninitialized memory. Currently KMSAN is clang only.

The clang support for powerpc has not yet been merged, the pull request can be found here [1].

In addition to this series, there are a number of changes required in generic kmsan code. These changes are already on mailing lists as part of the series implementing KMSAN for s390 [2]. This series is intended to be rebased on top of the s390 series.

In addition, I found a bug in the rtc driver used on powerpc. I have sent a fix to this in a seperate series [3].

With this series and the two series mentioned above, I can successfully boot pseries le defconfig without KMSAN warnings. I have not tested other powerpc platforms.

[1] https://github.com/llvm/llvm-project/pull/73611
[2] https://lore.kernel.org/linux-mm/[email protected]/
[3] https://lore.kernel.org/linux-rtc/[email protected]/

Nicholas Miehlbradt (13):
kmsan: Export kmsan_handle_dma
hvc: Fix use of uninitialized array in udbg_hvc_putc
powerpc: Disable KMSAN santitization for prom_init, vdso and purgatory
powerpc: Disable CONFIG_DCACHE_WORD_ACCESS when KMSAN is enabled
powerpc: Unpoison buffers populated by hcalls powerpc/pseries/nvram: Unpoison buffer populated by rtas_call powerpc/kprobes: Unpoison instruction in kprobe struct
powerpc: Unpoison pt_regs
powerpc: Disable KMSAN checks on functions which walk the stack
powerpc: Define KMSAN metadata address ranges for vmalloc and ioremap
powerpc: Implement architecture specific KMSAN interface powerpc/string: Add KMSAN support
powerpc: Enable KMSAN on powerpc

 arch/powerpc/Kconfig                          |  3 +-
 arch/powerpc/include/asm/book3s/64/pgtable.h  | 42 +++++++++++++++
 arch/powerpc/include/asm/interrupt.h          |  2 +
 arch/powerpc/include/asm/kmsan.h              | 51 +++++++++++++++++++
 arch/powerpc/include/asm/string.h             | 18 ++++++-
 arch/powerpc/kernel/Makefile                  |  2 +
 arch/powerpc/kernel/irq_64.c                  |  2 +
 arch/powerpc/kernel/kprobes.c                 |  2 +
 arch/powerpc/kernel/module.c                  |  2 +-
 arch/powerpc/kernel/process.c                 |  6 +--
 arch/powerpc/kernel/stacktrace.c              | 10 ++--
 arch/powerpc/kernel/vdso/Makefile             |  1 +
 arch/powerpc/lib/Makefile                     |  2 +
 arch/powerpc/lib/mem_64.S                     |  5 +-
 arch/powerpc/lib/memcpy_64.S                  |  2 +
 arch/powerpc/perf/callchain.c                 |  2 +-
 arch/powerpc/platforms/pseries/hvconsole.c    |  2 +
 arch/powerpc/platforms/pseries/nvram.c        |  4 ++
 arch/powerpc/purgatory/Makefile               |  1 +
 arch/powerpc/sysdev/xive/spapr.c              |  3 ++
 drivers/tty/hvc/hvc_vio.c                     |  2 +-
 mm/kmsan/hooks.c                              |  1 +
 .../selftests/powerpc/copyloops/asm/kmsan.h   |  0
 .../powerpc/copyloops/linux/export.h          |  1 +
 24 files changed, 152 insertions(+), 14 deletions(-)
 create mode 100644 arch/powerpc/include/asm/kmsan.h
 create mode 100644 tools/testing/selftests/powerpc/copyloops/asm/kmsan.h
Signature · 1 line
2.40.1