[PATCH] D13782: [sanitizer] [asan] Use same shadow offset for aarch64

Adhemerval Zanella via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 30 13:06:47 PDT 2015


zatrazz added inline comments.

================
Comment at: lib/sanitizer_common/sanitizer_platform.h:111
@@ -111,7 +110,3 @@
 #if defined(__aarch64__)
-# if SANITIZER_AARCH64_VMA == 39
-#  define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 39)
-# elif SANITIZER_AARCH64_VMA == 42
-#  define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 42)
-# endif
+# define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 42)
 #elif defined(__mips__)
----------------
zatrazz wrote:
> eugenis wrote:
> > I'm pretty sure this won't work on 48 bit VMA.
> > Could you evaluate the cost of lifting the upper limit to 48? Last time I looked, this should only affect .bss size (so, no real RAM cost), and not really that much.
> I won't, but I am also not sure if kAArch64_ShadowOffset64 = 1ULL << 36 will work correctly on 48-bit kernels. But it will check this out.
I did some analysis of the memory consumption difference about using 47 instead of 42 and the results look reasonable: with test/asan/TestCases/mmap_limit_mb.cc as base with some code to dump '/proc/self/statm' I see:


```
$ ./test_mem-{42,48} 2000 16

MMAP          42       48      Diff
Resident   21970    22110       140
          186924   187035       111
         1476712  1476841       129
```

So it seems an overhead not really dependent of total memory utilization for about 129-140 kb.


http://reviews.llvm.org/D13782





More information about the llvm-commits mailing list