[clang] [TSAN] add support for riscv64 (PR #68735)

2023-10-12 Thread Alex Fan via cfe-commits

https://github.com/alexfanqi approved this pull request.


https://github.com/llvm/llvm-project/pull/68735
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [TSAN] add support for riscv64 (PR #68735)

2023-10-11 Thread Alex Fan via cfe-commits

https://github.com/alexfanqi requested changes to this pull request.

I missed a little piece for sv48 here
```
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
@@ -303,7 +303,7 @@
 #define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 
40)
 #  endif
 #elif SANITIZER_RISCV64
-#  define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 38)
+#  define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 47)
 #elif defined(__aarch64__)
 #  if SANITIZER_APPLE
 #if SANITIZER_OSX || SANITIZER_IOSSIM
```

https://github.com/llvm/llvm-project/pull/68735
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [TSAN] add support for riscv64 (PR #68735)

2023-10-11 Thread Alex Fan via cfe-commits

alexfanqi wrote:

Sorry. It took some time to reply. Since newer linux kernel supports sv57 and 
sv48, I tested this again with latest qemu and 6.6 kernel, by passing `-cpu 
rv64,sv48=on` to qemu.

I missed a little piece here for sv48,

Also to note, if we want to support sv57, we could directly copy the aarch64_48 
scheme and append 8 bits to its addresses. That gives the maximum application 
space, a horrific ~2^24 tera byte.

I asked @hiraditya to land for me. Thanks for the help to drive the reland.

https://github.com/llvm/llvm-project/pull/68735
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits