Giacomo Travaglini has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12624 )

Change subject: dev-arm: Take into account PPI enable bit
......................................................................

dev-arm: Take into account PPI enable bit

When checking for PPIs to send to the cpu in the PL390 GIC we
were forwarding any pending PPI regardless of their masking
in the distributor.

Change-Id: I2e294abeca733cca95cd0deeb9659c7d3d9d8734
Signed-off-by: Giacomo Travaglini <[email protected]>
Reviewed-by: Andreas Sandberg <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/12624
Maintainer: Andreas Sandberg <[email protected]>
---
M src/dev/arm/gic_v2.cc
1 file changed, 12 insertions(+), 5 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved



diff --git a/src/dev/arm/gic_v2.cc b/src/dev/arm/gic_v2.cc
index 6eaf065..fe5e1ea 100644
--- a/src/dev/arm/gic_v2.cc
+++ b/src/dev/arm/gic_v2.cc
@@ -742,11 +742,18 @@

         // Check PPIs
         if (cpuPpiPending[cpu]) {
-        for (int ppi = 0; ppi < PPI_MAX; ppi++) {
-            if (cpuPpiPending[cpu] & (1 << ppi))
-                if (highest_pri > getIntPriority(cpu, SGI_MAX + ppi)) {
-                    highest_pri = getIntPriority(cpu, SGI_MAX + ppi);
-                    highest_int = SGI_MAX + ppi;
+            for (int ppi_idx = 0, int_num = SGI_MAX;
+                 int_num < PPI_MAX + SGI_MAX;
+                 ppi_idx++, int_num++) {
+
+                const bool ppi_pending = bits(cpuPpiPending[cpu], ppi_idx);
+ const bool ppi_enabled = bits(getIntEnabled(cpu, 0), int_num);
+                const bool higher_priority =
+                    highest_pri > getIntPriority(cpu, int_num);
+
+                if (ppi_pending && ppi_enabled && higher_priority) {
+                    highest_pri = getIntPriority(cpu, int_num);
+                    highest_int = int_num;
                 }
             }
         }

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

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I2e294abeca733cca95cd0deeb9659c7d3d9d8734
Gerrit-Change-Number: 12624
Gerrit-PatchSet: 2
Gerrit-Owner: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to