(NFC) Rename GetMax{,User}VirtualAddress.

Future change will introduce GetMaxVirtualAddress that will not take
the kernel area into account.

llvm-svn: 317638
This commit is contained in:
Evgeniy Stepanov 2017-11-07 23:51:22 +00:00
parent 367ca01478
commit 0379d3f844
11 changed files with 11 additions and 11 deletions

View File

@ -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() {

View File

@ -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;

View File

@ -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());

View File

@ -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;

View File

@ -73,7 +73,7 @@ INLINE uptr GetPageSizeCached() {
return PageSizeCached;
}
uptr GetMmapGranularity();
uptr GetMaxVirtualAddress();
uptr GetMaxUserVirtualAddress();
// Threads
tid_t GetTid();
uptr GetThreadSelf();

View File

@ -186,7 +186,7 @@ uptr GetMmapGranularity() { return PAGE_SIZE; }
sanitizer_shadow_bounds_t ShadowBounds;
uptr GetMaxVirtualAddress() {
uptr GetMaxUserVirtualAddress() {
ShadowBounds = __sanitizer_shadow_bounds();
return ShadowBounds.memory_limit - 1;
}

View File

@ -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

View File

@ -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

View File

@ -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);
}

View File

@ -64,7 +64,7 @@ uptr GetMmapGranularity() {
return si.dwAllocationGranularity;
}
uptr GetMaxVirtualAddress() {
uptr GetMaxUserVirtualAddress() {
SYSTEM_INFO si;
GetSystemInfo(&si);
return (uptr)si.lpMaximumApplicationAddress;

View File

@ -231,7 +231,7 @@ static void my_pthread_introspection_hook(unsigned int event, pthread_t thread,
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);