[compiler-rt] r317638 - (NFC) Rename GetMax{,User}VirtualAddress.
Evgeniy Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 7 15:51:22 PST 2017
Author: eugenis
Date: Tue Nov 7 15:51:22 2017
New Revision: 317638
URL: http://llvm.org/viewvc/llvm-project?rev=317638&view=rev
Log:
(NFC) Rename GetMax{,User}VirtualAddress.
Future change will introduce GetMaxVirtualAddress that will not take
the kernel area into account.
Modified:
compiler-rt/trunk/lib/asan/asan_fuchsia.cc
compiler-rt/trunk/lib/asan/asan_rtl.cc
compiler-rt/trunk/lib/cfi/cfi.cc
compiler-rt/trunk/lib/msan/msan_linux.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
compiler-rt/trunk/lib/sanitizer_common/sanitizer_fuchsia.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac_libcdep.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
compiler-rt/trunk/lib/tsan/rtl/tsan_platform_mac.cc
Modified: compiler-rt/trunk/lib/asan/asan_fuchsia.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_fuchsia.cc?rev=317638&r1=317637&r2=317638&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_fuchsia.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_fuchsia.cc Tue Nov 7 15:51:22 2017
@@ -28,7 +28,7 @@
namespace __asan {
// The system already set up the shadow memory for us.
-// __sanitizer::GetMaxVirtualAddress has already been called by
+// __sanitizer::GetMaxUserVirtualAddress has already been called by
// AsanInitInternal->InitializeHighMemEnd (asan_rtl.cc).
// Just do some additional sanity checks here.
void InitializeShadowMemory() {
Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=317638&r1=317637&r2=317638&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Tue Nov 7 15:51:22 2017
@@ -307,7 +307,7 @@ static void asan_atexit() {
static void InitializeHighMemEnd() {
#if !ASAN_FIXED_MAPPING
- kHighMemEnd = GetMaxVirtualAddress();
+ kHighMemEnd = GetMaxUserVirtualAddress();
// Increase kHighMemEnd to make sure it's properly
// aligned together with kHighMemBeg:
kHighMemEnd |= SHADOW_GRANULARITY * GetMmapGranularity() - 1;
Modified: compiler-rt/trunk/lib/cfi/cfi.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/cfi/cfi.cc?rev=317638&r1=317637&r2=317638&view=diff
==============================================================================
--- compiler-rt/trunk/lib/cfi/cfi.cc (original)
+++ compiler-rt/trunk/lib/cfi/cfi.cc Tue Nov 7 15:51:22 2017
@@ -280,7 +280,7 @@ void InitShadow() {
CHECK_EQ(0, GetShadow());
CHECK_EQ(0, GetShadowSize());
- uptr vma = GetMaxVirtualAddress();
+ uptr vma = GetMaxUserVirtualAddress();
// Shadow is 2 -> 2**kShadowGranularity.
SetShadowSize((vma >> (kShadowGranularity - 1)) + 1);
VReport(1, "CFI: VMA size %zx, shadow size %zx\n", vma, GetShadowSize());
Modified: compiler-rt/trunk/lib/msan/msan_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_linux.cc?rev=317638&r1=317637&r2=317638&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_linux.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_linux.cc Tue Nov 7 15:51:22 2017
@@ -120,7 +120,7 @@ bool InitShadow(bool init_origins) {
return false;
}
- const uptr maxVirtualAddress = GetMaxVirtualAddress();
+ const uptr maxVirtualAddress = GetMaxUserVirtualAddress();
for (unsigned i = 0; i < kMemoryLayoutSize; ++i) {
uptr start = kMemoryLayout[i].start;
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h?rev=317638&r1=317637&r2=317638&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h Tue Nov 7 15:51:22 2017
@@ -73,7 +73,7 @@ INLINE uptr GetPageSizeCached() {
return PageSizeCached;
}
uptr GetMmapGranularity();
-uptr GetMaxVirtualAddress();
+uptr GetMaxUserVirtualAddress();
// Threads
tid_t GetTid();
uptr GetThreadSelf();
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_fuchsia.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_fuchsia.cc?rev=317638&r1=317637&r2=317638&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_fuchsia.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_fuchsia.cc Tue Nov 7 15:51:22 2017
@@ -186,7 +186,7 @@ uptr GetMmapGranularity() { return PAGE_
sanitizer_shadow_bounds_t ShadowBounds;
-uptr GetMaxVirtualAddress() {
+uptr GetMaxUserVirtualAddress() {
ShadowBounds = __sanitizer_shadow_bounds();
return ShadowBounds.memory_limit - 1;
}
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=317638&r1=317637&r2=317638&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Tue Nov 7 15:51:22 2017
@@ -952,7 +952,7 @@ static uptr GetKernelAreaSize() {
}
#endif // SANITIZER_WORDSIZE == 32
-uptr GetMaxVirtualAddress() {
+uptr GetMaxUserVirtualAddress() {
#if SANITIZER_NETBSD && defined(__x86_64__)
return 0x7f7ffffff000ULL; // (0x00007f8000000000 - PAGE_SIZE)
#elif SANITIZER_WORDSIZE == 64
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc?rev=317638&r1=317637&r2=317638&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc Tue Nov 7 15:51:22 2017
@@ -849,7 +849,7 @@ uptr GetTaskInfoMaxAddress() {
}
#endif
-uptr GetMaxVirtualAddress() {
+uptr GetMaxUserVirtualAddress() {
#if SANITIZER_WORDSIZE == 64
# if defined(__aarch64__) && SANITIZER_IOS && !SANITIZER_IOSSIM
// Get the maximum VM address
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac_libcdep.cc?rev=317638&r1=317637&r2=317638&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac_libcdep.cc Tue Nov 7 15:51:22 2017
@@ -20,7 +20,7 @@
namespace __sanitizer {
void RestrictMemoryToMaxAddress(uptr max_address) {
- uptr size_to_mmap = GetMaxVirtualAddress() + 1 - max_address;
+ uptr size_to_mmap = GetMaxUserVirtualAddress() + 1 - max_address;
void *res = MmapFixedNoAccess(max_address, size_to_mmap, "high gap");
CHECK(res != MAP_FAILED);
}
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc?rev=317638&r1=317637&r2=317638&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc Tue Nov 7 15:51:22 2017
@@ -64,7 +64,7 @@ uptr GetMmapGranularity() {
return si.dwAllocationGranularity;
}
-uptr GetMaxVirtualAddress() {
+uptr GetMaxUserVirtualAddress() {
SYSTEM_INFO si;
GetSystemInfo(&si);
return (uptr)si.lpMaximumApplicationAddress;
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_platform_mac.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_platform_mac.cc?rev=317638&r1=317637&r2=317638&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_platform_mac.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_platform_mac.cc Tue Nov 7 15:51:22 2017
@@ -231,7 +231,7 @@ static void my_pthread_introspection_hoo
void InitializePlatformEarly() {
#if defined(__aarch64__)
- uptr max_vm = GetMaxVirtualAddress() + 1;
+ uptr max_vm = GetMaxUserVirtualAddress() + 1;
if (max_vm != Mapping::kHiAppMemEnd) {
Printf("ThreadSanitizer: unsupported vm address limit %p, expected %p.\n",
max_vm, Mapping::kHiAppMemEnd);
More information about the llvm-commits
mailing list