git: 28ff96115d95 - main - hwpmc: Move DMC-620 and CMN-600 events to allow for full Armv8.0 space

From: Jessica Clarke <jrtc27_at_FreeBSD.org>
Date: Mon, 10 Oct 2022 22:34:37 UTC
The branch main has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=28ff96115d95311affd38fab243574806af5e784

commit 28ff96115d95311affd38fab243574806af5e784
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2022-10-10 22:30:07 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2022-10-10 22:30:07 +0000

    hwpmc: Move DMC-620 and CMN-600 events to allow for full Armv8.0 space
    
    The documented encoding space for Armv8 was only 8 bits, but v8.0 has
    always had a 10-bit encoding space for its events, and downstream in
    CheriBSD we relied on this full space. This worked until the DMC-620 and
    CMN-600 events were added, trampling on what should have been reserved
    for Armv8.0 right from the start. Thus, renumber the DMC-620 and CMN-600
    events to not do this before they make it into a stable release,
    allowing for the full Armv8.0 encoding space to be used without having
    to split it across two different regions.
    
    Note that Armv8.1 grows the encoding space to 16 bits, which doesn't fit
    well with our current approach. No attempt is made to allow for these
    events in this change, only the ones that have always been valid (according to
    the hardware) from the first commit of Armv8 support to hwpmc.
    
    Reviewed by:    arichardson, tsoome
    Differential Revision:  https://reviews.freebsd.org/D36925
---
 sys/dev/hwpmc/pmc_events.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sys/dev/hwpmc/pmc_events.h b/sys/dev/hwpmc/pmc_events.h
index e16b4f744853..c84ce7eee4c1 100644
--- a/sys/dev/hwpmc/pmc_events.h
+++ b/sys/dev/hwpmc/pmc_events.h
@@ -1707,10 +1707,10 @@ __PMC_EV_ALIAS("unhalted-core-cycles",		IAP_ARCH_UNH_COR_CYC)
  * 0x13200	0x00FF		free (was IBM POWER8 events)
  * 0x13300	0x00FF		Freescale e500 events
  * 0x14000	0x0100		ARMv7 events
- * 0x14100	0x0100		ARMv8 events
- * 0x14200	0x0020		ARM DMC-620 clkdiv2 events
- * 0x14220	0x0080		ARM DMC-620 clk events
- * 0x14300	0x0100		ARM CMN-600 events
+ * 0x14100	0x0400		ARMv8 events
+ * 0x14500	0x0020		ARM DMC-620 clkdiv2 events
+ * 0x14520	0x0080		ARM DMC-620 clk events
+ * 0x14600	0x0100		ARM CMN-600 events
  * 0x20000	0x1000		Software events
  */
 #define	__PMC_EVENTS()				\
@@ -1734,11 +1734,11 @@ __PMC_EV_ALIAS("unhalted-core-cycles",		IAP_ARCH_UNH_COR_CYC)
 	__PMC_EV_ARMV7()			\
 	__PMC_EV_BLOCK(ARMV8,	0x14100)	\
 	__PMC_EV_ARMV8()			\
-	__PMC_EV_BLOCK(DMC620_PMU_CD2, 0x14200)	\
+	__PMC_EV_BLOCK(DMC620_PMU_CD2, 0x14500)	\
 	__PMC_EV_DMC620_PMU_CD2()		\
-	__PMC_EV_BLOCK(DMC620_PMU_C, 0x14220)	\
+	__PMC_EV_BLOCK(DMC620_PMU_C, 0x14520)	\
 	__PMC_EV_DMC620_PMU_C()			\
-	__PMC_EV_BLOCK(CMN600_PMU, 0x14300)	\
+	__PMC_EV_BLOCK(CMN600_PMU, 0x14600)	\
 	__PMC_EV_CMN600_PMU()
 
 #define	PMC_EVENT_FIRST	PMC_EV_TSC_TSC