MuxingKvmGic::startup()
{
Pl390::startup();
- usingKvm = (kernelGic != nullptr) && validKvmEnvironment();
+ usingKvm = (kernelGic != nullptr) && system.validKvmEnvironment();
if (usingKvm)
fromPl390ToKvm();
}
MuxingKvmGic::drainResume()
{
Pl390::drainResume();
- bool use_kvm = (kernelGic != nullptr) && validKvmEnvironment();
+ bool use_kvm = (kernelGic != nullptr) && system.validKvmEnvironment();
if (use_kvm != usingKvm) {
// Should only occur due to CPU switches
if (use_kvm) // from simulation to KVM emulation
kernelGic->clearPPI(cpu, num);
}
-bool
-MuxingKvmGic::validKvmEnvironment() const
-{
- if (system.threadContexts.empty())
- return false;
-
- for (auto tc : system.threadContexts) {
- if (dynamic_cast<BaseArmKvmCPU*>(tc->getCpuPtr()) == nullptr) {
- return false;
- }
- }
- return true;
-}
-
void
MuxingKvmGic::copyDistRegister(BaseGicRegisters* from, BaseGicRegisters* to,
ContextID ctx, Addr daddr)
void clearPPInt(uint32_t num, uint32_t cpu) override;
protected:
- /** Verify gem5 configuration will support KVM emulation */
- bool validKvmEnvironment() const;
-
/** System this interrupt controller belongs to */
System &system;
#include "base/trace.hh"
#include "config/use_kvm.hh"
#if USE_KVM
+#include "cpu/kvm/base.hh"
#include "cpu/kvm/vm.hh"
#endif
#include "cpu/thread_context.hh"
remoteGDB[context_id]->replaceThreadContext(tc);
}
+bool
+System::validKvmEnvironment() const
+{
+#if USE_KVM
+ if (threadContexts.empty())
+ return false;
+
+ for (auto tc : threadContexts) {
+ if (dynamic_cast<BaseKvmCPU*>(tc->getCpuPtr()) == nullptr) {
+ return false;
+ }
+ }
+ return true;
+#else
+ return false;
+#endif
+}
+
Addr
System::allocPhysPages(int npages)
{
return kvmVM;
}
+ /** Verify gem5 configuration will support KVM emulation */
+ bool validKvmEnvironment() const;
+
/** Get a pointer to access the physical memory of the system */
PhysicalMemory& getPhysMem() { return physmem; }