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

Change subject: dev-arm: Store a PhysProxy port in Gicv3Redist
......................................................................

dev-arm: Store a PhysProxy port in Gicv3Redist

This spares us from retrieving the TC pointer every time we want to
write/read to memory (LPIs)

Change-Id: Iad76b5e69188fa0ac5c6777a3b2664b0fc66b12f
Signed-off-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandb...@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18600
Maintainer: Andreas Sandberg <andreas.sandb...@arm.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/dev/arm/gic_v3_redistributor.cc
M src/dev/arm/gic_v3_redistributor.hh
2 files changed, 16 insertions(+), 15 deletions(-)

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



diff --git a/src/dev/arm/gic_v3_redistributor.cc b/src/dev/arm/gic_v3_redistributor.cc
index 0ee6b8a..de6bd63 100644
--- a/src/dev/arm/gic_v3_redistributor.cc
+++ b/src/dev/arm/gic_v3_redistributor.cc
@@ -44,6 +44,7 @@
       distributor(nullptr),
       cpuInterface(nullptr),
       cpuId(cpu_id),
+      memProxy(nullptr),
       irqGroup(Gicv3::SGI_MAX + Gicv3::PPI_MAX),
       irqEnabled(Gicv3::SGI_MAX + Gicv3::PPI_MAX),
       irqPending(Gicv3::SGI_MAX + Gicv3::PPI_MAX),
@@ -61,6 +62,8 @@
 {
     distributor = gic->getDistributor();
     cpuInterface = gic->getCPUInterface(cpuId);
+
+    memProxy = &gic->getSystem()->physProxy;
 }

 void
@@ -804,7 +807,6 @@

     // Check LPIs
     if (EnableLPIs) {
-        ThreadContext * tc = gic->getSystem()->getThreadContext(cpuId);

         const uint32_t largest_lpi_id = 1 << (lpiIDBits + 1);
         const uint32_t number_lpis = largest_lpi_id - SMALLEST_LPI_ID + 1;
@@ -812,13 +814,13 @@
         uint8_t lpi_pending_table[largest_lpi_id / 8];
         uint8_t lpi_config_table[number_lpis];

-        tc->getPhysProxy().readBlob(lpiPendingTablePtr,
-                                    (uint8_t *) lpi_pending_table,
-                                    sizeof(lpi_pending_table));
+        memProxy->readBlob(lpiPendingTablePtr,
+                           (uint8_t *) lpi_pending_table,
+                           sizeof(lpi_pending_table));

-        tc->getPhysProxy().readBlob(lpiConfigurationTablePtr,
-                (uint8_t*) lpi_config_table,
-                sizeof(lpi_config_table));
+        memProxy->readBlob(lpiConfigurationTablePtr,
+                           (uint8_t*) lpi_config_table,
+                           sizeof(lpi_config_table));

         for (int lpi_id = SMALLEST_LPI_ID; lpi_id < largest_lpi_id;
              lpi_id++) {
@@ -866,10 +868,9 @@
     Addr lpi_pending_entry_ptr = lpiPendingTablePtr + (lpi_id / 8);

     uint8_t lpi_pending_entry;
-    ThreadContext * tc = gic->getSystem()->getThreadContext(cpuId);
-    tc->getPhysProxy().readBlob(lpi_pending_entry_ptr,
-            (uint8_t*) &lpi_pending_entry,
-            sizeof(lpi_pending_entry));
+    memProxy->readBlob(lpi_pending_entry_ptr,
+                       (uint8_t*) &lpi_pending_entry,
+                       sizeof(lpi_pending_entry));

     return lpi_pending_entry;
 }
@@ -879,10 +880,9 @@
 {
     Addr lpi_pending_entry_ptr = lpiPendingTablePtr + (lpi_id / 8);

-    ThreadContext * tc = gic->getSystem()->getThreadContext(cpuId);
-    tc->getPhysProxy().writeBlob(lpi_pending_entry_ptr,
-            (uint8_t*) &lpi_pending_entry,
-            sizeof(lpi_pending_entry));
+    memProxy->writeBlob(lpi_pending_entry_ptr,
+                        (uint8_t*) &lpi_pending_entry,
+                        sizeof(lpi_pending_entry));
 }

 bool
diff --git a/src/dev/arm/gic_v3_redistributor.hh b/src/dev/arm/gic_v3_redistributor.hh
index 6aff91d..8d7de3d 100644
--- a/src/dev/arm/gic_v3_redistributor.hh
+++ b/src/dev/arm/gic_v3_redistributor.hh
@@ -51,6 +51,7 @@
     Gicv3Distributor * distributor;
     Gicv3CPUInterface * cpuInterface;
     uint32_t cpuId;
+    PortProxy * memProxy;

     /*
      * GICv3 defines 2 contiguous 64KB frames for each redistributor.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/18600
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: Iad76b5e69188fa0ac5c6777a3b2664b0fc66b12f
Gerrit-Change-Number: 18600
Gerrit-PatchSet: 3
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to