summaryrefslogtreecommitdiff
path: root/src/cpu/kvm/x86_cpu.cc
diff options
context:
space:
mode:
authorMichael LeBeane <michael.lebeane@amd.com>2016-09-13 23:20:03 -0400
committerMichael LeBeane <michael.lebeane@amd.com>2016-09-13 23:20:03 -0400
commit443da2c030c0ad5b22f86a471ae757cbbd491bc1 (patch)
tree5eba8c9e5382a721e4449fcefb4d3b8635c7f623 /src/cpu/kvm/x86_cpu.cc
parent2c43a21687b861bae462bea555c5875a4d0a91c8 (diff)
downloadgem5-443da2c030c0ad5b22f86a471ae757cbbd491bc1.tar.xz
kvm: Support timing accesses for KVM cpu
This patch enables timing accesses for KVM cpu. A new state, RunningMMIOPending, is added to indicate that there are outstanding timing requests generated by KVM in the system. KVM's tick() is disabled and the simulation does not enter into KVM until all outstanding timing requests have completed. The main motivation for this is to allow KVM CPU to perform MMIO in Ruby, since Ruby does not support atomic accesses.
Diffstat (limited to 'src/cpu/kvm/x86_cpu.cc')
-rw-r--r--src/cpu/kvm/x86_cpu.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cpu/kvm/x86_cpu.cc b/src/cpu/kvm/x86_cpu.cc
index 9e9115ef5..f8f66af2f 100644
--- a/src/cpu/kvm/x86_cpu.cc
+++ b/src/cpu/kvm/x86_cpu.cc
@@ -1344,20 +1344,20 @@ X86KvmCPU::handleKvmExitIO()
pAddr = X86ISA::x86IOAddress(port);
}
- Request io_req(pAddr, kvm_run.io.size, Request::UNCACHEABLE,
- dataMasterId());
- io_req.setContext(tc->contextId());
-
const MemCmd cmd(isWrite ? MemCmd::WriteReq : MemCmd::ReadReq);
// Temporarily lock and migrate to the event queue of the
// VM. This queue is assumed to "own" all devices we need to
// access if running in multi-core mode.
EventQueue::ScopedMigration migrate(vm.eventQueue());
for (int i = 0; i < count; ++i) {
- Packet pkt(&io_req, cmd);
+ RequestPtr io_req = new Request(pAddr, kvm_run.io.size,
+ Request::UNCACHEABLE, dataMasterId());
+ io_req->setContext(tc->contextId());
+
+ PacketPtr pkt = new Packet(io_req, cmd);
- pkt.dataStatic(guestData);
- delay += dataPort.sendAtomic(&pkt);
+ pkt->dataStatic(guestData);
+ delay += dataPort.submitIO(pkt);
guestData += kvm_run.io.size;
}