Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3311932rdb; Thu, 16 Nov 2023 06:23:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0ud2tl9lkuBEnEdOotrG2AyYd6xjLFwFAFii3rugI9dxk1jJkEWM7G3roadppW82Ypw58 X-Received: by 2002:a05:6a20:4297:b0:187:dd5f:93b9 with SMTP id o23-20020a056a20429700b00187dd5f93b9mr1027458pzj.14.1700144591625; Thu, 16 Nov 2023 06:23:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700144591; cv=none; d=google.com; s=arc-20160816; b=IOCtA4Zq5YAx0+xy03BIEz7VpkkF2mNHCTaSMGefxAFEEQ81Uhs6vbTTmm53iAelWP CjpxdDV0vUFkEdxy+YPdogUloZD8V+kq2yVwJ/9lTS0fPH9MGH3o5gdHUfk8ppVW1joc n1tQy+HC2B0U1seT14+8fcjrghsb6Pv9sQhqLpQcsDmdts9EG7AHizvweqcXhhoJGbYV 5Fk0ocmLuectd5aUlx/nQUFcRreo6gpYnS9f/6/5H1/R04fOJUox0KcKIl15+b5yoh2i 7xJAv1p7vN7chdWfsxrg8Nqj5BidBoqB+jH+JXD6lHr7XY+gZGOiXw1qpGCanLNeJ6Mq 5SCw== 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.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id g129-20020a636b87000000b005b834096959si12106708pgc.851.2023.11.16.06.23.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 06:23:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; 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.37 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 snail.vger.email (Postfix) with ESMTP id 9E0098218E77; Thu, 16 Nov 2023 06:23:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345318AbjKPOXB (ORCPT + 99 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Thu, 16 Nov 2023 06:23:07 -0800 (PST) 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