Skip to contentSkip to conversation

ARM: perf-events: fix v7 event selection mask

PATCH New Will Deacon 2 participants 2 messages Feb 25, 2010 – Feb 26, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: perf-events: fix v7 event selection mask

The event selection mask for ARMv7 cores [ARMV7_EVTSEL_MASK] is incorrectly set to 0x7f. This means that the top bit of an event ID is ignored, so counting branch misses (id=0x10) and ISBs (id=0x90) give the same results.

This patch sets the event selection mask to the correct value of 0xff.

---
 arch/arm/kernel/perf_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/kernel/perf_event.c +1 -1
index b44d159..c45a155 100644
@@ -1625,7 +1625,7 @@ enum armv7_counters {
 /*
  * EVTSEL: Event selection reg
  */
-#define	ARMV7_EVTSEL_MASK	0x7f		/* Mask for writable bits */
+#define	ARMV7_EVTSEL_MASK	0xff		/* Mask for writable bits */
 
 /*
  * SELECT: Counter selection reg
Signature · 1 line
1.6.3.3
#1 lore raw

PATCH 1/1 ARM: perf-events: fix v7 event selection mask

Will,

Quoted 4 lines · On Thursday 25 February 2010 19:18:31 Will Deacon wrote:

The event selection mask for ARMv7 cores [ARMV7_EVTSEL_MASK] is incorrectly set to 0x7f. This means that the top bit of an event ID is ignored, so counting branch misses (id=0x10) and ISBs (id=0x90) give the same results.

Good catch! It is a left over from the Cortex-A8 only code. Cortex-A9 introduces more events.

Thanks,
Jean

Quoted 23 lines

This patch sets the event selection mask to the correct value of 0xff.

---
 arch/arm/kernel/perf_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/kernel/perf_event.c +1 -1
index b44d159..c45a155 100644
@@ -1625,7 +1625,7 @@ enum armv7_counters {
 /*
  * EVTSEL: Event selection reg
  */
-#define	ARMV7_EVTSEL_MASK	0x7f		/* Mask for writable bits */
+#define	ARMV7_EVTSEL_MASK	0xff		/* Mask for writable bits */
 
 /*
  * SELECT: Counter selection reg