From patchwork Mon Nov 20 14:35:37 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: 167179 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp2245884vqn; Mon, 20 Nov 2023 06:38:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWPSp+DV7FjqTN67UvcWEpIbIoQqHPW4wXUT+ExbulFN2PafeejB2S3VuilMMcEhLQ7hyr X-Received: by 2002:a05:6a20:dd9f:b0:187:f342:5079 with SMTP id kw31-20020a056a20dd9f00b00187f3425079mr5780787pzb.32.1700491107036; Mon, 20 Nov 2023 06:38:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700491107; cv=none; d=google.com; s=arc-20160816; b=UIg4KVhC9mQzMuYs8Ejm/hiIu+mBhr042H8agwad9fjQWluPPftJa9/XK4R8XXUdmj zs18aSBXuzyWaP/TA8PIbkqWVdF/himdR7c20cD+f4CQT5K/M1wj/l3uWZ2pSPoMNt2B fNW4PpLJnbCC2QRiCpljwuLx9SyiulEAw9i84yUt3Tl9+Sz6qSA+oufX6rUfIRX9PjQX xW9YmwXH9ZlMuF0JP7oMJQFRiQju1W+Uq+gEfunAf+FpdkSe1HH/nySxvPtoF0pevS2q 8Asg99eVoCbuk25HEf8utiBMyEfIvQL3JE374wYWqd6xdeqK3zV3LWm77Xw6CEdC06B8 dGJw== 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=A7zldWwl7dHHlFIYTKVjKhMwvreh2w4NaLYmY3SinWk=; fh=hNrfQAbYh3Z2DJEENGJHk2DI4zZ1Z/35CV7+DFUZfaE=; b=ruK8RVOkBOYJW6k14YXPc3FpYHpxSrN6YpvugA8DOX0ke2QHhtiNoKePQ0rUgtc6iN IdEtR0QMUuc4CzzIYhMqjotIrgvo5URfNEmed2IloRci3vr6nHx1lsETQSwZO9H1uh2S FA8YLSg0o/nUW6gpkEjcb0KCbsIUePyXmNJ67ENXnG0FDiN+i4F6dkGNMg4nFd6dKh/G cgjKYIhFIXDPfyNK/3QsCndluh9QGqAF9zy1lF3mZlkSpjGRW67Zd+b4Bj2yYkXPAibF VJNBivaDMc4oW6+jy5QAYYVU+7qxhyyqdTjWhkKd508YyLvjZAI5ZwlD0ZISeSU2pmBD eedw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fkCp2FPl; 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:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id ca1-20020a17090af30100b0028525af01bfsi2259202pjb.135.2023.11.20.06.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 06:38:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fkCp2FPl; 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:3 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 lipwig.vger.email (Postfix) with ESMTP id 4606E807072B; Mon, 20 Nov 2023 06:36:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233481AbjKTOfq (ORCPT + 27 others); Mon, 20 Nov 2023 09:35:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233451AbjKTOfo (ORCPT ); Mon, 20 Nov 2023 09:35:44 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DF65112; Mon, 20 Nov 2023 06:35:40 -0800 (PST) Date: Mon, 20 Nov 2023 14:35:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1700490939; 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=A7zldWwl7dHHlFIYTKVjKhMwvreh2w4NaLYmY3SinWk=; b=fkCp2FPlGxZivFsHHEtrV8dbpDknBljKvECk3nVeTAwJ83yA0wztTBsgd1r2NuYsEZ8rn9 ngIN3IHDTlnq1zAgkZ/bg4QIPrnFYCOsPan0vt4dZOanzmaNyW5jTcIkhwEjHDfzXKaRKA fsQaQuXYJRVW9nmge7Z36HyMBv/ggoR/XHguPMAJxspgd8GFjYn0FBj/GmCmUWfzJoqe2Y qT7CL/kqVxH/SE2QNSnkldoHDCMqYNIzyE/I3P7PVo77rd6zs0wh0rRTuv0jh9+w8q+R1X QMrBKZNV+3chGYWkMYyNHphD4TkRiHW8x6VICtjfjMZytOj/MaNpf8YLqm646w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1700490939; 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=A7zldWwl7dHHlFIYTKVjKhMwvreh2w4NaLYmY3SinWk=; b=D54HCzbVlY2lrVNTpmIfaJRS6YqFvzUoCHLHyeo0c7y2rPRX/ziJDu61+4EblIOlRcEzt3 HUQbEjeQzaHWUpDQ== 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/cstate: Add Grand Ridge support Cc: Kan Liang , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231116142245.1233485-4-kan.liang@linux.intel.com> References: <20231116142245.1233485-4-kan.liang@linux.intel.com> MIME-Version: 1.0 Message-ID: <170049093761.398.5173457505104553782.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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 06:36:07 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782730831945055507 X-GMAIL-MSGID: 1783094162854832843 The following commit has been merged into the perf/core branch of tip: Commit-ID: bbb968696d0f3442ab823598def3b756cf4735c6 Gitweb: https://git.kernel.org/tip/bbb968696d0f3442ab823598def3b756cf4735c6 Author: Kan Liang AuthorDate: Thu, 16 Nov 2023 06:22:45 -08:00 Committer: Peter Zijlstra CommitterDate: Fri, 17 Nov 2023 10:54:53 +01:00 perf/x86/intel/cstate: Add Grand Ridge support The same as the Sierra Forest, the Grand Ridge supports core C1/C6 and module C6. But it doesn't support pkg C6 residency counter. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20231116142245.1233485-4-kan.liang@linux.intel.com --- arch/x86/events/intel/cstate.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c index 4a46ef3..4b50a3a 100644 --- a/arch/x86/events/intel/cstate.c +++ b/arch/x86/events/intel/cstate.c @@ -41,7 +41,7 @@ * MSR_CORE_C1_RES: CORE C1 Residency Counter * perf code: 0x00 * Available model: SLM,AMT,GLM,CNL,ICX,TNT,ADL,RPL - * MTL,SRF + * MTL,SRF,GRR * Scope: Core (each processor core has a MSR) * MSR_CORE_C3_RESIDENCY: CORE C3 Residency Counter * perf code: 0x01 @@ -52,7 +52,8 @@ * perf code: 0x02 * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW, * SKL,KNL,GLM,CNL,KBL,CML,ICL,ICX, - * TGL,TNT,RKL,ADL,RPL,SPR,MTL,SRF + * TGL,TNT,RKL,ADL,RPL,SPR,MTL,SRF, + * GRR * Scope: Core * MSR_CORE_C7_RESIDENCY: CORE C7 Residency Counter * perf code: 0x03 @@ -99,7 +100,7 @@ * Scope: Package (physical package) * MSR_MODULE_C6_RES_MS: Module C6 Residency Counter. * perf code: 0x00 - * Available model: SRF + * Available model: SRF,GRR * Scope: A cluster of cores shared L2 cache * */ @@ -677,6 +678,13 @@ static const struct cstate_model glm_cstates __initconst = { BIT(PERF_CSTATE_PKG_C10_RES), }; +static const struct cstate_model grr_cstates __initconst = { + .core_events = BIT(PERF_CSTATE_CORE_C1_RES) | + BIT(PERF_CSTATE_CORE_C6_RES), + + .module_events = BIT(PERF_CSTATE_MODULE_C6_RES), +}; + static const struct cstate_model srf_cstates __initconst = { .core_events = BIT(PERF_CSTATE_CORE_C1_RES) | BIT(PERF_CSTATE_CORE_C6_RES), @@ -739,6 +747,7 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = { X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L, &glm_cstates), X86_MATCH_INTEL_FAM6_MODEL(ATOM_GRACEMONT, &adl_cstates), X86_MATCH_INTEL_FAM6_MODEL(ATOM_CRESTMONT_X, &srf_cstates), + X86_MATCH_INTEL_FAM6_MODEL(ATOM_CRESTMONT, &grr_cstates), X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_L, &icl_cstates), X86_MATCH_INTEL_FAM6_MODEL(ICELAKE, &icl_cstates),