Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4416043rdh; Wed, 29 Nov 2023 00:19:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5N00As91XsUDcRsJMKdOa3U14jGNecePT9uQc9ncy+ZmJAwrZRc2Ye7T3mRlZFFc1KoPV X-Received: by 2002:a17:90a:de82:b0:280:4c83:5f31 with SMTP id n2-20020a17090ade8200b002804c835f31mr15570502pjv.48.1701245975223; Wed, 29 Nov 2023 00:19:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701245975; cv=none; d=google.com; s=arc-20160816; b=HRD8t8Kg/utIfHDOI82ndWCmndnI18VHfrb28Njwk6bIiExYruB1ZqD0fvlUEiTN0Y uxYXbagxViwotDuk0uHeiq1HEjqS7OJzqLqqQcNN3WjU9WRTlm+VZyeUyMt/X+rEQGCG AjgrodlxQ5kFPoGHnA8BahnLwaCNZrlL2dXLwTbkutOM/nDtZx70lMtxyUdmiutmI8ih oGUg2dGuRvAKNbTAFJWdATf4tfgoq6c9mZGhmR5137OEDq1szknihFZI8BsntyUZqzy7 DzmrB90C3I1pgEN3bTgJCEMYX9qrw+QIdZiTM139apCW6BfU7p1illwzal64pQc9TkDs ZUuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=k/uz1/fNwyG7HYXpXFVuptWMb0PsFl3St6R4c9tq+FI=; fh=guNTip1gghJyPTtuudVxgoWLqscAZe1uQmU0RTepgqw=; b=VSGBp+ROuaZNCvWBjtXBxFwf6SO8268lEv3XNMNWD+E9FdW3t5TeP3mDhdeFl8K1Ri e8e8V9Ln3H9FvpXwIwl6qbaOWI4ahh8IDcYJHn6OrkyhhAcBUQs5BHz7B1L6+VRX7DXG cz/TxH6nClp/q51QDNlo6sDSYb1hv2JhBjvYRbdZwtY1Lm4p7dFT7G9rzEObC00whs+F +4SRNO6ses5EdVPbpmgV3jQd9pCmFCPkpUZa2EPwLzczZZWsLuDt8CaS4Zt6NE1fDmNH phsttMJnYcjzXx/H9q/DXZ7gj0DTm102at2ao4ZEbrIAJMgdi2w2q81A5ZVKdq2ka5E6 U2KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=22furB+v; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id u17-20020a17090ae01100b00285ba36dc4csi526613pjy.0.2023.11.29.00.19.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 00:19:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=22furB+v; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0A8A480A80E4; Wed, 29 Nov 2023 00:19:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230263AbjK2ITN (ORCPT + 99 others); Wed, 29 Nov 2023 03:19:13 -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: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 29 Nov 2023 00:19:31 -0800 (PST) The following commit has been merged into the perf/core branch of tip: Commit-ID: 388d76175bd9bbad52bbff25c88361d9e5c6615e Gitweb: https://git.kernel.org/tip/388d76175bd9bbad52bbff25c88361d9e5c6615e 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.intel.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/uncore_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] = { NULL, }; +static struct freerunning_counters gnr_iio_freerunning[] = { + [SPR_IIO_MSR_IOCLK] = { 0x290e, 0x01, 0x10, 1, 48 }, + [SPR_IIO_MSR_BW_IN] = { 0x360e, 0x10, 0x80, 8, 48 }, + [SPR_IIO_MSR_BW_OUT] = { 0x2e0e, 0x10, 0x80, 8, 48 }, +}; + void gnr_uncore_cpu_init(void) { - uncore_msr_uncores = uncore_get_uncores(UNCORE_ACCESS_MSR, 0, NULL, + uncore_msr_uncores = 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 = uncore_type_max_boxes(uncore_msr_uncores, UNCORE_SPR_IIO); + spr_uncore_iio_free_running.freerunning = gnr_iio_freerunning; } int gnr_uncore_pci_init(void)