unstick r357917

Revision 357917

Date:
2020/02/14 13:26:45
Author:
kib
Revision Log:
MFC r357670:
pmc: Add Hygon Dhyana support.
Files:

Legend:

 
Added
 
Removed
 
Modified
  • stable/12

     
  • stable/12/lib/libpmc/libpmc_pmu_util.c

     
    103 103 free(buf);
    104 104 return (PMU_INVALID);
    105 105 }
    106 if (strcasestr(buf, "AuthenticAMD") != NULL)
    106 if (strcasestr(buf, "AuthenticAMD") != NULL ||
    107 strcasestr(buf, "HygonGenuine") != NULL)
    107 108 mfr = PMU_AMD;
    108 109 else if (strcasestr(buf, "GenuineIntel") != NULL)
    109 110 mfr = PMU_INTEL;
  • stable/12/lib/libpmc/pmu-events/arch/x86/mapfile.csv

     
    41 41 AuthenticAMD-23-03,v1,amdfam17h,core
    42 42 AuthenticAMD-23-04,v1,amdfam17h,core
    43 43 AuthenticAMD-23-05,v1,amdfam17h,core
    44 HygonGenuine-24-00,v1,amdfam17h,core
  • stable/12/sys/dev/hwpmc/hwpmc_amd.c

     
    1045 1045 if (CPUID_TO_FAMILY(cpu_id) == 0x17)
    1046 1046 snprintf(pmc_cpuid, sizeof(pmc_cpuid), "AuthenticAMD-%d-%02X",
    1047 1047 CPUID_TO_FAMILY(cpu_id), model);
    1048 if (CPUID_TO_FAMILY(cpu_id) == 0x18)
    1049 snprintf(pmc_cpuid, sizeof(pmc_cpuid), "HygonGenuine-%d-%02X",
    1050 CPUID_TO_FAMILY(cpu_id), model);
    1048 1051
    1049 1052 switch (cpu_id & 0xF00) {
    1050 1053 #if defined(__i386__)
  • stable/12/sys/dev/hwpmc/hwpmc_x86.c

     
    248 248 struct pmc_mdep *md;
    249 249
    250 250 /* determine the CPU kind */
    251 if (cpu_vendor_id == CPU_VENDOR_AMD)
    251 if (cpu_vendor_id == CPU_VENDOR_AMD ||
    252 cpu_vendor_id == CPU_VENDOR_HYGON)
    252 253 md = pmc_amd_initialize();
    253 254 else if (cpu_vendor_id == CPU_VENDOR_INTEL)
    254 255 md = pmc_intel_initialize();
     
    271 272 {
    272 273
    273 274 lapic_disable_pmc();
    274 if (cpu_vendor_id == CPU_VENDOR_AMD)
    275 if (cpu_vendor_id == CPU_VENDOR_AMD ||
    276 cpu_vendor_id == CPU_VENDOR_HYGON)
    275 277 pmc_amd_finalize(md);
    276 278 else if (cpu_vendor_id == CPU_VENDOR_INTEL)
    277 279 pmc_intel_finalize(md);