Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp464203lqb; Wed, 17 Apr 2024 01:21:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUSn1Lkixflf9rNhXOPviuhO99mdHIKi5yr10I1e/uO80Iug0yCXAqqZzq3YVH7VElgqgFOiZRDYajypJKut/03NZNnfrfPHdmrWinqIQ== X-Google-Smtp-Source: AGHT+IEFW24N9xzXTkuOswIlFIpgkN6RacLsb2y+dz/c8w6KZhJpPvDw3PpmVAVPowJQ1QBvMCdi X-Received: by 2002:a05:6a21:6711:b0:1a9:a898:8da6 with SMTP id wh17-20020a056a21671100b001a9a8988da6mr13873281pzb.48.1713342074556; Wed, 17 Apr 2024 01:21:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713342074; cv=pass; d=google.com; s=arc-20160816; b=E0HSS7ZIfZFSRNeuLqyxMJq0r2e9J5jvFoau/9LEg4y6DpSMbhgHvzsamGScT+ZjrZ kzsspO1d8QID1YRwHkxXLKa0KrIIxdY7Job6pIArvNSvXpjJiKL5yrDbFpm7oH6r3XOJ 058uGGNvw6w4f9sYIRfk8LSoExyT0PxoithIrCr0jIktrqpmwQQon4mZwEXcnXpg0L9k D4OThKeTpmyWcLDe6Jf1skU8kl0qKZ6QvJhMpnc7rC3F+68+wfCdFQ9SP1+l3RBI5GmF sif6oYY3UlOltA01WLQbLv5KbnzsyU71BJzwELKOpsvmb1YMPLRTrK4vP2OB1DH2MNZO p7dA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=njDZ3Qys9TWW2ee219+/Dxz5oFzd5wg1ifkWQDNhYAs=; fh=kYcBWCpw67d6rZE1fmv3uYMZqIXewfIYs44yjYCa1Cg=; b=A0y//gf1lqGBoV11zB2SuXSxsE66WHuTydK125XY2Xx/Vsd+1v2g3e8efuDoW8zh9Y ZuuZY9B0LUfgm6beOyvWMW3MNLjsEP4yPF+sbBzebLH68qGxnPzDQlnjzCnoYFhBtYM3 WOeBzOtdcuCrz3tV5MEytNvhPZP5v//yuUQh4AhTpqD13uQ9aW1p5ws7iX65osUAsUXA TKx0bbtNYlkRiZ5hgYl+9mCS8fmkrhL1i+jTlQiOruBMySBQA3EaD/lVaL67ZVbQiUlr ls0VEDi16wrnggqkvQchBYViWIslwvFamg5KgY3ZjxSMa95GEAB4hpN+9AcHn/hartiw oz6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="a4K0+uR/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-148125-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148125-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g12-20020a170902d1cc00b001e4bf0b7d1asi10896610plb.353.2024.04.17.01.21.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 01:21:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148125-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="a4K0+uR/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-148125-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148125-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 35A29284AB3 for ; Wed, 17 Apr 2024 08:21:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D545C7E563; Wed, 17 Apr 2024 08:21:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="a4K0+uR/" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7B295D8F6; Wed, 17 Apr 2024 08:21:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713342069; cv=none; b=gXPmn32Mh2WH7hhl/JHAChiE3s0ZgAd83FMIN57wOOLCkBUFxZhdeSspB8P/DYJBGPIwBjPQm0d9i5zsyHvzUEcJdzcQLg+yak/xws05iQsFhhSN4UnDP16OE3Dn6ymcNe4/HGFJCYQ5EOcz4DnnzeEMWsXQhfNsW7rNxfG7tf8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713342069; c=relaxed/simple; bh=n75R7c/Oh7vGZ60kh161ESLlcInlrQbqdPcmJ9fFJVA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=NKI7cRXAmYBsszIxW73cvt5jQBZF6fe4EoTyxeH4pwWuy0A/q/jjRXrflBMSdGKsC/Y95t44Y0t1MC3dyxTRbjK6kGxtHVHaLuh08wU9cHNXl3T0d0E3hgfKWyrd9wR276sRqUXAHABtBG7VEydYrMSQb6fq6bROksskomx1+YU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=a4K0+uR/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51783C32783; Wed, 17 Apr 2024 08:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713342069; bh=n75R7c/Oh7vGZ60kh161ESLlcInlrQbqdPcmJ9fFJVA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=a4K0+uR/k2z17A2pywiLxoy0vZO9lFEVelB4VBEjpEyYmS5TT4Z953zhvoWf7I6MK DIWO9lEYOnLkg+Hg0iqpKbxx5B/ZkdsLidlKZYQeMC7QSsWBEAbUIHcvLcxHakdhg1 tzY7o2Iav71HHrqOs9aIhkb1dS1w1F9cUnE+jmRNdAa2hkwjTqJ2s4Adko/bTeYLjF 6YNWsSu0H+2lhob3h6s2T8WqkXDs9vqv/1fbhknSI+IrXuRPcPYDcJl82+agzYzC6q wE3+hWsG6cxNCSV16gc0b33SRmILYlROlXFoRa3BqywZuaVZ9SvqCWBtralvh+aZdX PgB+CT2Cqs4lw== Received: by mail-oo1-f51.google.com with SMTP id 006d021491bc7-5a9ef9ba998so1395060eaf.1; Wed, 17 Apr 2024 01:21:09 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXdXg7XvJNxh5ZLfHzoprqfurVo4qicbJwV8jbCY7RnFhCK5+4c8ggU4r9cocGpRo4ymTTbYShGo4BU0tnkByKSwmRbHlCqnLECgG206WJieGhA2Dr0TVYAnAtrUzp12aY3C4GT3HQ= X-Gm-Message-State: AOJu0Yx9yjAxH/RvLsuFlI82t3E4rdKcV/A6RW0gLjyNAIgEWvpY3onH TnOJ00psG9kry8q1uHILxed5T/Tejc0rJlf3jc69OnNyY1KJgiN1akPMoDVy1xy2SHCSWzcwX3t 0dYsH4p5v1HQ1iI3ky/g9h/lJMv8= X-Received: by 2002:a05:6820:4187:b0:5ac:6fc1:c2cb with SMTP id fk7-20020a056820418700b005ac6fc1c2cbmr15321134oob.0.1713342068650; Wed, 17 Apr 2024 01:21:08 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240416211941.9369-1-tony.luck@intel.com> <20240416212204.9471-1-tony.luck@intel.com> In-Reply-To: <20240416212204.9471-1-tony.luck@intel.com> From: "Rafael J. Wysocki" Date: Wed, 17 Apr 2024 10:20:56 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 43/74] x86/cpu/vfm: Update drivers/cpufreq/intel_pstate.c To: Tony Luck Cc: "Rafael J. Wysocki" , Viresh Kumar , Srinivas Pandruvada , Len Brown , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 16, 2024 at 11:22=E2=80=AFPM Tony Luck wr= ote: > > New CPU #defines encode vendor and family as well as model. > > Signed-off-by: Tony Luck Acked-by: Rafael J. Wysocki > --- > drivers/cpufreq/intel_pstate.c | 90 +++++++++++++++++----------------- > 1 file changed, 44 insertions(+), 46 deletions(-) > > diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstat= e.c > index dbbf299f4219..685ec80e0af5 100644 > --- a/drivers/cpufreq/intel_pstate.c > +++ b/drivers/cpufreq/intel_pstate.c > @@ -2402,52 +2402,51 @@ static const struct pstate_funcs knl_funcs =3D { > .get_val =3D core_get_val, > }; > > -#define X86_MATCH(model, policy) = \ > - X86_MATCH_VENDOR_FAM_MODEL_FEATURE(INTEL, 6, INTEL_FAM6_##model, = \ > - X86_FEATURE_APERFMPERF, &polic= y) > +#define X86_MATCH(vfm, policy) \ > + X86_MATCH_VFM_FEATURE(vfm, X86_FEATURE_APERFMPERF, &policy) > > static const struct x86_cpu_id intel_pstate_cpu_ids[] =3D { > - X86_MATCH(SANDYBRIDGE, core_funcs), > - X86_MATCH(SANDYBRIDGE_X, core_funcs), > - X86_MATCH(ATOM_SILVERMONT, silvermont_funcs), > - X86_MATCH(IVYBRIDGE, core_funcs), > - X86_MATCH(HASWELL, core_funcs), > - X86_MATCH(BROADWELL, core_funcs), > - X86_MATCH(IVYBRIDGE_X, core_funcs), > - X86_MATCH(HASWELL_X, core_funcs), > - X86_MATCH(HASWELL_L, core_funcs), > - X86_MATCH(HASWELL_G, core_funcs), > - X86_MATCH(BROADWELL_G, core_funcs), > - X86_MATCH(ATOM_AIRMONT, airmont_funcs), > - X86_MATCH(SKYLAKE_L, core_funcs), > - X86_MATCH(BROADWELL_X, core_funcs), > - X86_MATCH(SKYLAKE, core_funcs), > - X86_MATCH(BROADWELL_D, core_funcs), > - X86_MATCH(XEON_PHI_KNL, knl_funcs), > - X86_MATCH(XEON_PHI_KNM, knl_funcs), > - X86_MATCH(ATOM_GOLDMONT, core_funcs), > - X86_MATCH(ATOM_GOLDMONT_PLUS, core_funcs), > - X86_MATCH(SKYLAKE_X, core_funcs), > - X86_MATCH(COMETLAKE, core_funcs), > - X86_MATCH(ICELAKE_X, core_funcs), > - X86_MATCH(TIGERLAKE, core_funcs), > - X86_MATCH(SAPPHIRERAPIDS_X, core_funcs), > - X86_MATCH(EMERALDRAPIDS_X, core_funcs), > + X86_MATCH(INTEL_SANDYBRIDGE, core_funcs), > + X86_MATCH(INTEL_SANDYBRIDGE_X, core_funcs), > + X86_MATCH(INTEL_ATOM_SILVERMONT, silvermont_funcs), > + X86_MATCH(INTEL_IVYBRIDGE, core_funcs), > + X86_MATCH(INTEL_HASWELL, core_funcs), > + X86_MATCH(INTEL_BROADWELL, core_funcs), > + X86_MATCH(INTEL_IVYBRIDGE_X, core_funcs), > + X86_MATCH(INTEL_HASWELL_X, core_funcs), > + X86_MATCH(INTEL_HASWELL_L, core_funcs), > + X86_MATCH(INTEL_HASWELL_G, core_funcs), > + X86_MATCH(INTEL_BROADWELL_G, core_funcs), > + X86_MATCH(INTEL_ATOM_AIRMONT, airmont_funcs), > + X86_MATCH(INTEL_SKYLAKE_L, core_funcs), > + X86_MATCH(INTEL_BROADWELL_X, core_funcs), > + X86_MATCH(INTEL_SKYLAKE, core_funcs), > + X86_MATCH(INTEL_BROADWELL_D, core_funcs), > + X86_MATCH(INTEL_XEON_PHI_KNL, knl_funcs), > + X86_MATCH(INTEL_XEON_PHI_KNM, knl_funcs), > + X86_MATCH(INTEL_ATOM_GOLDMONT, core_funcs), > + X86_MATCH(INTEL_ATOM_GOLDMONT_PLUS, core_funcs), > + X86_MATCH(INTEL_SKYLAKE_X, core_funcs), > + X86_MATCH(INTEL_COMETLAKE, core_funcs), > + X86_MATCH(INTEL_ICELAKE_X, core_funcs), > + X86_MATCH(INTEL_TIGERLAKE, core_funcs), > + X86_MATCH(INTEL_SAPPHIRERAPIDS_X, core_funcs), > + X86_MATCH(INTEL_EMERALDRAPIDS_X, core_funcs), > {} > }; > MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids); > > static const struct x86_cpu_id intel_pstate_cpu_oob_ids[] __initconst = =3D { > - X86_MATCH(BROADWELL_D, core_funcs), > - X86_MATCH(BROADWELL_X, core_funcs), > - X86_MATCH(SKYLAKE_X, core_funcs), > - X86_MATCH(ICELAKE_X, core_funcs), > - X86_MATCH(SAPPHIRERAPIDS_X, core_funcs), > + X86_MATCH(INTEL_BROADWELL_D, core_funcs), > + X86_MATCH(INTEL_BROADWELL_X, core_funcs), > + X86_MATCH(INTEL_SKYLAKE_X, core_funcs), > + X86_MATCH(INTEL_ICELAKE_X, core_funcs), > + X86_MATCH(INTEL_SAPPHIRERAPIDS_X, core_funcs), > {} > }; > > static const struct x86_cpu_id intel_pstate_cpu_ee_disable_ids[] =3D { > - X86_MATCH(KABYLAKE, core_funcs), > + X86_MATCH(INTEL_KABYLAKE, core_funcs), > {} > }; > > @@ -3386,14 +3385,13 @@ static inline void intel_pstate_request_control_f= rom_smm(void) {} > > #define INTEL_PSTATE_HWP_BROADWELL 0x01 > > -#define X86_MATCH_HWP(model, hwp_mode) \ > - X86_MATCH_VENDOR_FAM_MODEL_FEATURE(INTEL, 6, INTEL_FAM6_##model, = \ > - X86_FEATURE_HWP, hwp_mode) > +#define X86_MATCH_HWP(vfm, hwp_mode) \ > + X86_MATCH_VFM_FEATURE(vfm, X86_FEATURE_HWP, hwp_mode) > > static const struct x86_cpu_id hwp_support_ids[] __initconst =3D { > - X86_MATCH_HWP(BROADWELL_X, INTEL_PSTATE_HWP_BROADWELL), > - X86_MATCH_HWP(BROADWELL_D, INTEL_PSTATE_HWP_BROADWELL), > - X86_MATCH_HWP(ANY, 0), > + X86_MATCH_HWP(INTEL_BROADWELL_X, INTEL_PSTATE_HWP_BROADWEL= L), > + X86_MATCH_HWP(INTEL_BROADWELL_D, INTEL_PSTATE_HWP_BROADWEL= L), > + X86_MATCH_HWP(INTEL_ANY, 0), > {} > }; > > @@ -3426,15 +3424,15 @@ static const struct x86_cpu_id intel_epp_default[= ] =3D { > * which can result in one core turbo frequency for > * AlderLake Mobile CPUs. > */ > - X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L, HWP_SET_DEF_BALANCE_PERF_= EPP(102)), > - X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, HWP_SET_DEF_BALANCE_= PERF_EPP(32)), > - X86_MATCH_INTEL_FAM6_MODEL(METEORLAKE_L, HWP_SET_EPP_VALUES(HWP_E= PP_POWERSAVE, > - HWP_EPP_BALANCE_P= OWERSAVE, 115, 16)), > + X86_MATCH_VFM(INTEL_ALDERLAKE_L, HWP_SET_DEF_BALANCE_PERF_EPP(102= )), > + X86_MATCH_VFM(INTEL_SAPPHIRERAPIDS_X, HWP_SET_DEF_BALANCE_PERF_EP= P(32)), > + X86_MATCH_VFM(INTEL_METEORLAKE_L, HWP_SET_EPP_VALUES(HWP_EPP_POWE= RSAVE, > + HWP_EPP_BALANCE_POWERSAVE, 115, 16)), > {} > }; > > static const struct x86_cpu_id intel_hybrid_scaling_factor[] =3D { > - X86_MATCH_INTEL_FAM6_MODEL(METEORLAKE_L, HYBRID_SCALING_FACTOR_MT= L), > + X86_MATCH_VFM(INTEL_METEORLAKE_L, HYBRID_SCALING_FACTOR_MTL), > {} > }; > > -- > 2.44.0 >