[all-commits] [llvm/llvm-project] 3bc439: [MSan] Add instrumentation for SystemZ

Ilya Leoshkevich via All-commits all-commits at lists.llvm.org
Fri Apr 10 07:54:23 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3bc439bdff8bb5518098bd9ef52c56ac071276bc
      https://github.com/llvm/llvm-project/commit/3bc439bdff8bb5518098bd9ef52c56ac071276bc
  Author: Ilya Leoshkevich <iii at linux.ibm.com>
  Date:   2020-04-10 (Fri, 10 Apr 2020)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
    A llvm/test/Instrumentation/MemorySanitizer/SystemZ/vararg-kernel.ll
    A llvm/test/Instrumentation/MemorySanitizer/SystemZ/vararg.ll
    M llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll

  Log Message:
  -----------
  [MSan] Add instrumentation for SystemZ

Summary:
This patch establishes memory layout and adds instrumentation. It does
not add runtime support and does not enable MSan, which will be done
separately.

Memory layout is based on PPC64, with the exception that XorMask
is not used - low and high memory addresses are chosen in a way that
applying AndMask to low and high memory produces non-overlapping
results.

VarArgHelper is based on AMD64. It might be tempting to share some
code between the two implementations, but we need to keep in mind that
all the ABI similarities are coincidental, and therefore any such
sharing might backfire.

copyRegSaveArea() indiscriminately copies the entire register save area
shadow, however, fragments thereof not filled by the corresponding
visitCallSite() invocation contain irrelevant data. Whether or not this
can lead to practical problems is unclear, hence a simple TODO comment.
Note that the behavior of the related copyOverflowArea() is correct: it
copies only the vararg-related fragment of the overflow area shadow.

VarArgHelper test is based on the AArch64 one.

s390x ABI requires that arguments are zero-extended to 64 bits. This is
particularly important for __msan_maybe_warning_*() and
__msan_maybe_store_origin_*() shadow and origin arguments, since non
zeroed upper parts thereof confuse these functions. Therefore, add ZExt
attribute to the corresponding parameters.

Add ZExt attribute checks to msan-basic.ll. Since with
-msan-instrumentation-with-call-threshold=0 instrumentation looks quite
different, introduce the new CHECK-CALLS check prefix.

Reviewers: eugenis, vitalybuka, uweigand, jonpa

Reviewed By: eugenis

Subscribers: kristof.beyls, hiraditya, danielkiss, llvm-commits, stefansf, Andreas-Krebbel

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76624




More information about the All-commits mailing list