[PATCH] [TSan][MIPS] Adding support for MIPS64
Alexey Samsonov
vonosmas at gmail.com
Mon Dec 22 18:12:24 PST 2014
What is the status of `check-tsan` command with these changes applied?
REPOSITORY
rL LLVM
================
Comment at: lib/tsan/CMakeLists.txt:80
@@ +79,3 @@
+ foreach(arch ${TSAN_SUPPORTED_ARCH})
+ if(arch STREQUAL "x86_64")
+ set(TSAN_ASM_SOURCES rtl/tsan_rtl_amd64.S)
----------------
set TSAN_ASM_SOURCES to empty list for non-x86_64 architectures.
================
Comment at: lib/tsan/rtl/tsan_interface_atomic.cc:36
@@ -35,3 +35,3 @@
#if !defined(SANITIZER_GO) && (defined(__SIZEOF_INT128__) \
- || (__clang_major__ * 100 + __clang_minor__ >= 302))
+ && (__clang_major__ * 100 + __clang_minor__ >= 302))
__extension__ typedef __int128 a128;
----------------
This change is wrong - it won't work if you build TSan runtime with GCC. Why do you need it?
================
Comment at: lib/tsan/rtl/tsan_interface_atomic.cc:129
@@ -129,1 +128,3 @@
+#if !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16) && !defined(SANITIZER_GO) \
+ && defined(__SIZEOF_INT128__)
a128 func_xchg(volatile a128 *v, a128 op) {
----------------
Shouldn't this be related to `__TSAN_HAS_INT128` ?
================
Comment at: lib/tsan/rtl/tsan_platform.h:30
@@ -29,3 +29,3 @@
/*
C/C++ on linux and freebsd
0000 0000 1000 - 0100 0000 0000: main binary and/or MAP_32BIT mappings
----------------
Care to add a similar comment for MIPS?
================
Comment at: lib/tsan/rtl/tsan_platform_linux.cc:218
@@ +217,3 @@
+#if defined(__mips64)
+ madvise((void*)MemToShadow(0xff00000000ULL),
+ 0x100000000ULL * kShadowMultiplier, MADV_NOHUGEPAGE);
----------------
Where do these magic numbers come from? Please use a named constant for them.
================
Comment at: lib/tsan/rtl/tsan_platform_linux.cc:295
@@ +294,3 @@
+#if defined(__mips64)
+ if (p >= 0xfffff00000ull) // vdso
+#elif defined(__x86_64__)
----------------
factor this into a separate constant.
================
Comment at: lib/tsan/rtl/tsan_rtl.cc:1001
@@ -988,1 +1000,3 @@
+uptr HeapEnd() {
+#if SANITIZER_CAN_USE_ALLOCATOR64
----------------
Looks like it should be inline function in the same file where you define the memory layout.
http://reviews.llvm.org/D6291
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list