Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2658412rdg; Mon, 16 Oct 2023 10:41:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0M2spTOSMJezvwQ/XkV8kscGW7hwZXm6XpEn1X3Z2htEv7E3cMX5Uk8FQ7LwjacvNpppD X-Received: by 2002:a05:6a20:8f08:b0:154:d3ac:2076 with SMTP id b8-20020a056a208f0800b00154d3ac2076mr37066672pzk.40.1697478061550; Mon, 16 Oct 2023 10:41:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697478061; cv=none; d=google.com; s=arc-20160816; b=au0xDKcA2ZqLjEx0tQqS4jGuaWveq/4/np5Xypg5OzBloEQIl4YRl7OmnJ1NsUHI+x STAaJ98wQJaMV2RO2hhh+Ym9cZFc1jJOtb8vvEFg2XgqEKHHN2W5jhSC0QNICpDeqPQa 8/EauktIkAly2ddYzdfCnM99B1G4/P/i7xD2ZUuRkImCUBs0Y8d0kingBqW58DxCsdmj WieXSuABhes2P5fAHgLXFdA/+Ktlt2nhWJjn6X3M62/QzLacd3QAoN+DcugzTsogM1yD fPIVABawHRbU6xhewJ2A497eBUX4rB6VfpSSCbBkS5FMct5EpNMukdvLiqzJYGeYb3nh GGZg== 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=VVqRRWi96EXEqIC+a67U+M3C10Txp4uO0A5285AkKixU5t8J6lKYC5vINE760wi27P PyfBCcskVm+3lPV53z9ULGHLzHR+fXZ7KPf4O1egUtM6VNRuE5mHIUHtGA/YVIj8wSBF u5TQyOybp2mF2dPsk9rMjpL8FbJvxeoJ7WQ8SN1TrNId2GW4n/2xXkDGITLGjW14SSzH HpstrjXMGqELDOfNRB09ThvbvMMtPGAyUovtXD9kTHy9BjT1sovqNxKyaMqa0ag4cnCf VrZ9w4/sRmNN3rrXJCD+QbC/HpAQ23IMIHypgbIbaFd6tNWlUVNxdKUoI66zjLWgyNGn x3ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FCf2MXlU; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id az1-20020a056a02004100b005897813623fsi11166743pgb.470.2023.10.16.10.41.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 10:41:01 -0700 (PDT) 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=@intel.com header.s=Intel header.b=FCf2MXlU; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4606B803D726; Mon, 16 Oct 2023 10:40:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233833AbjJPRki (ORCPT + 99 others); Mon, 16 Oct 2023 13:40:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232837AbjJPRka (ORCPT ); Mon, 16 Oct 2023 13:40:30 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A6FFA2 for ; Mon, 16 Oct 2023 10:40:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697478028; x=1729014028; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1vi0FmoGEosyvbhLqwxyW8wHJ0MxzfpdH8PFjiMsJG0=; b=FCf2MXlUSy8ZCTH8ADKe/jNjvzDhwSmFIaXK+51byFWC3/opVq30X7W1 i/cS+gyeUoIATI5AbfGpOWqe1mAYX5fXmy3FzE/vSxtgauroS+RQdpJP+ NGUeUJTpypkRY9J/mHvnMPnrqJdVY5fT6/GZCyGvRFiLqaLgXuzJHVKtg V7JEIZ63fsDBJfPh3Ipfn0t0vqi3rgmEFDItbilkx5hNyFf1hDu4y7d1l 8H4EvTRRBUrAVSl2vRYRtNFOVIRMIjuAHUCwngo8LS9DQaa4HWGgVc4c0 vWyzbJTBP8VjI/hZHkm8MV22St1ChmgEfqUVdukMB6uBj/TwbE8t9V+6K g==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="365858563" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="365858563" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 10:40:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="785175364" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="785175364" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by orsmga008.jf.intel.com with ESMTP; 16 Oct 2023 10:40:22 -0700 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: [PATCH 4/4] perf/x86/intel/cstate: Add Grand Ridge support Date: Mon, 16 Oct 2023 10:40:14 -0700 Message-Id: <20231016174014.453169-4-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20231016174014.453169-1-kan.liang@linux.intel.com> References: <20231016174014.453169-1-kan.liang@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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, 16 Oct 2023 10:40:59 -0700 (PDT) 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), -- 2.35.1