Skip to content

Commit

Permalink
Add support for AMD mobile Zen 4 (Phoenix) (#562)
Browse files Browse the repository at this point in the history
* Add support for AMD mobile Zen4 (Phoenix)

* Add AMD Zen4 Phoenix to other interfaces

* Remove Zen4 Phoenix from hwfeatures. Conflict because file does not exist anymore in master

---------

Co-authored-by: Thomas Roehl <thomas.roehl@fau.de>
  • Loading branch information
kronbichler and TomTheBear authored Sep 9, 2024
1 parent fade9ce commit d9b8904
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/access-daemon/accessDaemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -3750,6 +3750,7 @@ int main(void)
allowed = allowed_amd17_zen2;
break;
case ZEN4_RYZEN:
case ZEN4_RYZEN2:
case ZEN4_EPYC:
allowed = allowed_amd19_zen4;
break;
Expand Down
4 changes: 2 additions & 2 deletions src/includes/perfmon_perfevent.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ int perfmon_init_perfevent(int cpu_id)
active_cpus += 1;
}
perf_event_num_cpus = cpuid_topology.numHWThreads;
if (cpuid_info.family == ZEN3_FAMILY && (cpuid_info.model == ZEN4_RYZEN || cpuid_info.model == ZEN4_EPYC))
if (cpuid_info.family == ZEN3_FAMILY && (cpuid_info.model == ZEN4_RYZEN || cpuid_info.model == ZEN4_RYZEN2 || cpuid_info.model == ZEN4_EPYC))
{
perfEventOptionNames[EVENT_OPTION_TID] = "threadmask";
perfEventOptionNames[EVENT_OPTION_CID] = "coreid";
Expand Down Expand Up @@ -901,7 +901,7 @@ int perf_uncore_setup(struct perf_event_attr *attr, RegisterType type, PerfmonEv
}
}
}
if (type != POWER && cpuid_info.family == ZEN3_FAMILY && (cpuid_info.model == ZEN4_RYZEN || cpuid_info.model == ZEN4_EPYC))
if (type != POWER && cpuid_info.family == ZEN3_FAMILY && (cpuid_info.model == ZEN4_RYZEN || cpuid_info.model == ZEN4_RYZEN2 || cpuid_info.model == ZEN4_EPYC))
{
int got_cid = 0;
int got_slices = 0;
Expand Down
1 change: 1 addition & 0 deletions src/includes/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ struct topology_functions {
#define ZEN3_RYZEN3 0x50
#define ZEN3_EPYC_TRENTO 0x30
#define ZEN4_RYZEN 0x61
#define ZEN4_RYZEN2 0x74
#define ZEN4_EPYC 0x11

/* ARM */
Expand Down
2 changes: 2 additions & 0 deletions src/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,7 @@ perfmon_init_maps(void)
translate_types = zen3_translate_types;
break;
case ZEN4_RYZEN:
case ZEN4_RYZEN2:
case ZEN4_EPYC:
eventHash = zen4_arch_events;
perfmon_numArchEvents = perfmon_numArchEventsZen4;
Expand Down Expand Up @@ -1950,6 +1951,7 @@ perfmon_init_funcs(int* init_power, int* init_temp)
perfmon_finalizeCountersThread = perfmon_finalizeCountersThread_zen3;
break;
case ZEN4_RYZEN:
case ZEN4_RYZEN2:
case ZEN4_EPYC:
initThreadArch = perfmon_init_zen4;
initialize_power = TRUE;
Expand Down
3 changes: 2 additions & 1 deletion src/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ power_init(int cpuId)
}
break;
case ZEN4_RYZEN:
case ZEN4_RYZEN2:
case ZEN4_EPYC:
cpuid_info.turbo = 0;
power_info.hasRAPL = 1;
Expand Down Expand Up @@ -501,7 +502,7 @@ power_init(int cpuId)
}
}

if (cpuid_info.family == ZEN3_FAMILY && (cpuid_info.model == ZEN4_RYZEN || cpuid_info.model == ZEN4_EPYC))
if (cpuid_info.family == ZEN3_FAMILY && (cpuid_info.model == ZEN4_RYZEN || cpuid_info.model == ZEN4_RYZEN2 || cpuid_info.model == ZEN4_EPYC))
{
err = HPMread(cpuId, MSR_DEV, MSR_AMD19_RAPL_L3_UNIT, &flags);
if (err == 0)
Expand Down
1 change: 1 addition & 0 deletions src/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,7 @@ topology_setName(void)
cpuid_info.short_name = short_zen3;
break;
case ZEN4_RYZEN:
case ZEN4_RYZEN2:
case ZEN4_EPYC:
cpuid_info.name = amd_zen4_str;
cpuid_info.short_name = short_zen4;
Expand Down

0 comments on commit d9b8904

Please sign in to comment.