summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2015-01-21 02:11:05 +0000
committerKostya Serebryany <kcc@google.com>2015-01-21 02:11:05 +0000
commit82b58712c119a2d0ab354cac0c3d80554bd3e741 (patch)
tree38738ef15066d1f28baa7d8f887cbb074f5180fb
parent896984c251b2f02646ac63f7d9a29725d967180f (diff)
downloadbcm5719-llvm-82b58712c119a2d0ab354cac0c3d80554bd3e741.tar.gz
bcm5719-llvm-82b58712c119a2d0ab354cac0c3d80554bd3e741.zip
[sanitizer] First step toward supporting 42-bit AS on aarch64
aarch64-linux kernel has configurable 39, 42 or 47 bit virtual address space. Most distros AFAIK use 42-bit VA right now, but there are also 39-bit VA users too. The ppc64 handling can be used for this just fine and support all the 3 sizes. There are other issues, like allocator32 not really being able to support the larger addres spaces, and hardcoded 39-bit address space size in other macros. Patch by Jakub Jelinek. llvm-svn: 226639
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_posix.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
index 4205c2b116b..02f80b095e9 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
@@ -78,16 +78,15 @@ static uptr GetKernelAreaSize() {
uptr GetMaxVirtualAddress() {
#if SANITIZER_WORDSIZE == 64
-# if defined(__powerpc64__)
+# if defined(__powerpc64__) || defined(__aarch64__)
// On PowerPC64 we have two different address space layouts: 44- and 46-bit.
// We somehow need to figure out which one we are using now and choose
// one of 0x00000fffffffffffUL and 0x00003fffffffffffUL.
// Note that with 'ulimit -s unlimited' the stack is moved away from the top
// of the address space, so simply checking the stack address is not enough.
// This should (does) work for both PowerPC64 Endian modes.
+ // Similarly, aarch64 has multiple address space layouts: 39, 42 and 47-bit.
return (1ULL << (MostSignificantSetBitIndex(GET_CURRENT_FRAME()) + 1)) - 1;
-# elif defined(__aarch64__)
- return (1ULL << 39) - 1;
# elif defined(__mips64)
return (1ULL << 40) - 1; // 0x000000ffffffffffUL;
# else
OpenPOWER on IntegriCloud