diff options
author | Brandon Potter <brandon.potter@amd.com> | 2016-03-17 10:30:33 -0700 |
---|---|---|
committer | Brandon Potter <brandon.potter@amd.com> | 2016-03-17 10:30:33 -0700 |
commit | dbad391a9b4e861fd3d660069ed448db85144e17 (patch) | |
tree | 97f2e36d8d2356fc68a317e1292727a040688d5e | |
parent | f6cd7a4bb7ee66b58f88fbdc6bdc4faa6a559952 (diff) | |
download | gem5-dbad391a9b4e861fd3d660069ed448db85144e17.tar.xz |
syscall_emul: update x86 mmap base address
-rw-r--r-- | src/arch/x86/process.cc | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc index f0b8370c0..d2ce4dbd1 100644 --- a/src/arch/x86/process.cc +++ b/src/arch/x86/process.cc @@ -112,9 +112,15 @@ X86_64LiveProcess::X86_64LiveProcess(LiveProcessParams *params, // Set pointer for next thread stack. Reserve 8M for main stack. next_thread_stack_base = stack_base - (8 * 1024 * 1024); - // Set up region for mmaps. This was determined empirically and may not - // always be correct. - mmap_end = (Addr)0x2aaaaaaab000ULL; + // "mmap_base" is a function which defines where mmap region starts in + // the process address space. + // mmap_base: PAGE_ALIGN(TASK_SIZE-MIN_GAP-mmap_rnd()) + // TASK_SIZE: (1<<47)-PAGE_SIZE + // MIN_GAP: 128*1024*1024+stack_maxrandom_size() + // We do not use any address space layout randomization in gem5 + // therefore the random fields become zero; the smallest gap space was + // chosen but gap could potentially be much larger. + mmap_end = (Addr)0x7FFFF7FFF000ULL; } void @@ -149,9 +155,15 @@ I386LiveProcess::I386LiveProcess(LiveProcessParams *params, // Set pointer for next thread stack. Reserve 8M for main stack. next_thread_stack_base = stack_base - (8 * 1024 * 1024); - // Set up region for mmaps. This was determined empirically and may not - // always be correct. - mmap_end = (Addr)0xf7ffe000ULL; + // "mmap_base" is a function which defines where mmap region starts in + // the process address space. + // mmap_base: PAGE_ALIGN(TASK_SIZE-MIN_GAP-mmap_rnd()) + // TASK_SIZE: 0xC0000000 + // MIN_GAP: 128*1024*1024+stack_maxrandom_size() + // We do not use any address space layout randomization in gem5 + // therefore the random fields become zero; the smallest gap space was + // chosen but gap could potentially be much larger. + mmap_end = (Addr)0xB7FFF000ULL; } SyscallDesc* |