[PATCH] D148596: [KMSAN] Enable on SystemZ

Ilya Leoshkevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 17 18:12:28 PDT 2023


iii created this revision.
iii added reviewers: eugenis, vitalybuka, glider, uweigand, jonpa.
Herald added subscribers: Enna1, pengfei, hiraditya.
Herald added a project: All.
iii requested review of this revision.
Herald added subscribers: llvm-commits, cfe-commits, MaskRay.
Herald added projects: clang, LLVM.

Enable -fsanitize=kernel-memory support in Clang.

Fix an ABI issue: on x86_64 shadow_origin_ptr_t is returned via a
register pair, and on s390x it should be returned via memory. This
means that functions that return it should take a hidden parameter.
Normally Clang takes care of the ABI, so unfortunately sanitizers have
to duplicate this logic. Therefore add a special case for SystemZ and
emit s390x-ABI-compliant calling sequences. Since it's only 2
architectures, do not create a VarArgHelper-like abstraction layer.

Add a test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148596

Files:
  clang/lib/Driver/ToolChains/Linux.cpp
  llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
  llvm/test/Instrumentation/MemorySanitizer/SystemZ/basic-kernel.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148596.514489.patch
Type: text/x-patch
Size: 10721 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230418/317272ae/attachment.bin>


More information about the cfe-commits mailing list