summaryrefslogtreecommitdiff
path: root/src/cpu/kvm/base.cc
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas@sandberg.pp.se>2013-06-11 09:24:55 +0200
committerAndreas Sandberg <andreas@sandberg.pp.se>2013-06-11 09:24:55 +0200
commitc97a99110b8beafcf557636688e81861157a8c1e (patch)
treefc68cc805f2d62bf79ce901cc5298d40b099cac3 /src/cpu/kvm/base.cc
parent4f002930bc03125b9b886233985993291f5a4730 (diff)
downloadgem5-c97a99110b8beafcf557636688e81861157a8c1e.tar.xz
kvm: Separate host frequency from simulated CPU frequency
We used to use the KVM CPU's clock to specify the host frequency. This was not ideal for several reasons. One of them being that the clock parameter of a CPU determines the frequency of some of the components connected to the CPU. This changeset adds a separate hostFreq parameter that should be used to specify the host frequency until we add code to autodetect it. The hostFactor should still be used to specify the conversion factor between the host performance and that of the simulated system.
Diffstat (limited to 'src/cpu/kvm/base.cc')
-rw-r--r--src/cpu/kvm/base.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cpu/kvm/base.cc b/src/cpu/kvm/base.cc
index 3bfe44cf4..539790e52 100644
--- a/src/cpu/kvm/base.cc
+++ b/src/cpu/kvm/base.cc
@@ -83,6 +83,7 @@ BaseKvmCPU::BaseKvmCPU(BaseKvmCPUParams *params)
pageSize(sysconf(_SC_PAGE_SIZE)),
tickEvent(*this),
perfControlledByTimer(params->usePerfOverflow),
+ hostFreq(params->hostFreq),
hostFactor(params->hostFactor),
drainManager(NULL),
ctrInsts(0)
@@ -103,11 +104,11 @@ BaseKvmCPU::BaseKvmCPU(BaseKvmCPUParams *params)
runTimer.reset(new PerfKvmTimer(hwCycles,
KVM_TIMER_SIGNAL,
params->hostFactor,
- params->clock));
+ params->hostFreq));
else
runTimer.reset(new PosixKvmTimer(KVM_TIMER_SIGNAL, CLOCK_MONOTONIC,
params->hostFactor,
- params->clock));
+ params->hostFreq));
}
BaseKvmCPU::~BaseKvmCPU()
@@ -410,8 +411,7 @@ BaseKvmCPU::activateContext(ThreadID thread_num, Cycles delay)
assert(_status == Idle);
assert(!tickEvent.scheduled());
- numCycles += ticksToCycles(thread->lastActivate - thread->lastSuspend)
- * hostFactor;
+ numCycles += ticksToCycles(thread->lastActivate - thread->lastSuspend);
schedule(tickEvent, clockEdge(delay));
_status = Running;