From patchwork Wed Nov 29 08:19:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 171148 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a5a7:0:b0:403:3b70:6f57 with SMTP id d7csp192750vqn; Wed, 29 Nov 2023 00:19:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAwiPK9Vk4872AuIPFQ5TA591Osmu99d2tppcw42YLfmAThOZPVvwaNfIUWocCvvRN47cD X-Received: by 2002:a05:6830:2b14:b0:6d8:16f4:d303 with SMTP id l20-20020a0568302b1400b006d816f4d303mr17560888otv.27.1701245969424; Wed, 29 Nov 2023 00:19:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701245969; cv=none; d=google.com; s=arc-20160816; b=WWr8NvH27ZkVcLxjzzAk4giYGK3c9H2KsDTHnvhMWdvyObOGXYl93r5EgUcUXSu5kA W3fq1Azwdx7azfjMIs7T+DRokDUJUFasOIyD+6H+2bMmOpIsDdnp8ITYyzvIoo0IViV7 Ubugf8y6EUAjVDDgIlTqe6UD2+QJJSwCOcljCIDx5eBKboMKY7PbLLpZlj0cNfMC3mPA lsSggc+ZZc6QQ/ejWtSdNZoVoB+9jgTAJpCmMSp3FDIF39ucFTkadIr58EbApngJ0hEv uJqy6Ey59dvc6YUknkOAi4t3ngOKyWEAJ4n7hixtRFn+h/2epeEvWhpaAs0KYqJtVGnF NBIA== 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 header.s=2020e header.b=+2YVIwPl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id 8-20020a631448000000b00578b9fb24f6si13792495pgu.616.2023.11.29.00.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 00:19:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; 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 header.s=2020e header.b=+2YVIwPl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 8CEC880A80DD; Wed, 29 Nov 2023 00:19:26 -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 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:26 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782830036574761866 X-GMAIL-MSGID: 1783885693523600957 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)