From 9baa35ba802f2cfb9fb9ecdebf111f4cd793a428 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Mon, 15 Oct 2012 08:12:32 -0400 Subject: Mem: Separate the host and guest views of memory backing store This patch moves all the memory backing store operations from the independent memory controllers to the global physical memory. The main reason for this patch is to allow address striping in a future set of patches, but at this point it already provides some useful functionality in that it is now possible to change the number of memory controllers and their address mapping in combination with checkpointing. Thus, the host and guest view of the memory backing store are now completely separate. With this patch, the individual memory controllers are far simpler as all responsibility for serializing/unserializing is moved to the physical memory. Currently, the functionality is more or less moved from AbstractMemory to PhysicalMemory without any major changes. However, in a future patch the physical memory will also resolve any ranges that are interleaved and properly assign the backing store to the memory controllers, and keep the host memory as a single contigous chunk per address range. Functionality for future extensions which involve CPU virtualization also enable the host to get pointers to the backing store. --- src/sim/system.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/sim/system.cc') diff --git a/src/sim/system.cc b/src/sim/system.cc index 65eb0e3eb..dae09b85a 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -58,6 +58,7 @@ #include "debug/Loader.hh" #include "debug/WorkItems.hh" #include "kern/kernel_stats.hh" +#include "mem/abstract_mem.hh" #include "mem/physical.hh" #include "params/System.hh" #include "sim/byteswap.hh" @@ -81,7 +82,7 @@ System::System(Params *p) virtProxy(_systemPort), loadAddrMask(p->load_addr_mask), nextPID(0), - physmem(p->memories), + physmem(name() + ".physmem", p->memories), memoryMode(p->mem_mode), workItemsBegin(0), workItemsEnd(0), @@ -342,6 +343,10 @@ System::serialize(ostream &os) SERIALIZE_SCALAR(pagePtr); SERIALIZE_SCALAR(nextPID); serializeSymtab(os); + + // also serialize the memories in the system + nameOut(os, csprintf("%s.physmem", name())); + physmem.serialize(os); } @@ -353,6 +358,9 @@ System::unserialize(Checkpoint *cp, const string §ion) UNSERIALIZE_SCALAR(pagePtr); UNSERIALIZE_SCALAR(nextPID); unserializeSymtab(cp, section); + + // also unserialize the memories in the system + physmem.unserialize(cp, csprintf("%s.physmem", name())); } void -- cgit v1.2.3