Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AMD mobile Zen 4 (Phoenix) #562

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/access-daemon/accessDaemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -3745,6 +3745,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 @@ -149,7 +149,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 @@ -838,7 +838,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 @@ -1282,6 +1282,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 @@ -1925,6 +1926,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 @@ -498,7 +499,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 @@ -1138,6 +1138,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
Loading