This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] [msan] Unify aarch64 mapping
ClosedPublic

Authored by zatrazz on Oct 16 2015, 11:01 AM.

Details

Summary

This patch unify the 39-bit and 42-bit mapping for aarch64 using only
one instrumentation algorithm (based on 39-bit mapping). This removes
compiler flag SANITIZER_AARCH64_VMA requirement for msan on aarch64.

The unifies mapping scheme now is:

{0x00000000000ULL, 0x04000000000ULL, MappingDesc::INVALID, "invalid"},
{0x04000000000ULL, 0x04100000000ULL, MappingDesc::SHADOW,  "shadow-1"},
{0x04100000000ULL, 0x04300000000ULL, MappingDesc::SHADOW,  "shadow-2"},
{0x04300000000ULL, 0x04400000000ULL, MappingDesc::ORIGIN,  "origin-1"},
{0x04400000000ULL, 0x04600000000ULL, MappingDesc::ORIGIN,  "origin-2"},
{0x04600000000ULL, 0x05500000000ULL, MappingDesc::INVALID, "invalid"},
{0x05500000000ULL, 0x05600000000ULL, MappingDesc::APP,     "app-1 (39)"},
{0x05600000000ULL, 0x07000000000ULL, MappingDesc::INVALID, "invalid"},
{0x07000000000ULL, 0x08000000000ULL, MappingDesc::APP,     "app-2 (39)"},
{0x08000000000ULL, 0x2AA00000000ULL, MappingDesc::INVALID, "invalid"},
// The segments below are only valid and mapped for 42-bit VMA kernels.
{0x2AA00000000ULL, 0x2AB00000000ULL, MappingDesc::APP,     "app-3 (42)"},
{0x2AB00000000ULL, 0x2C300000000ULL, MappingDesc::INVALID, "invalid"},
{0x2C300000000ULL, 0x2C400000000ULL, MappingDesc::SHADOW,  "shadow-3"},
{0x2C400000000ULL, 0x2C600000000ULL, MappingDesc::INVALID, "invalid"},
{0x2C600000000ULL, 0x2C700000000ULL, MappingDesc::ORIGIN,  "origin-3"},
{0x2C700000000ULL, 0x3C100000000ULL, MappingDesc::INVALID, "invalid"},
{0x3C100000000ULL, 0x3C300000000ULL, MappingDesc::SHADOW,  "shadow-4"},
{0x3C300000000ULL, 0x3C400000000ULL, MappingDesc::INVALID, "invalid"},
{0x3C400000000ULL, 0x3C600000000ULL, MappingDesc::ORIGIN,  "origin-5"},
{0x3C600000000ULL, 0x3F000000000ULL, MappingDesc::INVALID, "invalid"},
{0x3F000000000ULL, 0x40000000000ULL, MappingDesc::APP,     "app-4 (42)"},

Diff Detail

Event Timeline

zatrazz updated this revision to Diff 37613.Oct 16 2015, 11:01 AM
zatrazz retitled this revision from to [sanitizer] [msan] Unify aarch64 mapping.
zatrazz updated this object.
zatrazz added reviewers: pcc, rengolin, eugenis, kcc, samsonov.
zatrazz added a subscriber: llvm-commits.
zatrazz updated this revision to Diff 38257.Oct 23 2015, 1:23 PM

This updates uses a different strategy, similar to the one for x86_64 new mappings. The idea is to use XOR instead and by creating multiple segments for 42-bits to increase VMA available for program use. The compiler-rt patch [1] has the information regarding the new mapping segments.

[1] http://reviews.llvm.org/D13818

eugenis accepted this revision.Oct 26 2015, 2:18 PM
eugenis edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 26 2015, 2:18 PM
zatrazz closed this revision.Oct 29 2015, 6:06 AM