From: "Chen, Zide" <zide.chen@intel.com>
To: sashiko-reviews@lists.linux.dev
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 08/12] perf/x86/intel/uncore: Drop spr_uncore_pci_ops for generic PCI
Date: Fri, 4 Dec 2026 22:41:46 -0600 [thread overview]
Message-ID: <93e415fd-514e-4b8f-be89-12e7daa68ebe@intel.com> (raw)
In-Reply-To: <sashiko-outbox-250997@kernel.org>
On 12/4/2026 9:46 PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issues to consider:
> - [Low] perf/x86/intel/uncore: five generic PCI callbacks remain
> non-static
> - [Low] perf/x86/intel/uncore: redundant ops and ctl_offs8 in PCI format
> macro
> --
>
> commit 5f71697af3492a89c48cdbab965d8b6947a44340
> Author: Zide Chen <zide.chen@intel.com>
>
> perf/x86/intel/uncore: Drop spr_uncore_pci_ops for generic PCI
>
> This commit exports generic_uncore_pci_ops as intel_generic_uncore_pci_ops
> and removes spr_uncore_pci_ops and spr_uncore_pci_enable_event() in favor
> of the generic PCI ops.
>
>> diff --git a/arch/x86/events/intel/uncore_discovery.h b/arch/x86/events/intel/uncore_discovery.h
>> index 58746f9868a72..04778b1c22a94 100644
>> --- a/arch/x86/events/intel/uncore_discovery.h
>> +++ b/arch/x86/events/intel/uncore_discovery.h
>> @@ -168,6 +168,7 @@ void intel_generic_uncore_pci_disable_event(struct intel_uncore_box *box,
>> struct perf_event *event);
>> u64 intel_generic_uncore_pci_read_counter(struct intel_uncore_box *box,
>> struct perf_event *event);
>> +extern struct intel_uncore_ops intel_generic_uncore_pci_ops;
>
> [Severity: Low]
> Can the five individual PCI callbacks (intel_generic_uncore_pci_init_box(),
> intel_generic_uncore_pci_disable_box(), intel_generic_uncore_pci_enable_box(),
> intel_generic_uncore_pci_disable_event(), and
> intel_generic_uncore_pci_read_counter()) be made static again, with their
> prototypes dropped from uncore_discovery.h?
>
> After removing spr_uncore_pci_ops, none of them have any remaining callers
> outside arch/x86/events/intel/uncore_discovery.c.
Good catch. This can further cleanup the code.
Now that intel_generic_uncore_pci_ops is exported directly, none of the
individual callbacks need external visibility. I will mark all five
callbacks static and drop their declarations from uncore_discovery.h.
>
>> diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
>> index 14232ef4f77bd..0b8057d142c11 100644
>> --- a/arch/x86/events/intel/uncore_snbep.c
>> +++ b/arch/x86/events/intel/uncore_snbep.c
>
> [ ... ]
>
>> #define SPR_UNCORE_PCI_COMMON_FORMAT() \
>> SPR_UNCORE_COMMON_FORMAT(), \
>> .ctl_offs8 = 1, \
>> - .ops = &spr_uncore_pci_ops
>> + .ops = &intel_generic_uncore_pci_ops
>
> [Severity: Low]
> Can SPR_UNCORE_PCI_COMMON_FORMAT() be dropped in favor of
> SPR_UNCORE_COMMON_FORMAT()?
>
> uncore_update_uncore_type() already sets ctl_offs8 and
> intel_generic_uncore_pci_ops for discovered UNCORE_ACCESS_PCI types, and
> only spr_uncore_m3upi among this macro's users bypasses discovery.
>
> Setting .ctl_offs8 and .ops explicitly on spr_uncore_m3upi (matching
> spr_uncore_upi) avoids repeating them on the six discovered types,
> similar to commit "perf/x86/intel/uncore: Drop spr_uncore_mmio_ops for
> generic MMIO".
Agreed.
Your suggestion makes sense. I will adopt it in v2, which further
reduces ~10 LOC.
next prev parent reply other threads:[~2026-12-05 4:41 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 3:22 [PATCH 00/12] perf/x86/intel/uncore: Fix 64-bit counter config Zide Chen
2026-12-05 3:22 ` [PATCH 01/12] perf/x86/intel/uncore: Fix PCU filter band mask calculation Zide Chen
2026-12-05 3:22 ` [PATCH 02/12] perf/x86/intel/uncore: Fix ICX UPI and M3UPI box control offset Zide Chen
2026-12-05 3:22 ` [PATCH 03/12] perf/x86/intel/uncore: Replace CTL_OFFS8 box flag with type flag Zide Chen
2026-12-05 3:22 ` [PATCH 04/12] perf/x86/intel/uncore: Fix DMR MMIO counter control stride Zide Chen
2026-12-05 3:22 ` [PATCH 05/12] perf/x86/intel/uncore: Drop spr_uncore_mmio_ops for generic MMIO Zide Chen
2026-12-05 3:22 ` [PATCH 06/12] perf/x86/intel/uncore: Fix SPR/EMR/GNR/SRF IMC and HBM event formats Zide Chen
2026-12-05 3:49 ` sashiko-bot
2026-12-05 4:41 ` Chen, Zide
2026-12-05 3:22 ` [PATCH 07/12] perf/x86/intel/uncore: Program upper dword in generic ops Zide Chen
2026-12-05 3:22 ` [PATCH 08/12] perf/x86/intel/uncore: Drop spr_uncore_pci_ops for generic PCI Zide Chen
2026-12-05 3:46 ` sashiko-bot
2026-12-05 4:41 ` Chen, Zide [this message]
2026-12-05 3:22 ` [PATCH 09/12] perf/x86/intel/uncore: Fix SKX/SNR/ICX PCI extended umask truncation Zide Chen
2026-12-05 3:22 ` [PATCH 10/12] perf/x86/intel/uncore: Program SNR PCIe3 upper filter before enable Zide Chen
2026-12-05 3:22 ` [PATCH 11/12] perf/x86/intel/uncore: Consolidate SKX, SNR and ICX PCI uncore ops Zide Chen
2026-12-05 3:53 ` sashiko-bot
2026-12-05 4:42 ` Chen, Zide
2026-12-05 3:22 ` [PATCH 12/12] perf/x86/intel/uncore: Fix DMR IMC threshold field Zide Chen
2026-12-05 3:54 ` [PATCH 00/12] perf/x86/intel/uncore: Fix 64-bit counter config sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=93e415fd-514e-4b8f-be89-12e7daa68ebe@intel.com \
--to=zide.chen@intel.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.