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

Change subject: arch-arm: Fix initialization of PMU counters
......................................................................

arch-arm: Fix initialization of PMU counters

A version of Linux kernel initializes counters before enabling them.
Without this change, gem5 overwrites the value of counter, which causes
incorrect counter values derived by kernel.

Change-Id: If0c515111103018d5f65f74434d7711a67aeaee4
Reviewed-by: Andreas Sandberg <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/16203
Maintainer: Andreas Sandberg <[email protected]>
---
M src/arch/arm/pmu.cc
1 file changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/src/arch/arm/pmu.cc b/src/arch/arm/pmu.cc
index f6cf872..3042515 100644
--- a/src/arch/arm/pmu.cc
+++ b/src/arch/arm/pmu.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2014, 2017-2018 ARM Limited
+ * Copyright (c) 2011-2014, 2017-2019 ARM Limited
  * All rights reserved
  *
  * The license below extends only to copyright in the software and shall
@@ -532,7 +532,10 @@
 void
 PMU::CounterState::attach(PMUEvent* event)
 {
-    value = 0;
+    if (!resetValue) {
+      value = 0;
+      resetValue = true;
+    }
     sourceEvent = event;
     sourceEvent->attachEvent(this);
 }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/16203
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: If0c515111103018d5f65f74434d7711a67aeaee4
Gerrit-Change-Number: 16203
Gerrit-PatchSet: 3
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