[PATCH] D13817: [sanitizer] [msan] Unify aarch64 mapping

Adhemerval Zanella via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 23 13:23:42 PDT 2015


zatrazz updated this revision to Diff 38257.
zatrazz added a comment.

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


http://reviews.llvm.org/D13817

Files:
  lib/Transforms/Instrumentation/MemorySanitizer.cpp

Index: lib/Transforms/Instrumentation/MemorySanitizer.cpp
===================================================================
--- lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -120,16 +120,6 @@
 
 #define DEBUG_TYPE "msan"
 
-// VMA size definition for architecture that support multiple sizes.
-// AArch64 has 3 VMA sizes: 39, 42 and 48.
-#ifndef SANITIZER_AARCH64_VMA
-# define SANITIZER_AARCH64_VMA 39
-#else
-# if SANITIZER_AARCH64_VMA != 39 && SANITIZER_AARCH64_VMA != 42
-#  error "invalid SANITIZER_AARCH64_VMA size"
-# endif
-#endif
-
 static const unsigned kOriginSize = 4;
 static const unsigned kMinOriginAlignment = 4;
 static const unsigned kShadowTLSAlignment = 8;
@@ -263,17 +253,10 @@
 
 // aarch64 Linux
 static const MemoryMapParams Linux_AArch64_MemoryMapParams = {
-#if SANITIZER_AARCH64_VMA == 39
-  0x007C00000000,  // AndMask
-  0x000100000000,  // XorMask
-  0x004000000000,  // ShadowBase
-  0x004300000000,  // OriginBase
-#elif SANITIZER_AARCH64_VMA == 42
-  0x03E000000000,  // AndMask
-  0x001000000000,  // XorMask
-  0x010000000000,  // ShadowBase
-  0x012000000000,  // OriginBase
-#endif
+  0,               // AndMask (not used)
+  0x06000000000,   // XorMask
+  0,               // ShadowBase (not used)
+  0x01000000000,   // OriginBase
 };
 
 // i386 FreeBSD


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13817.38257.patch
Type: text/x-patch
Size: 1359 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151023/21a49b54/attachment.bin>


More information about the llvm-commits mailing list