pmc: Add Hygon Dhyana support.
To make the PMC tool pmcstat working properly on Hygon platform, add support for Hygon Dhyana family 18h by using the PMC initialization code path of AMD family 17h. Submitted by: Pu Wen <puwen@hygon.cn> MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23562
This commit is contained in:
parent
fc9134243d
commit
53071ed1c9
@ -103,7 +103,8 @@ pmu_events_mfr(void)
|
||||
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;
|
||||
|
@ -41,3 +41,4 @@ AuthenticAMD-23-02,v1,amdfam17h,core
|
||||
AuthenticAMD-23-03,v1,amdfam17h,core
|
||||
AuthenticAMD-23-04,v1,amdfam17h,core
|
||||
AuthenticAMD-23-05,v1,amdfam17h,core
|
||||
HygonGenuine-24-00,v1,amdfam17h,core
|
||||
|
|
@ -1089,6 +1089,9 @@ pmc_amd_initialize(void)
|
||||
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__)
|
||||
|
@ -248,7 +248,8 @@ pmc_md_initialize()
|
||||
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 @@ pmc_md_finalize(struct pmc_mdep *md)
|
||||
{
|
||||
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user