summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorAlexandru Dutu <alexandru.dutu@amd.com>2014-11-23 18:01:08 -0800
committerAlexandru Dutu <alexandru.dutu@amd.com>2014-11-23 18:01:08 -0800
commitadbaa4dfde96d5aaf84adf0ae4989ef880aad726 (patch)
treed0f597266fc27c9b7bfa36312fee1de1fea6c450 /src/cpu
parent335514dfdc63c6f8e34cc172e2582ceca548a07c (diff)
downloadgem5-adbaa4dfde96d5aaf84adf0ae4989ef880aad726.tar.xz
kvm, x86: Adding support for SE mode execution
This patch adds methods in KvmCPU model to handle KVM exits caused by syscall instructions and page faults. These types of exits will be encountered if KvmCPU is run in SE mode.
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/kvm/base.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cpu/kvm/base.cc b/src/cpu/kvm/base.cc
index ef9e8bb31..95d91467e 100644
--- a/src/cpu/kvm/base.cc
+++ b/src/cpu/kvm/base.cc
@@ -85,8 +85,14 @@ BaseKvmCPU::BaseKvmCPU(BaseKvmCPUParams *params)
panic("KVM: Failed to determine host page size (%i)\n",
errno);
- thread = new SimpleThread(this, 0, params->system,
- params->itb, params->dtb, params->isa[0]);
+ if (FullSystem)
+ thread = new SimpleThread(this, 0, params->system, params->itb, params->dtb,
+ params->isa[0]);
+ else
+ thread = new SimpleThread(this, /* thread_num */ 0, params->system,
+ params->workload[0], params->itb,
+ params->dtb, params->isa[0]);
+
thread->setStatus(ThreadContext::Halted);
tc = thread->getTC();
threadContexts.push_back(tc);
@@ -458,7 +464,7 @@ BaseKvmCPU::suspendContext(ThreadID thread_num)
if (_status == Idle)
return;
- assert(_status == Running);
+ assert(_status == Running || _status == RunningServiceCompletion);
// The tick event may no be scheduled if the quest has requested
// the monitor to wait for interrupts. The normal CPU models can
@@ -1011,6 +1017,7 @@ BaseKvmCPU::doMMIOAccess(Addr paddr, void *data, int size, bool write)
const Cycles ipr_delay(write ?
TheISA::handleIprWrite(tc, &pkt) :
TheISA::handleIprRead(tc, &pkt));
+ threadContextDirty = true;
return clockPeriod() * ipr_delay;
} else {
// Temporarily lock and migrate to the event queue of the