Re: [PATCH v5 1/2] perf/x86/amd/uncore: Add Hygon uncore PMU support
Qi Liu <[email protected]>
| Newsgroups | dev.linux.lists.sashiko-reviews,org.kernel.vger.linux-perf-users |
|---|---|
| Message-ID | <[email protected]> |
Hi On 8/18/2026 6:16 PM, [email protected] wrote: > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > - [Medium] Removal of Hygon L3 Uncore PMU support without a replacement in the new driver. > -- > > --- Patch [1]: [PATCH v5 1/2] perf/x86/amd/uncore: Add Hygon uncore PMU support --- > commit 1b6dd18387bea20f9f548951bf79cae006705b47 > Author: Qi Liu <[email protected]> > > perf/x86/amd/uncore: Add Hygon uncore PMU support > > This commit introduces a separate uncore PMU driver for Hygon processors to > support Data Fabric (DF) and Data Fabric IO Die (DF_IOD) counters. It also > removes the Hygon vendor checks from the AMD uncore driver to keep the > vendor-specific features separated. > >> diff --git a/arch/x86/events/amd/hygon_uncore.c b/arch/x86/events/amd/hygon_uncore.c >> new file mode 100644 >> index 0000000000000..471955d6fc282 >> --- /dev/null >> +++ b/arch/x86/events/amd/hygon_uncore.c > > [ ... ] > >> +static struct hygon_uncore uncores[HYGON_UNCORE_TYPE_MAX] = { >> + /* HYGON DF */ >> + { >> + .scan = hygon_uncore_df_ctx_scan, >> + .init = hygon_uncore_df_ctx_init, >> + .move = hygon_uncore_ctx_move, >> + .free = hygon_uncore_ctx_free, >> + }, >> + /* HYGON DF IOD */ >> + { >> + .scan = hygon_uncore_df_iod_ctx_scan, >> + .init = hygon_uncore_df_iod_ctx_init, >> + .move = hygon_uncore_ctx_move, >> + .free = hygon_uncore_ctx_free, >> + } >> +}; > > [ ... ] > >> diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c >> index dbc00b6dd69ee..6c486e1ab001a 100644 >> --- a/arch/x86/events/amd/uncore.c >> +++ b/arch/x86/events/amd/uncore.c > > [ ... ] > >> @@ -1120,8 +1116,7 @@ static int __init amd_uncore_init(void) >> int ret = -ENODEV; >> int i; >> >> - if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD && >> - boot_cpu_data.x86_vendor != X86_VENDOR_HYGON) >> + if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) >> return -ENODEV; >> >> if (!boot_cpu_has(X86_FEATURE_TOPOEXT)) > > [Severity: Medium] > Does this inadvertently remove L3 uncore PMU support for Hygon systems? > > Removing the Hygon vendor check in amd_uncore_init() prevents the AMD uncore > driver from initializing on Hygon CPUs, which previously provided L3 cache PMU > support. > > Looking at the new driver in hygon_uncore.c, the uncores[] array only > implements the DF and DF_IOD components. It does not appear to provide a > replacement for the L3 cache PMU that was previously available. > L3 and UMC PMU support for Hygon will be added in follow-up series. This series focuses specifically on Data Fabric uncore PMU support as the initial step. Thanks, Qi