Hsuan Hsu has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/30916 )

Change subject: dev-arm: Make generic timer work with level-sensitive support
......................................................................

dev-arm: Make generic timer work with level-sensitive support

Support for level-sensitive PPIs and SPIs has been added to GICv2 now.
It is therefore the timer's responsibility to notify GICv2 to clear its
interrupt pending state. Without doing this, the guest will get stuck
in just a single round of the interrupt handler because GICv2 does not
clear the pending state, and eventually make the guest treat this
interrupt as problematic and then just disable it.

JIRA: https://gem5.atlassian.net/browse/GEM5-663

Change-Id: Ia8fd96bf00b28e91aa440274e6f8bb000446fbe3
Signed-off-by: Hsuan Hsu <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30916
Reviewed-by: Giacomo Travaglini <[email protected]>
Reviewed-by: Andreas Sandberg <[email protected]>
Maintainer: Giacomo Travaglini <[email protected]>
Maintainer: Andreas Sandberg <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/dev/arm/generic_timer.cc
1 file changed, 12 insertions(+), 3 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved
  Giacomo Travaglini: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/dev/arm/generic_timer.cc b/src/dev/arm/generic_timer.cc
index 1b75728..42b03ad 100644
--- a/src/dev/arm/generic_timer.cc
+++ b/src/dev/arm/generic_timer.cc
@@ -281,7 +281,11 @@
     if (value() >= _counterLimit) {
         counterLimitReached();
     } else {
-        _control.istatus = 0;
+        if (_control.istatus) {
+            DPRINTF(Timer, "Clearing interrupt\n");
+            _interrupt->clear();
+            _control.istatus = 0;
+        }
         if (scheduleEvents()) {
             _parent.schedule(_counterLimitReachedEvent,
                              whenValue(_counterLimit));
@@ -313,8 +317,13 @@
     if (!old_ctl.enable && new_ctl.enable)
         updateCounter();
     // Timer disabled
-    else if (old_ctl.enable && !new_ctl.enable)
-        _control.istatus = 0;
+    else if (old_ctl.enable && !new_ctl.enable) {
+        if (_control.istatus) {
+            DPRINTF(Timer, "Clearing interrupt\n");
+            _interrupt->clear();
+            _control.istatus = 0;
+        }
+    }
 }

 void

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/30916
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ia8fd96bf00b28e91aa440274e6f8bb000446fbe3
Gerrit-Change-Number: 30916
Gerrit-PatchSet: 7
Gerrit-Owner: Hsuan Hsu <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Hsuan Hsu <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to