summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorCurtis Dunham <Curtis.Dunham@arm.com>2017-05-17 21:34:04 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2017-07-05 14:24:03 +0000
commitb829b4a8e4ef82345cf81d442dbc6c67016fde98 (patch)
treeeb080d8bca85dd76314f8721e2b8b5c28d1e89fb /src/arch
parent97187fa814167906ed168a02aad09ff6fd0ed17c (diff)
downloadgem5-b829b4a8e4ef82345cf81d442dbc6c67016fde98.tar.xz
kvm: move Kvm check from ARM Kvm GIC to System
The check was nearly completely generic anyway, with the exception of the Kvm CPU type. This will make it easier for other parts of the codebase to do similar checks. Change-Id: Ibfdd3d65e9e6cc3041b53b73adfabee1999283da Reviewed-on: https://gem5-review.googlesource.com/3540 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/arm/kvm/gic.cc18
-rw-r--r--src/arch/arm/kvm/gic.hh3
2 files changed, 2 insertions, 19 deletions
diff --git a/src/arch/arm/kvm/gic.cc b/src/arch/arm/kvm/gic.cc
index 7cf4d07c6..498b79faa 100644
--- a/src/arch/arm/kvm/gic.cc
+++ b/src/arch/arm/kvm/gic.cc
@@ -189,7 +189,7 @@ void
MuxingKvmGic::startup()
{
Pl390::startup();
- usingKvm = (kernelGic != nullptr) && validKvmEnvironment();
+ usingKvm = (kernelGic != nullptr) && system.validKvmEnvironment();
if (usingKvm)
fromPl390ToKvm();
}
@@ -206,7 +206,7 @@ void
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
@@ -287,20 +287,6 @@ MuxingKvmGic::clearPPInt(uint32_t num, uint32_t cpu)
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)
diff --git a/src/arch/arm/kvm/gic.hh b/src/arch/arm/kvm/gic.hh
index b5544486c..ee04088d3 100644
--- a/src/arch/arm/kvm/gic.hh
+++ b/src/arch/arm/kvm/gic.hh
@@ -195,9 +195,6 @@ class MuxingKvmGic : public Pl390
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;