Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HWSan on AARCH64 depends on the page size #1446

Open
apinski-cavium opened this issue Sep 19, 2021 · 2 comments
Open

HWSan on AARCH64 depends on the page size #1446

apinski-cavium opened this issue Sep 19, 2021 · 2 comments

Comments

@apinski-cavium
Copy link

apinski-cavium commented Sep 19, 2021

From https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102144:
The RingBufferSize inside hwasan/hwasan_thread_list.h depends on the page size being 4k. This does not work with 64k pages and most likely won't work with 16k pages too.
This patch works for me with 64k page size but it really really be using the pagesize rather than a hard coded #:


diff --git a/libsanitizer/hwasan/hwasan_thread_list.h b/libsanitizer/hwasan/hwasan_thread_list.h
index 15916a802d6..c13c5910b95 100644
--- a/libsanitizer/hwasan/hwasan_thread_list.h
+++ b/libsanitizer/hwasan/hwasan_thread_list.h
@@ -57,7 +57,7 @@ static uptr RingBufferSize() {
   // 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) {
-    uptr size = 4096 * (1ULL << shift);
+    uptr size = (64*4096) * (1ULL << shift);
     if (size >= desired_bytes)
       return size;
   }
@eugenis
Copy link
Contributor

eugenis commented Sep 20, 2021 via email

@pinskia
Copy link

pinskia commented Nov 21, 2023

So this was fixed now via
llvm/llvm-project@1293e93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants