Hello Andreas Sandberg,
I'd like you to do a code review. Please visit
https://gem5-review.googlesource.com/3661
to review the following change.
Change subject: kvm, arm: don't create interrupt events while saving GIC
state
......................................................................
kvm, arm: don't create interrupt events while saving GIC state
If an interrupt was pending according to Kvm state during a drain,
the Pl390 model would create an interrupt event that could not be
serviced, preventing the system from draining. The proper behavior
is for the Pl390 not actively being used for simulation to just skip
the GIC state machine that delivers interrupts.
Change-Id: Icb37e7e992f1fb441a9b3a26daa1bb5a6fe19228
Reviewed-by: Andreas Sandberg <[email protected]>
---
M src/arch/arm/kvm/gic.cc
M src/arch/arm/kvm/gic.hh
M src/dev/arm/gic_pl390.cc
M src/dev/arm/gic_pl390.hh
4 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/src/arch/arm/kvm/gic.cc b/src/arch/arm/kvm/gic.cc
index 463fbaa..962291f 100644
--- a/src/arch/arm/kvm/gic.cc
+++ b/src/arch/arm/kvm/gic.cc
@@ -291,6 +291,17 @@
kernelGic->clearPPI(cpu, num);
}
+void
+MuxingKvmGic::updateIntState(int hint)
+{
+ // During Kvm->Pl390 state transfer, writes to the Pl390 will call
+ // updateIntState() which can post an interrupt. Since we're only
+ // using the Pl390 model for holding state in this circumstance, we
+ // short-circuit this behavior, as the Pl390 is not actually active.
+ if (!usingKvm)
+ return Pl390::updateIntState(hint);
+}
+
bool
MuxingKvmGic::validKvmEnvironment() const
{
diff --git a/src/arch/arm/kvm/gic.hh b/src/arch/arm/kvm/gic.hh
index b554448..f461430 100644
--- a/src/arch/arm/kvm/gic.hh
+++ b/src/arch/arm/kvm/gic.hh
@@ -194,6 +194,9 @@
void sendPPInt(uint32_t num, uint32_t cpu) override;
void clearPPInt(uint32_t num, uint32_t cpu) override;
+ protected: // Pl390
+ void updateIntState(int hint) override;
+
protected:
/** Verify gem5 configuration will support KVM emulation */
bool validKvmEnvironment() const;
diff --git a/src/dev/arm/gic_pl390.cc b/src/dev/arm/gic_pl390.cc
index ce27e94..898bba4 100644
--- a/src/dev/arm/gic_pl390.cc
+++ b/src/dev/arm/gic_pl390.cc
@@ -865,6 +865,14 @@
}
}
+
+void
+Pl390::drainResume()
+{
+ // There may be pending interrupts if checkpointed from Kvm; post them.
+ updateIntState(-1);
+}
+
void
Pl390::serialize(CheckpointOut &cp) const
{
diff --git a/src/dev/arm/gic_pl390.hh b/src/dev/arm/gic_pl390.hh
index 05c9b5f..4d91cd0 100644
--- a/src/dev/arm/gic_pl390.hh
+++ b/src/dev/arm/gic_pl390.hh
@@ -318,7 +318,7 @@
/** See if some processor interrupt flags need to be enabled/disabled
* @param hint which set of interrupts needs to be checked
*/
- void updateIntState(int hint);
+ virtual void updateIntState(int hint);
/** Update the register that records priority of the highest priority
* active interrupt*/
@@ -367,6 +367,7 @@
Pl390(const Params *p);
DrainState drain() override;
+ void drainResume() override;
void serialize(CheckpointOut &cp) const override;
void unserialize(CheckpointIn &cp) override;
--
To view, visit https://gem5-review.googlesource.com/3661
To unsubscribe, visit https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb37e7e992f1fb441a9b3a26daa1bb5a6fe19228
Gerrit-Change-Number: 3661
Gerrit-PatchSet: 1
Gerrit-Owner: Curtis Dunham <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev