git: f2186417cdca - stable/15 - pmc: add sapphire rapids model

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Thu, 11 Jun 2026 16:58:44 UTC
The branch stable/15 has been updated by mhorne:

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

commit f2186417cdca951738190c5f43c5965216b942e8
Author:     Anaelle Cazuc <anaelle.cazuc@stormshield.eu>
AuthorDate: 2026-05-28 16:28:32 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2026-06-11 16:43:22 +0000

    pmc: add sapphire rapids model
    
    This commit adds the sapphire rapids CPU model to hwpmc_intel.c,
    allowing hwpmc to be used on this CPU family.
    
    Reviewed by:    mhorne
    MFC after:      3 days
    Sponsored by:   Stormshield
    Differential Revision:  https://reviews.freebsd.org/D57263
    
    (cherry picked from commit 03c69dd90122c4ffa91a749f668a2ac8fa6843a2)
---
 sys/dev/hwpmc/hwpmc_intel.c | 4 ++++
 sys/sys/pmc.h               | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/sys/dev/hwpmc/hwpmc_intel.c b/sys/dev/hwpmc/hwpmc_intel.c
index 942cadfae4cf..4c8d0cd2e2bd 100644
--- a/sys/dev/hwpmc/hwpmc_intel.c
+++ b/sys/dev/hwpmc/hwpmc_intel.c
@@ -266,6 +266,10 @@ pmc_intel_initialize(void)
 			cputype = PMC_CPU_INTEL_EMERALD_RAPIDS;
 			nclasses = 3;
 			break;
+		case 0x8F:
+			cputype = PMC_CPU_INTEL_SAPPHIRE_RAPIDS;
+			nclasses = 3;
+			break;
 		}
 		break;
 	}
diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h
index 0ac2efe6c81a..726a03c35502 100644
--- a/sys/sys/pmc.h
+++ b/sys/sys/pmc.h
@@ -111,7 +111,7 @@ extern char pmc_cpuid[PMC_CPUID_LEN];
     __PMC_CPU(INTEL_ALDERLAKEN,		0xA1,	"Intel AlderlakeN")		\
     __PMC_CPU(INTEL_GRANITE_RAPIDS,	0xA2,	"Intel Granite Rapids")		\
     __PMC_CPU(INTEL_METEOR_LAKE,	0xA3,	"Intel Meteorlake")		\
-    __PMC_CPU(INTEL_XSCALE,		0x100,	"Intel XScale")			\
+    __PMC_CPU(INTEL_SAPPHIRE_RAPIDS,	0xA4,	"Intel Sapphire Rapids")	\
     __PMC_CPU(PPC_7450,			0x300,	"PowerPC MPC7450")		\
     __PMC_CPU(PPC_E500,			0x340,	"PowerPC e500 Core")		\
     __PMC_CPU(PPC_970,			0x380,	"IBM PowerPC 970")		\