summaryrefslogtreecommitdiff
path: root/src/arch/arm/kvm/gic.hh
diff options
context:
space:
mode:
authorCurtis Dunham <Curtis.Dunham@arm.com>2017-02-14 15:09:18 -0600
committerCurtis Dunham <Curtis.Dunham@arm.com>2017-02-14 15:09:18 -0600
commit0edf6dc9560364691ca0d359ab8321b936f0ec85 (patch)
treea712a0487f7f024d9c329c2bb427c71a827cfa1d /src/arch/arm/kvm/gic.hh
parent41beacce088e8f682a0e8ac48f22a3fa4805a43b (diff)
downloadgem5-0edf6dc9560364691ca0d359ab8321b936f0ec85.tar.xz
arm, kvm: implement MuxingKvmGic
This device allows us to, when KVM support is detected and compiled in, instantiate the same Gic device whether the actual simulation is with KVM cores or simulated cores. Checkpointing is not yet supported. Change-Id: I67e4e0b6fb7ab5058e52c933f4f3d8e7ab24981e Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/arch/arm/kvm/gic.hh')
-rw-r--r--src/arch/arm/kvm/gic.hh47
1 files changed, 46 insertions, 1 deletions
diff --git a/src/arch/arm/kvm/gic.hh b/src/arch/arm/kvm/gic.hh
index d6922b24b..fc09da6a0 100644
--- a/src/arch/arm/kvm/gic.hh
+++ b/src/arch/arm/kvm/gic.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2016 ARM Limited
+ * Copyright (c) 2015-2017 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -35,6 +35,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Authors: Andreas Sandberg
+ * Curtis Dunham
*/
#ifndef __ARCH_ARM_KVM_GIC_HH__
@@ -44,6 +45,7 @@
#include "cpu/kvm/device.hh"
#include "cpu/kvm/vm.hh"
#include "dev/arm/base_gic.hh"
+#include "dev/arm/gic_pl390.hh"
#include "dev/platform.hh"
/**
@@ -205,4 +207,47 @@ class KvmGic : public BaseGic
const AddrRangeList addrRanges;
};
+struct MuxingKvmGicParams;
+
+class MuxingKvmGic : public Pl390
+{
+ public: // SimObject / Serializable / Drainable
+ MuxingKvmGic(const MuxingKvmGicParams *p);
+ ~MuxingKvmGic();
+
+ void startup() override;
+ void drainResume() override;
+
+ void serialize(CheckpointOut &cp) const override;
+ void unserialize(CheckpointIn &cp) override;
+
+ public: // PioDevice
+ Tick read(PacketPtr pkt) override;
+ Tick write(PacketPtr pkt) override;
+
+ public: // Pl390
+ void sendInt(uint32_t num) override;
+ void clearInt(uint32_t num) override;
+
+ void sendPPInt(uint32_t num, uint32_t cpu) override;
+ 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;
+
+ /** Kernel GIC device */
+ KvmKernelGicV2 *kernelGic;
+
+ private:
+ bool usingKvm;
+
+ /** Multiplexing implementation: state transfer functions */
+ void fromPl390ToKvm();
+ void fromKvmToPl390();
+};
+
#endif // __ARCH_ARM_KVM_GIC_HH__