This is an archive of the discontinued LLVM Phabricator instance.

[asan] Add instrumentation support for Myriad
ClosedPublic

Authored by waltl on May 4 2018, 1:41 PM.

Details

Summary
  1. Define Myriad-specific ASan constants.
  1. Add code to generate an outer loop that checks that the address is in DRAM range, and strip the cache bit from the address. The former is required because Myriad has no memory protection, and it is up to the instrumentation to range-check before using it to index into the shadow memory.
  1. Add a test.

Diff Detail

Event Timeline

waltl created this revision.May 4 2018, 1:41 PM
kcc added inline comments.May 4 2018, 2:58 PM
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
1563

move this logic to where the 'Recover' flag is set.

waltl updated this revision to Diff 145766.May 8 2018, 1:22 PM

Revert Myraid special case code for whether report error function
can recover, and minor cleanups.

waltl marked an inline comment as done.May 8 2018, 1:23 PM
waltl added inline comments.
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
1563

I reverted this change; it's no longer needed.

waltl edited the summary of this revision. (Show Details)May 8 2018, 9:08 PM
waltl updated this revision to Diff 147361.May 17 2018, 11:16 AM
waltl marked an inline comment as done.

Fixes to support changing the shadow scale

alekseyshl added inline comments.May 17 2018, 4:21 PM
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
527

What's " - (kMyriadMemoryOffset32 >> Mapping.Scale)" part for?

waltl added inline comments.May 17 2018, 4:23 PM
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
527

It's to account for the non-zero starting DRAM address. See https://docs.google.com/document/d/1oxmk0xUojybDaQDAuTEVpHVMi5xQX74cJPyMJbaSaRM

alekseyshl accepted this revision.May 17 2018, 4:28 PM
This revision is now accepted and ready to land.May 17 2018, 4:28 PM
This revision was automatically updated to reflect the committed changes.