From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.17 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796441671; b=SsDITMS4ogm6Y3M3Rmra7cDngxTwVWKj2qMI6ov1hQLr1+YAiPh9ceDs6Fu6QCn1rdIB 8xxRuEQDoEMDIX0UTjs/+PXolS+xY7szIXRbBFIwXwe98eyqZ6r7MrV8HLWdLOlBpZVyY 9TKjFa9AoSNPoYPSHAp8MJz51AUDWkXY2ZA7pr2ZltUMF7IN5DjCmUL1VP7I0Kw+wqi25 XgeVAT+Clx5juhs+KQv6CZKt9SFp+eLc076WUucmlrZu2hkbtLTvt+6SPhdisg1DxgSW3 Tjs2DoDHVZ1MLG6RYbABHhHl2pi1NB7dXhbu0YVVYT0SVNgmLuS3Lwof0S0tUqxh2MQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796441671; 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:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=UH3aUAx+lozMWwNQqshWjhk6L+JAEL2NULzyaehvapw=; b=yQEUdW+h4Y+eBJ54yR4IEEivSylXMULtIaOAvVH3gRy/4oH8ryvuBnO5Y+jMCluyorlW TA+fprFFTetvZkU3LGYeLz3DgrYZEXXBCtY/ILm/l1BNTHtVqqQnSNUXG/hnTAYF8CqL+ qho6R6i1wZBRWNptVI0hFGzdOk+UbnhEN+B9YnuILLz5In0GVxXBmyMk0vu5to8EvV8Sy ScG9hOwM33DaP3CtbaBOxSa5GCJR67S9mydWLoeWRS8teXlvP8yukdPxFJhn9pgVSoR6x NnRX5yq8gg+wB/ADyQgTO4q947/89pkrgo5+DwBEMhaNpGKV2V3I4rEELPrbVrz8Qhg== 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=UhWruFde; arc=none smtp.remote-ip=192.198.163.17 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 4F82B606A334; Sat, 5 Dec 2026 03:34:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4F82B606A334 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=UhWruFde DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796441672; x=1827977672; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UH3aUAx+lozMWwNQqshWjhk6L+JAEL2NULzyaehvapw=; b=UhWruFdePu4S9KK00L+mypBzopKMUatmXFgawgV+30M7Xs88jitRmpEX J6k/aD8M88sLmq8cryAn49n/vl4hyV/PJXAQlytC99OLZqor/l2yHn4hw fmqxqBSNh6xtmwZbkMhZ4Oq2xC8zCcWL2j7/I98uLfZAfkfqu9ZdzcCip nSGK1tIJygb5HQsOznluv66BSLSgLBKsg7205T4Gop3yAIj+DlW3Ezq/6 a7X9wHGdmtt00TdRQuWwo6VDFxp+vLUXuQgk1jz26WLgQgpMWxWZddqPF hGS3JtrcO719PXyCGs4XentGXKRvTBTCS3qt5golSPEP2Zw2+WEmU8XFa w==; X-CSE-ConnectionGUID: 6PYwLPYNQD2Ks8xHHsEVPQ== X-CSE-MsgGUID: 7zGLYatoQ36cPH3DIiwxIA== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5439742" X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="5439742" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 19:34:31 -0800 X-CSE-ConnectionGUID: TNRDhQULTAWdvRRIveAmIw== X-CSE-MsgGUID: +RvtL1iUQAyXp9aNwVfBnw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="14787712" Received: from 9cc2c43eec6b.jf.intel.com ([10.54.77.29]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 19:34:30 -0800 From: Zide Chen To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Adrian Hunter , Alexander Shishkin , Andi Kleen , Eranian Stephane Cc: Chun-Tse Shao , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Dapeng Mi , Zide Chen Subject: [PATCH 11/12] perf/x86/intel/uncore: Consolidate SKX, SNR and ICX PCI uncore ops Date: Fri, 4 Dec 2026 20:22:52 -0700 Message-ID: <20261205032253.258646-12-zide.chen@intel.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261205032253.258646-1-zide.chen@intel.com> References: <20261205032253.258646-1-zide.chen@intel.com> 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 Content-Transfer-Encoding: 8bit Now that snbep_uncore_pci_enable_event() programs the upper dword and ivbep_uncore_pci_init_box() uses uncore_pci_box_ctl(), customized PCI ops for SKX, SNR and ICX become redundant with ivbep_uncore_pci_ops. Switch the SKX UPI/M2M, SNR M2M and ICX UPI/M2M types to ivbep_uncore_pci_ops and drop their custom init_box and ops. No functional change intended. Signed-off-by: Zide Chen --- arch/x86/events/intel/uncore_snbep.c | 61 +++------------------------- 1 file changed, 5 insertions(+), 56 deletions(-) diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c index 4bc7e10fcaba..4e93b185790e 100644 --- a/arch/x86/events/intel/uncore_snbep.c +++ b/arch/x86/events/intel/uncore_snbep.c @@ -4168,23 +4168,6 @@ static const struct attribute_group skx_upi_uncore_format_group = { .attrs = skx_upi_uncore_formats_attr, }; -static int skx_upi_uncore_pci_init_box(struct intel_uncore_box *box) -{ - struct pci_dev *pdev = box->pci_dev; - - return pci_write_config_dword(pdev, uncore_pci_box_ctl(box), - IVBEP_PMON_BOX_CTL_INT); -} - -static struct intel_uncore_ops skx_upi_uncore_pci_ops = { - .init_box = skx_upi_uncore_pci_init_box, - .disable_box = snbep_uncore_pci_disable_box, - .enable_box = snbep_uncore_pci_enable_box, - .disable_event = snbep_uncore_pci_disable_event, - .enable_event = snbep_uncore_pci_enable_event, - .read_counter = snbep_uncore_pci_read_counter, -}; - static umode_t skx_upi_mapping_visible(struct kobject *kobj, struct attribute *attr, int die) { @@ -4322,7 +4305,7 @@ static struct intel_uncore_type skx_uncore_upi = { .event_mask_ext = SKX_UPI_CTL_UMASK_EXT, .box_ctl = SKX_UPI_PCI_PMON_BOX_CTL, .ctl_offs8 = 1, - .ops = &skx_upi_uncore_pci_ops, + .ops = &ivbep_uncore_pci_ops, .format_group = &skx_upi_uncore_format_group, .attr_update = skx_upi_attr_update, .get_topology = skx_upi_get_topology, @@ -4330,23 +4313,6 @@ static struct intel_uncore_type skx_uncore_upi = { .cleanup_mapping = skx_upi_cleanup_mapping, }; -static int skx_m2m_uncore_pci_init_box(struct intel_uncore_box *box) -{ - struct pci_dev *pdev = box->pci_dev; - - return pci_write_config_dword(pdev, SKX_M2M_PCI_PMON_BOX_CTL, - IVBEP_PMON_BOX_CTL_INT); -} - -static struct intel_uncore_ops skx_m2m_uncore_pci_ops = { - .init_box = skx_m2m_uncore_pci_init_box, - .disable_box = snbep_uncore_pci_disable_box, - .enable_box = snbep_uncore_pci_enable_box, - .disable_event = snbep_uncore_pci_disable_event, - .enable_event = snbep_uncore_pci_enable_event, - .read_counter = snbep_uncore_pci_read_counter, -}; - static struct intel_uncore_type skx_uncore_m2m = { .name = "m2m", .num_counters = 4, @@ -4357,7 +4323,7 @@ static struct intel_uncore_type skx_uncore_m2m = { .event_mask = SNBEP_PMON_RAW_EVENT_MASK, .box_ctl = SKX_M2M_PCI_PMON_BOX_CTL, .ctl_offs8 = 1, - .ops = &skx_m2m_uncore_pci_ops, + .ops = &ivbep_uncore_pci_ops, .format_group = &skx_uncore_format_group, }; @@ -4839,23 +4805,6 @@ void snr_uncore_cpu_init(void) uncore_msr_uncores = snr_msr_uncores; } -static int snr_m2m_uncore_pci_init_box(struct intel_uncore_box *box) -{ - struct pci_dev *pdev = box->pci_dev; - int box_ctl = uncore_pci_box_ctl(box); - - return pci_write_config_dword(pdev, box_ctl, IVBEP_PMON_BOX_CTL_INT); -} - -static struct intel_uncore_ops snr_m2m_uncore_pci_ops = { - .init_box = snr_m2m_uncore_pci_init_box, - .disable_box = snbep_uncore_pci_disable_box, - .enable_box = snbep_uncore_pci_enable_box, - .disable_event = snbep_uncore_pci_disable_event, - .enable_event = snbep_uncore_pci_enable_event, - .read_counter = snbep_uncore_pci_read_counter, -}; - static struct attribute *snr_m2m_uncore_formats_attr[] = { &format_attr_event.attr, &format_attr_umask_ext3.attr, @@ -4881,7 +4830,7 @@ static struct intel_uncore_type snr_uncore_m2m = { .event_mask_ext = SNR_M2M_PCI_PMON_UMASK_EXT, .box_ctl = SNR_M2M_PCI_PMON_BOX_CTL, .ctl_offs8 = 1, - .ops = &snr_m2m_uncore_pci_ops, + .ops = &ivbep_uncore_pci_ops, .format_group = &snr_m2m_uncore_format_group, }; @@ -5430,7 +5379,7 @@ static struct intel_uncore_type icx_uncore_m2m = { .event_mask_ext = SNR_M2M_PCI_PMON_UMASK_EXT, .box_ctl = SNR_M2M_PCI_PMON_BOX_CTL, .ctl_offs8 = 1, - .ops = &snr_m2m_uncore_pci_ops, + .ops = &ivbep_uncore_pci_ops, .format_group = &snr_m2m_uncore_format_group, }; @@ -5530,7 +5479,7 @@ static struct intel_uncore_type icx_uncore_upi = { .event_mask_ext = ICX_UPI_CTL_UMASK_EXT, .box_ctl = ICX_UPI_PCI_PMON_BOX_CTL, .ctl_offs8 = 1, - .ops = &skx_upi_uncore_pci_ops, + .ops = &ivbep_uncore_pci_ops, .format_group = &icx_upi_uncore_format_group, .attr_update = icx_upi_attr_update, .get_topology = icx_upi_get_topology, -- 2.56.1