summaryrefslogtreecommitdiff
path: root/src/sim/system.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/system.cc')
-rw-r--r--src/sim/system.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc
index 09be232a7..9315882b7 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -53,6 +53,10 @@
#include "base/loader/symtab.hh"
#include "base/str.hh"
#include "base/trace.hh"
+#include "config/use_kvm.hh"
+#if USE_KVM
+#include "cpu/kvm/vm.hh"
+#endif
#include "cpu/thread_context.hh"
#include "debug/Loader.hh"
#include "debug/WorkItems.hh"
@@ -90,6 +94,11 @@ System::System(Params *p)
kernel(nullptr),
loadAddrMask(p->load_addr_mask),
loadAddrOffset(p->load_offset),
+#if USE_KVM
+ kvmVM(p->kvm_vm),
+#else
+ kvmVM(nullptr),
+#endif
physmem(name() + ".physmem", p->memories, p->mmap_using_noreserve),
memoryMode(p->mem_mode),
_cacheLineSize(p->cache_line_size),
@@ -104,6 +113,12 @@ System::System(Params *p)
// add self to global system list
systemList.push_back(this);
+#if USE_KVM
+ if (kvmVM) {
+ kvmVM->setSystem(this);
+ }
+#endif
+
if (FullSystem) {
kernelSymtab = new SymbolTable;
if (!debugSymbolTable)