Skip to content

Conversation

@efriedma-quic
Copy link
Collaborator

This is leveraging work which has already been done for Android, which ships 39-bit VA kernels, and extending it to other embedded Linux targets.

(Marking draft while we complete internal testing.)

This is leveraging work which has already been done for Android, which
ships 39-bit VA kernels, and extending it to other embedded Linux
targets.
@github-actions
Copy link

github-actions bot commented Nov 7, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions h -- compiler-rt/lib/asan/asan_allocator.h compiler-rt/lib/hwasan/hwasan_allocator.h --diff_from_common_commit

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from clang-format here.
diff --git a/compiler-rt/lib/asan/asan_allocator.h b/compiler-rt/lib/asan/asan_allocator.h
index e2ec87769..779813724 100644
--- a/compiler-rt/lib/asan/asan_allocator.h
+++ b/compiler-rt/lib/asan/asan_allocator.h
@@ -200,7 +200,8 @@ const uptr kAllocatorSpace = ~(uptr)0;
 #    if defined(__powerpc64__)
 const uptr kAllocatorSize  =  0x20000000000ULL;  // 2T.
 typedef DefaultSizeClassMap SizeClassMap;
-#    elif defined(__aarch64__) && (SANITIZER_ANDROID || defined(SANITIZER_AARCH64_39BIT_VA))
+#    elif defined(__aarch64__) && \
+        (SANITIZER_ANDROID || defined(SANITIZER_AARCH64_39BIT_VA))
 // Android needs to support 39, 42 and 48 bit VMA.
 const uptr kAllocatorSize  =  0x2000000000ULL;  // 128G.
 typedef VeryCompactSizeClassMap SizeClassMap;
diff --git a/compiler-rt/lib/hwasan/hwasan_allocator.h b/compiler-rt/lib/hwasan/hwasan_allocator.h
index 94fd7b2f7..b539e446a 100644
--- a/compiler-rt/lib/hwasan/hwasan_allocator.h
+++ b/compiler-rt/lib/hwasan/hwasan_allocator.h
@@ -74,7 +74,8 @@ struct AP64 {
 #if defined(HWASAN_ALIASING_MODE)
   static const uptr kSpaceSize = 1ULL << kAddressTagShift;
   typedef __sanitizer::DefaultSizeClassMap SizeClassMap;
-#elif SANITIZER_LINUX && !SANITIZER_ANDROID && !defined(SANITIZER_AARCH64_39BIT_VA)
+#elif SANITIZER_LINUX && !SANITIZER_ANDROID && \
+    !defined(SANITIZER_AARCH64_39BIT_VA)
   static const uptr kSpaceSize = 0x40000000000ULL;  // 4T.
   typedef __sanitizer::DefaultSizeClassMap SizeClassMap;
 #else

@thurstond
Copy link
Contributor

Thanks for this patch!

Even though it's a small patch, please split it into three parts (compiler-rt, asan, hwasan). e.g., if you implement 39-bit VMA AArch64 support for MSan, it's strange to need a "[asan][hwasan]" patch as a prerequisite. Smaller patches are also easier to debug (e.g., for the HWASan-only patch, we can rule out its impact on any ASan buildbot breakage).

@efriedma-quic
Copy link
Collaborator Author

I can see two patches... not sure about three: the change to compiler-rt/CMakeLists.txt is a no-op on its own.

@thurstond
Copy link
Contributor

I can see two patches... not sure about three: the change to compiler-rt/CMakeLists.txt is a no-op on its own.

It's good to split off NFC portions of patches.

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

Successfully merging this pull request may close these issues.

2 participants