summaryrefslogtreecommitdiff
path: root/src/mem/physical.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-05-30 12:53:54 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2013-05-30 12:53:54 -0400
commit88aa7755f4f4ebd39a26fbece9c0d09cd195a010 (patch)
treeff24a9bb88a3cf810f3ffd40927290833879bdaa /src/mem/physical.cc
parentcc8911261e11d67f2b8745289ed5ecbb89c9d917 (diff)
downloadgem5-88aa7755f4f4ebd39a26fbece9c0d09cd195a010.tar.xz
mem: Avoid explicitly zeroing the memory backing store
This patch removes the explicit memset as it is redundant and causes the simulator to touch the entire space, forcing the host system to allocate the pages. Anonymous pages are mapped on the first access, and the page-fault handler is responsible for zeroing them. Thus, the pages are still zeroed, but we avoid touching the entire allocated space which enables us to use much larger memory sizes as long as not all the memory is actually used.
Diffstat (limited to 'src/mem/physical.cc')
-rw-r--r--src/mem/physical.cc17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/mem/physical.cc b/src/mem/physical.cc
index 4b7001eb5..10176bba0 100644
--- a/src/mem/physical.cc
+++ b/src/mem/physical.cc
@@ -162,10 +162,6 @@ PhysicalMemory::createBackingStore(AddrRange range,
// it appropriately
backingStore.push_back(make_pair(range, pmem));
- // count how many of the memories are to be zero initialized so we
- // can see if some but not all have this parameter set
- uint32_t init_to_zero = 0;
-
// point the memories to their backing store, and if requested,
// initialize the memory range to 0
for (vector<AbstractMemory*>::const_iterator m = _memories.begin();
@@ -173,19 +169,6 @@ PhysicalMemory::createBackingStore(AddrRange range,
DPRINTF(BusAddrRanges, "Mapping memory %s to backing store\n",
(*m)->name());
(*m)->setBackingStore(pmem);
-
- // if it should be zero, then go and make it so
- if ((*m)->initToZero()) {
- ++init_to_zero;
- }
- }
-
- if (init_to_zero != 0) {
- if (init_to_zero != _memories.size())
- fatal("Some, but not all memories in range %s are set zero\n",
- range.to_string());
-
- memset(pmem, 0, range.size());
}
}