From patchwork Thu Nov 16 14:22:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liang, Kan" X-Patchwork-Id: 165835 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp3244518vqg; Thu, 16 Nov 2023 06:23:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGuKrGZHexDvnU0hFJtB4j3cSJTqEbgWSngHsHJe1RrgIAavIuo/OhDL2PPn2EZOWPv2wI+ X-Received: by 2002:a05:6808:3c8d:b0:3b2:e12e:d2db with SMTP id gs13-20020a0568083c8d00b003b2e12ed2dbmr23866094oib.39.1700144607355; Thu, 16 Nov 2023 06:23:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700144607; cv=none; d=google.com; s=arc-20160816; b=oDB8QQfID6jVduLQFUdo6WQizrQPKfAc10gr/UUE7GNRmNPnR2bA0paQHWbBUaGmT8 zEEtaxeAF5a0yur0vcOX5MolJfdlAa0hyG/8wuuX5a9IV2QxEXvI72k4GCFdIId3oP6s 7nLScTzqUV41OCvGFRaqEFkZXITPCmquWaXqgpuBYEcZtF3wZB0h+k7VqSLejeCK6qf9 bDwyDzABTIzqGnKo7MfocABRpRFm8gMGtFF+JJtKAjBeva1n66bd4Ofq8UEieC8A4Vl0 5qvQy/a8Y0+W2Za+7763Ty6dweS47ua/K81DiUHHpkr1A7sB8KM9CFqkuug6Yk7MlrbG 9/Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/qFChWYVv/7MFgXKb8jaJObXe2w3+iuTUFBe6uGy9AU=; fh=xH4moCvQzsN+9ugM7JX/UQN3H6rCLhcemTuT12mMY/c=; b=YqeIU3aX7S+LzwfzqGn/AAMkxshndkXRUGdEwyz0tqWLgTPFjUXLrCSVe24LtfHFP1 MT6S6g5fEv4Vh3N+WUZKlG97KSZmPSNuutERKX8yuP9eePn8ZAIShPjEQi4xEcfcosBP fnpOtKUha7Vv1hi5C6kOArreCASDTbStgr0cSpfn5OzhvfNPhXgUnhIQ4znkXTgTwlgt QbRXc7crOgSxKdVpedV3tJyCc87/N0FT2b1w94grlVBg310qEiZ4hwynr+ntNmi4+6Bq JAweOHF2nlSHvU0xrxaEdxBmZvbocFhJPZbF9d911fAFAzeCdfuOozX8l2UIBcGUNR2t 647w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eOwURkwH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id u5-20020a656705000000b005bdfda8e04esi12336062pgf.800.2023.11.16.06.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 06:23:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eOwURkwH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D7491810498E; Thu, 16 Nov 2023 06:23:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345282AbjKPOXB (ORCPT + 30 others); Thu, 16 Nov 2023 09:23:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345314AbjKPOW7 (ORCPT ); Thu, 16 Nov 2023 09:22:59 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81336AD for ; Thu, 16 Nov 2023 06:22:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700144575; x=1731680575; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1vi0FmoGEosyvbhLqwxyW8wHJ0MxzfpdH8PFjiMsJG0=; b=eOwURkwHGMxeW2fUigjKr/inj8IQAnFu+y6HPcH9sZVt1cgQM+bmUO34 tU4t6T3nOU2SvaEDgGp2LUugXMhgNjBZ1UO6Gs8MphvIpz5QGTLvFgaTE J4T2So+qfwgxgu0aW49E+s8/xabXWTP8FXacTP/fd7s/SSxClROjXedDh h99tjyL4pg8No3aZ2LejnBRO6wOI5WgZmWRz80m6pWBg86cCk4RziuyxJ AdkVVR9TwVQmsIigju6mNH0q2yFHaVQPLYQYt1F5aXC6rZO9ieQz7fhmA f7HynmFt7QQjkjMKJbYYEdCFbmAdhGq35jjkOwSjVzm/Q+PRPdboF3bRw Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10896"; a="12644438" X-IronPort-AV: E=Sophos;i="6.04,308,1695711600"; d="scan'208";a="12644438" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2023 06:22:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10896"; a="800173374" X-IronPort-AV: E=Sophos;i="6.04,308,1695711600"; d="scan'208";a="800173374" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by orsmga001.jf.intel.com with ESMTP; 16 Nov 2023 06:22:50 -0800 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org Cc: artem.bityutskiy@linux.intel.com, rui.zhang@intel.com, Kan Liang Subject: [RESEND PATCH 4/4] perf/x86/intel/cstate: Add Grand Ridge support Date: Thu, 16 Nov 2023 06:22:45 -0800 Message-Id: <20231116142245.1233485-4-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20231116142245.1233485-1-kan.liang@linux.intel.com> References: <20231116142245.1233485-1-kan.liang@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 16 Nov 2023 06:23:24 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782730831945055507 X-GMAIL-MSGID: 1782730831945055507 From: Kan Liang 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 --- 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 4a46ef315284..4b50a3a9818a 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),