Page MenuHomeFreeBSD

D23562.diff
No OneTemporary

D23562.diff

Index: head/lib/libpmc/libpmc_pmu_util.c
===================================================================
--- head/lib/libpmc/libpmc_pmu_util.c
+++ head/lib/libpmc/libpmc_pmu_util.c
@@ -103,7 +103,8 @@
free(buf);
return (PMU_INVALID);
}
- if (strcasestr(buf, "AuthenticAMD") != NULL)
+ if (strcasestr(buf, "AuthenticAMD") != NULL ||
+ strcasestr(buf, "HygonGenuine") != NULL)
mfr = PMU_AMD;
else if (strcasestr(buf, "GenuineIntel") != NULL)
mfr = PMU_INTEL;
Index: head/lib/libpmc/pmu-events/arch/x86/mapfile.csv
===================================================================
--- head/lib/libpmc/pmu-events/arch/x86/mapfile.csv
+++ head/lib/libpmc/pmu-events/arch/x86/mapfile.csv
@@ -41,3 +41,4 @@
AuthenticAMD-23-03,v1,amdfam17h,core
AuthenticAMD-23-04,v1,amdfam17h,core
AuthenticAMD-23-05,v1,amdfam17h,core
+HygonGenuine-24-00,v1,amdfam17h,core
Index: head/sys/dev/hwpmc/hwpmc_amd.c
===================================================================
--- head/sys/dev/hwpmc/hwpmc_amd.c
+++ head/sys/dev/hwpmc/hwpmc_amd.c
@@ -1089,6 +1089,9 @@
if (CPUID_TO_FAMILY(cpu_id) == 0x17)
snprintf(pmc_cpuid, sizeof(pmc_cpuid), "AuthenticAMD-%d-%02X",
CPUID_TO_FAMILY(cpu_id), model);
+ if (CPUID_TO_FAMILY(cpu_id) == 0x18)
+ snprintf(pmc_cpuid, sizeof(pmc_cpuid), "HygonGenuine-%d-%02X",
+ CPUID_TO_FAMILY(cpu_id), model);
switch (cpu_id & 0xF00) {
#if defined(__i386__)
Index: head/sys/dev/hwpmc/hwpmc_x86.c
===================================================================
--- head/sys/dev/hwpmc/hwpmc_x86.c
+++ head/sys/dev/hwpmc/hwpmc_x86.c
@@ -248,7 +248,8 @@
struct pmc_mdep *md;
/* determine the CPU kind */
- if (cpu_vendor_id == CPU_VENDOR_AMD)
+ if (cpu_vendor_id == CPU_VENDOR_AMD ||
+ cpu_vendor_id == CPU_VENDOR_HYGON)
md = pmc_amd_initialize();
else if (cpu_vendor_id == CPU_VENDOR_INTEL)
md = pmc_intel_initialize();
@@ -271,7 +272,8 @@
{
lapic_disable_pmc();
- if (cpu_vendor_id == CPU_VENDOR_AMD)
+ if (cpu_vendor_id == CPU_VENDOR_AMD ||
+ cpu_vendor_id == CPU_VENDOR_HYGON)
pmc_amd_finalize(md);
else if (cpu_vendor_id == CPU_VENDOR_INTEL)
pmc_intel_finalize(md);

File Metadata

Mime Type
text/plain
Expires
Sun, May 17, 12:02 PM (11 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33137528
Default Alt Text
D23562.diff (2 KB)

Event Timeline