[all-commits] [llvm/llvm-project] c9b1a2: AArch64: Use SBFX instead of UBFX to extract addre...

pcc via All-commits all-commits at lists.llvm.org
Fri Oct 30 12:54:05 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c9b1a2b41dca6e6734aa39833a0dab0d0a8b53d3
      https://github.com/llvm/llvm-project/commit/c9b1a2b41dca6e6734aa39833a0dab0d0a8b53d3
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2020-10-30 (Fri, 30 Oct 2020)

  Changed paths:
    M clang/docs/HardwareAssistedAddressSanitizerDesign.rst
    M llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
    M llvm/test/CodeGen/AArch64/hwasan-check-memaccess.ll

  Log Message:
  -----------
  AArch64: Use SBFX instead of UBFX to extract address granule in outlined HWASan checks.

In a kernel (or in general in environments where bit 55 of the address
is set) the shadow base needs to point to the end of the shadow region,
not the beginning. Bit 55 needs to be sign extended into bits 52-63
of the shadow base offset, otherwise we end up loading from an invalid
address. We can do this by using SBFX instead of UBFX.

Using SBFX should have no effect in the userspace case where bit 55
of the address is clear so we do so unconditionally. I don't think
we need a ABI version bump for this (but one will come anyway when
we switch to x20 for the shadow base register).

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




More information about the All-commits mailing list