[compiler-rt] beded9b - [HWASan] Allow stack_history_size of 4096 (#86362)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 4 12:28:14 PDT 2024
Author: Florian Mayer
Date: 2024-04-04T12:28:10-07:00
New Revision: beded9b9ceab19f81320c7cf5e3600a7745c8f05
URL: https://github.com/llvm/llvm-project/commit/beded9b9ceab19f81320c7cf5e3600a7745c8f05
DIFF: https://github.com/llvm/llvm-project/commit/beded9b9ceab19f81320c7cf5e3600a7745c8f05.diff
LOG: [HWASan] Allow stack_history_size of 4096 (#86362)
There is no reason to limit the minimum to two pages.
Added:
Modified:
compiler-rt/lib/hwasan/hwasan_thread_list.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/hwasan/hwasan_thread_list.h b/compiler-rt/lib/hwasan/hwasan_thread_list.h
index d0eebd1b373a37..f36d27864fc207 100644
--- a/compiler-rt/lib/hwasan/hwasan_thread_list.h
+++ b/compiler-rt/lib/hwasan/hwasan_thread_list.h
@@ -18,7 +18,7 @@
// * Start of the shadow memory region is aligned to 2**kShadowBaseAlignment.
// * All stack ring buffers are located within (2**kShadowBaseAlignment)
// sized region below and adjacent to the shadow region.
-// * Each ring buffer has a size of (2**N)*4096 where N is in [0, 8), and is
+// * Each ring buffer has a size of (2**N)*4096 where N is in [0, 7), and is
// aligned to twice its size. The value of N can be
diff erent for each buffer.
//
// These constrains guarantee that, given an address A of any element of the
@@ -55,7 +55,7 @@ static uptr RingBufferSize() {
uptr desired_bytes = flags()->stack_history_size * sizeof(uptr);
// FIXME: increase the limit to 8 once this bug is fixed:
// https://bugs.llvm.org/show_bug.cgi?id=39030
- for (int shift = 1; shift < 7; ++shift) {
+ for (int shift = 0; shift < 7; ++shift) {
uptr size = 4096 * (1ULL << shift);
if (size >= desired_bytes)
return size;
More information about the llvm-commits
mailing list