diff options
author | Andreas Sandberg <andreas@sandberg.pp.se> | 2013-05-14 15:56:04 +0200 |
---|---|---|
committer | Andreas Sandberg <andreas@sandberg.pp.se> | 2013-05-14 15:56:04 +0200 |
commit | 98483ba858e18d1376b86fc7e871e0762bee827c (patch) | |
tree | cfb3122b8aa01cd3bac76f6432bc4469ed5ca4a1 /src/cpu | |
parent | 1ae30c68c1f5159a5e1c557ee33a33aa695d7da5 (diff) | |
download | gem5-98483ba858e18d1376b86fc7e871e0762bee827c.tar.xz |
kvm: Fix the memory interface used by KVM
The CpuPort class was removed before the KVM patches were committed,
which means that the KVM interface currently doesn't compile. This
changeset adds the BaseKvmCPU::KVMCpuPort class which derives from
MasterPort. This class is used on the data and instruction ports
instead of the old CpuPort.
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/kvm/base.hh | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/src/cpu/kvm/base.hh b/src/cpu/kvm/base.hh index f46455af6..4546b1071 100644 --- a/src/cpu/kvm/base.hh +++ b/src/cpu/kvm/base.hh @@ -93,8 +93,8 @@ class BaseKvmCPU : public BaseCPU void verifyMemoryMode() const; - CpuPort &getDataPort() { return dataPort; } - CpuPort &getInstPort() { return instPort; } + MasterPort &getDataPort() { return dataPort; } + MasterPort &getInstPort() { return instPort; } void wakeup(); void activateContext(ThreadID thread_num, Cycles delay); @@ -403,11 +403,38 @@ class BaseKvmCPU : public BaseCPU } /** @} */ + + /** + * KVM memory port. Uses the default MasterPort behavior, but + * panics on timing accesses. + */ + class KVMCpuPort : public MasterPort + { + + public: + KVMCpuPort(const std::string &_name, BaseKvmCPU *_cpu) + : MasterPort(_name, _cpu) + { } + + protected: + bool recvTimingResp(PacketPtr pkt) + { + panic("The KVM CPU doesn't expect recvTimingResp!\n"); + return true; + } + + void recvRetry() + { + panic("The KVM CPU doesn't expect recvRetry!\n"); + } + + }; + /** Port for data requests */ - CpuPort dataPort; + KVMCpuPort dataPort; /** Unused dummy port for the instruction interface */ - CpuPort instPort; + KVMCpuPort instPort; /** Pre-allocated MMIO memory request */ Request mmio_req; |