From nobody Wed Dec 17 07:27:31 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17C55C4167B for ; Wed, 29 Nov 2023 08:19:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231225AbjK2ITO (ORCPT ); Wed, 29 Nov 2023 03:19:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229779AbjK2ITM (ORCPT ); Wed, 29 Nov 2023 03:19:12 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 339C81735; Wed, 29 Nov 2023 00:19:18 -0800 (PST) Date: Wed, 29 Nov 2023 08:19:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701245955; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k/uz1/fNwyG7HYXpXFVuptWMb0PsFl3St6R4c9tq+FI=; b=22furB+v3evXBmdnbvCjmg/jpkqFE955rZpphtEeRuCW08imirHTB/A7BY2tkqXVquvief PjT8FbcdlsV9GMpPG1oeb+APxNRw8mtZo2bY2PmO2z+roFgN9J/fuUnlwAKNcGp9Vw+NJi 0bvk0quqEzNcfB64FgTjXzqpd5BJhCS3gwrn57H4yn4CFU1wZzJGrVbQVaOL6+mS6+JD9D jTCRCacMQkKdC22shu2rYk7E2E1YdVD4+mKgnFNH5pnY7GE+aLZPj+DeqMcpogprTxQ9Qq aQ++Y4eH1FP6HGmg8wniWxNfVs+vKg9PEhNsE5LIcc9BKQKaflASArwz698STw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701245955; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k/uz1/fNwyG7HYXpXFVuptWMb0PsFl3St6R4c9tq+FI=; b=+2YVIwPl0heGj/5r1OIe6AYglYXpcFXS6LhcUAal9XMkg1obvSCbyukKCQW2eHkraJw4do uiCRi00aC/K3SfAQ== From: "tip-bot2 for Kan Liang" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86/intel/uncore: Support IIO free-running counters on GNR Cc: Kan Liang , "Peter Zijlstra (Intel)" , Ammy Yi , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231117163939.2468007-4-kan.liang@linux.intel.com> References: <20231117163939.2468007-4-kan.liang@linux.intel.com> MIME-Version: 1.0 Message-ID: <170124595523.398.17885878849892103147.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: 388d76175bd9bbad52bbff25c88361d9e5c6615e Gitweb: https://git.kernel.org/tip/388d76175bd9bbad52bbff25c88361d9e= 5c6615e Author: Kan Liang AuthorDate: Fri, 17 Nov 2023 08:39:38 -08:00 Committer: Peter Zijlstra CommitterDate: Fri, 24 Nov 2023 20:25:02 +01:00 perf/x86/intel/uncore: Support IIO free-running counters on GNR The free-running counters for IIO uncore blocks on Granite Rapids are similar to Sapphire Rapids. The key difference is the offset of the registers. The number of the IIO uncore blocks can also be retrieved from the discovery table. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Tested-by: Ammy Yi Link: https://lore.kernel.org/r/20231117163939.2468007-4-kan.liang@linux.in= tel.com --- arch/x86/events/intel/uncore_snbep.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/u= ncore_snbep.c index ab31cda..aeaa8ef 100644 --- a/arch/x86/events/intel/uncore_snbep.c +++ b/arch/x86/events/intel/uncore_snbep.c @@ -6648,11 +6648,21 @@ static struct intel_uncore_type *gnr_uncores[UNCORE= _GNR_NUM_UNCORE_TYPES] =3D { NULL, }; =20 +static struct freerunning_counters gnr_iio_freerunning[] =3D { + [SPR_IIO_MSR_IOCLK] =3D { 0x290e, 0x01, 0x10, 1, 48 }, + [SPR_IIO_MSR_BW_IN] =3D { 0x360e, 0x10, 0x80, 8, 48 }, + [SPR_IIO_MSR_BW_OUT] =3D { 0x2e0e, 0x10, 0x80, 8, 48 }, +}; + void gnr_uncore_cpu_init(void) { - uncore_msr_uncores =3D uncore_get_uncores(UNCORE_ACCESS_MSR, 0, NULL, + uncore_msr_uncores =3D uncore_get_uncores(UNCORE_ACCESS_MSR, + UNCORE_SPR_MSR_EXTRA_UNCORES, + spr_msr_uncores, UNCORE_GNR_NUM_UNCORE_TYPES, gnr_uncores); + spr_uncore_iio_free_running.num_boxes =3D uncore_type_max_boxes(uncore_ms= r_uncores, UNCORE_SPR_IIO); + spr_uncore_iio_free_running.freerunning =3D gnr_iio_freerunning; } =20 int gnr_uncore_pci_init(void)