diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2016-02-17 08:50:41 -0600 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2017-03-13 12:10:52 +0000 |
commit | 3e200455bd9c9360812d4f6eeef7bf60b70ea213 (patch) | |
tree | a3c2125341a00a7b9fdb69bd49aa06253966a56e /src/dev/arm/gic_pl390.hh | |
parent | 35cb11f14e620aabbe1ab40a61748d5948a447b7 (diff) | |
download | gem5-3e200455bd9c9360812d4f6eeef7bf60b70ea213.tar.xz |
dev, arm: Add draining to the GIC model
The GIC model currently adds a delay to interrupts when posting them
to a target CPU. This means that an interrupt signal will be
represented by an event for a short period of time. We currently
ignore this when draining and serialize the tick when the interrupt
will fire. Upon loading the checkpoint, the simulated GIC reschedules
the pending events. This behaviour is undesirable when we implement
support for switching between in-kernel GIC emulation and gem5 GIC
emulation. In that case, the (kernel) GIC model gets a lot simpler if
we don't need to worry about in-flight interrupts from the gem5 GIC.
This changeset adds a draining check to force the GIC into a state
where all interrupts have been delivered prior to checkpointing/CPU
switching. It also removes the now redundant serialization of
interrupt events.
Change-Id: I8b8b080aa291ca029a3a7bdd1777f1fcd5b01179
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2331
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/dev/arm/gic_pl390.hh')
-rw-r--r-- | src/dev/arm/gic_pl390.hh | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/dev/arm/gic_pl390.hh b/src/dev/arm/gic_pl390.hh index 533a0f318..664705837 100644 --- a/src/dev/arm/gic_pl390.hh +++ b/src/dev/arm/gic_pl390.hh @@ -318,25 +318,32 @@ class Pl390 : public BaseGic int intNumToWord(int num) const { return num >> 5; } int intNumToBit(int num) const { return num % 32; } - /** Post an interrupt to a CPU + /** + * Post an interrupt to a CPU with a delay */ void postInt(uint32_t cpu, Tick when); + /** + * Deliver a delayed interrupt to the target CPU + */ + void postDelayedInt(uint32_t cpu); + /** Event definition to post interrupt to CPU after a delay */ class PostIntEvent : public Event { private: + Pl390 &parent; uint32_t cpu; - Platform *platform; public: - PostIntEvent( uint32_t c, Platform* p) - : cpu(c), platform(p) + PostIntEvent(Pl390 &_parent, uint32_t _cpu) + : parent(_parent), cpu(_cpu) { } - void process() { platform->intrctrl->post(cpu, ArmISA::INT_IRQ, 0);} + void process() { parent.postDelayedInt(cpu); } const char *description() const { return "Post Interrupt to CPU"; } }; PostIntEvent *postIntEvent[CPU_MAX]; + int pendingDelayedInterrupts; public: typedef Pl390Params Params; @@ -347,6 +354,8 @@ class Pl390 : public BaseGic } Pl390(const Params *p); + DrainState drain() override; + void serialize(CheckpointOut &cp) const override; void unserialize(CheckpointIn &cp) override; |