[PATCH] D19652: [compiler-rt] [ASan] Add shadow offset for SystemZ.

Marcin Koƛcielnicki via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 30 03:08:03 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL268162: [ASan] Add shadow offset for SystemZ. (authored by koriakin).

Changed prior to commit:
  http://reviews.llvm.org/D19652?vs=55402&id=55711#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19652

Files:
  compiler-rt/trunk/lib/asan/asan_mapping.h
  compiler-rt/trunk/lib/asan/tests/asan_test.cc
  compiler-rt/trunk/test/asan/CMakeLists.txt

Index: compiler-rt/trunk/lib/asan/asan_mapping.h
===================================================================
--- compiler-rt/trunk/lib/asan/asan_mapping.h
+++ compiler-rt/trunk/lib/asan/asan_mapping.h
@@ -87,6 +87,20 @@
 // || `[0x08000000000, 0x08fffffffff]` || lowshadow  ||
 // || `[0x00000000000, 0x07fffffffff]` || lowmem     ||
 //
+// Default Linux/S390 mapping:
+// || `[0x30000000, 0x7fffffff]` || HighMem    ||
+// || `[0x26000000, 0x2fffffff]` || HighShadow ||
+// || `[0x24000000, 0x25ffffff]` || ShadowGap  ||
+// || `[0x20000000, 0x23ffffff]` || LowShadow  ||
+// || `[0x00000000, 0x1fffffff]` || LowMem     ||
+//
+// Default Linux/SystemZ mapping:
+// || `[0x14000000000000, 0x1fffffffffffff]` || HighMem    ||
+// || `[0x12800000000000, 0x13ffffffffffff]` || HighShadow ||
+// || `[0x12000000000000, 0x127fffffffffff]` || ShadowGap  ||
+// || `[0x10000000000000, 0x11ffffffffffff]` || LowShadow  ||
+// || `[0x00000000000000, 0x0fffffffffffff]` || LowMem     ||
+//
 // Shadow mapping on FreeBSD/x86-64 with SHADOW_OFFSET == 0x400000000000:
 // || `[0x500000000000, 0x7fffffffffff]` || HighMem    ||
 // || `[0x4a0000000000, 0x4fffffffffff]` || HighShadow ||
@@ -122,6 +136,7 @@
 static const u64 kMIPS32_ShadowOffset32 = 0x0aaa0000;
 static const u64 kMIPS64_ShadowOffset64 = 1ULL << 37;
 static const u64 kPPC64_ShadowOffset64 = 1ULL << 41;
+static const u64 kSystemZ_ShadowOffset64 = 1ULL << 52;
 static const u64 kFreeBSD_ShadowOffset32 = 1ULL << 30;  // 0x40000000
 static const u64 kFreeBSD_ShadowOffset64 = 1ULL << 46;  // 0x400000000000
 static const u64 kWindowsShadowOffset32 = 3ULL << 28;  // 0x30000000
@@ -158,6 +173,8 @@
 #    define SHADOW_OFFSET kAArch64_ShadowOffset64
 #  elif defined(__powerpc64__)
 #    define SHADOW_OFFSET kPPC64_ShadowOffset64
+#  elif defined(__s390x__)
+#    define SHADOW_OFFSET kSystemZ_ShadowOffset64
 #  elif SANITIZER_FREEBSD
 #    define SHADOW_OFFSET kFreeBSD_ShadowOffset64
 #  elif SANITIZER_MAC
Index: compiler-rt/trunk/lib/asan/tests/asan_test.cc
===================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test.cc
+++ compiler-rt/trunk/lib/asan/tests/asan_test.cc
@@ -937,6 +937,8 @@
 #else
 # if defined(__powerpc64__)
   char *addr = (char*)0x024000800000;
+# elif defined(__s390x__)
+  char *addr = (char*)0x11000000000000;
 # else
   char *addr = (char*)0x0000100000080000;
 # endif
Index: compiler-rt/trunk/test/asan/CMakeLists.txt
===================================================================
--- compiler-rt/trunk/test/asan/CMakeLists.txt
+++ compiler-rt/trunk/test/asan/CMakeLists.txt
@@ -6,7 +6,7 @@
 macro(get_bits_for_arch arch bits)
   if (${arch} MATCHES "i386|i686|arm|mips|mipsel")
     set(${bits} 32)
-  elseif (${arch} MATCHES "x86_64|powerpc64|powerpc64le|aarch64|mips64|mips64el")
+  elseif (${arch} MATCHES "x86_64|powerpc64|powerpc64le|aarch64|mips64|mips64el|s390x")
     set(${bits} 64)
   else()
     message(FATAL_ERROR "Unknown target architecture: ${arch}")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19652.55711.patch
Type: text/x-patch
Size: 3021 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160430/261a83cc/attachment.bin>


More information about the llvm-commits mailing list