From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.16 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796445708; b=1e+8p8VP9u+Nkm1f/XsKtk+qtrbSs62Zp3SdA/S9QZZq92PSVzG0yvyE443hnN7LgWcy hfxRnA7Fy461OCafkPSUXmqUoMGbwrcEdrvf8bd4rJJWk1413liUR3wR8MuZvVLdrCLjO sFZeunwawDnohi+wLhdoPSEV14fauE2qE7lAP8rNqIpJesju5pY7IUh7KXzdGYsaxq04x DlPlmGxEC43mF83+0J22FglmySghrlxSSjYnL3Lwo4vXRabhXK+6W8M4svCaecpkuc2lr T/g8l573rZiVw/6SFJHLNTJXm8b1IAHcxrQR0RnSEPk0dHyWaMoTTPC7tdiSk2VpaiQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796445708; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=mOUE4zB1gDKVWTQNbtwJ7mQB/p4P2lu2VJQDZ++kGmU=; b=b35MN0GpYvybHUMLeskXzFnCeY+k1mAD1fdqks0qInr8Fp8oRtKB/0qfxSw9SpzUgkdU R/3u83UDRckk7+Tv9xSwwh9km58hG1cCtZ466E1wCRPWjKPJJnPaRElygMSYU5K5wA96o XTXkpudcOLtCPUpXTEk4hcvS6cNN4dOf6k6w2avlV0Id2yo2cPov5rYd0+l6qtNU5JAoM TbJLdsOsbuCWsCpocYs/3tNQkYbjlcmh3KmZ3FVfsEpCZCkaj2pYgILl/3ry3+S18kWl6 h1Vv7VI1bWo6AEaj9b7zQUpqH8I7f9N7Jjd3Elpk8eNtnKH3tF03vCVsj2F4GyjVl7A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=h2BR8Er2; arc=none smtp.remote-ip=192.198.163.16 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1367606A32D for ; Sat, 5 Dec 2026 04:41:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E1367606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=h2BR8Er2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796445708; x=1827981708; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=mOUE4zB1gDKVWTQNbtwJ7mQB/p4P2lu2VJQDZ++kGmU=; b=h2BR8Er24QlqYZjU1uqstjIX3+KpbnJVqp+I+7aRcVeIYmF9Zh9UOaOM wbol89eapj7bwvTwufLLM+v6NtQN2DxaS8cp0KLg8Ofs4swfG3r11z63T y40uq4tDXzz2a0y1R8WlkyZtcYNS14uvYcbjHd2vLX5idos5hveW4Pa0D q6DTzPjvk3aesGR81IHnLRMcnfGRYObkYUTv1ple18TZk3UwtnW0xgs0V QRAoS1CfCTJlGOuiV7SleQuyOl5CZcHlnxA+qwWdyn+r2c4UQePaAoBep GU7YzIcgg8B+3hnd7ikJ5AQursQ0XS8VQ+pdbjPQZzziPocPWjeHxObKZ A==; X-CSE-ConnectionGUID: FgUmpA2YT92CicAUZLaFRw== X-CSE-MsgGUID: KJBASlbVTBqMRH/5Va1kHA== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5436841" X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="5436841" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 20:41:47 -0800 X-CSE-ConnectionGUID: R3pYWP/RQ2y8xCFPnpLSrQ== X-CSE-MsgGUID: nKXx/XlFSlSxdz9Ki+3otA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="14021698" Received: from hjeisenb-mobl.amr.corp.intel.com (HELO [10.246.162.21]) ([10.246.162.21]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 20:41:47 -0800 Message-ID: <93e415fd-514e-4b8f-be89-12e7daa68ebe@intel.com> Date: Fri, 4 Dec 2026 22:41:46 -0600 X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 08/12] perf/x86/intel/uncore: Drop spr_uncore_pci_ops for generic PCI To: sashiko-reviews@lists.linux.dev Cc: linux-perf-users@vger.kernel.org References: <20261205032253.258646-1-zide.chen@intel.com> <20261205032253.258646-9-zide.chen@intel.com> Content-Language: en-US From: "Chen, Zide" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 > > 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.