Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2176812lqa; Tue, 30 Apr 2024 10:01:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwB9Nq5VuHzSJOjXTYZo1qtgOwp3F0p3FO4hPgHaaMGRbFU0eX2DlA/lajuRmNwRXBvmzVyYCyDssDXrAYGB6zRLqFbR957momjqOE0w== X-Google-Smtp-Source: AGHT+IETve5rnj2U2vDuQ2e6VTL+pQlYqIngE+C5DFeGJC04KiphyndNcZEsH7pLuFWayjjwDTrW X-Received: by 2002:a05:6a00:80a:b0:6ea:7468:1f31 with SMTP id m10-20020a056a00080a00b006ea74681f31mr253393pfk.30.1714496488668; Tue, 30 Apr 2024 10:01:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714496488; cv=pass; d=google.com; s=arc-20160816; b=yRKhbHWTl2LiJIXPgkXo+HDiiLuJt5qetXqlwFqlY+oZwosJABBRYHI7ZxXOnAxrjH MtF96/Rh6lMfVXgSjHkYrDZyDQLC3zAaYeb1HbMkd+EOfbLXA4XjKbjTH4S6eNNVuUk7 bBl3YUGc0CL4EB+UHOlEzpATtb3y4qBXhd+A/xAREnbHhjE9cjSJGbR2++gXkTVW8DZP PZ3sRMAqEo/iHz8sm7SYWknp7zLoYcEatALuzd1/xjRLHoAZD8BX2Xn4JKBL8fr6R0YV 8A6ArZhwRnIM4B00lCT3x1/kkfUwDoOfKLFjhZcG3OvdnSiEIyMBvnrh6d03jdjJJmXG Mujg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=i1N97efp+ngAo6xJ8feEp+n32+WtkhEC9av5zzmQf8I=; fh=rkoK/s7FxwcTuOAC8VWx8/OBrCYp43BrIuSJwNzodcI=; b=oQz62MVy/Gj5qrxIEJeZqIFtI7K77NGQBSPc6grK1bZQK9PM6oxobvgxpRcRMDzxP0 G/Wj+bMUm70XZbUOYJHNva5eE/MhqJ5hfJAaNyAYxIh9ZV7Dt+sY7TnK0jvyarjg17ru OjSGQZOm4MAnWYJHZkl1qZxYoAb9MqiNrOd/uz4k7nBiw0BaIM6E2024UGjdtlytCvLt UPlnWxs+Kdj4pOKEFaIQY2jL4Mbmr0CyBhZ9U5+q/F/iXT1r8l+YdLMt7nWuMq5M90Fp vMYgVfyutMkfXoUEL79z4ayoFETMzmJTEN0iMo8ynaTNnkLrvD/83iP1avKtsVIC0lY/ DKOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Xan8C6KY; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-164463-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164463-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b3-20020a056a000a8300b006eabb98a961si22437287pfl.207.2024.04.30.10.01.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 10:01:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164463-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Xan8C6KY; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-164463-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164463-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 02E58B21E46 for ; Tue, 30 Apr 2024 16:57:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 419F81C9EDF; Tue, 30 Apr 2024 16:51:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Xan8C6KY" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 38E711C6881 for ; Tue, 30 Apr 2024 16:51:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714495912; cv=none; b=R+A/BbZJ7Z7V49ebP4Fn3Ylu7zIDXE6gl8HRi4D4jhLxDZI2rpHcUIBRwjfDsDL8bclnPCcDn0cjrAWFl/RxjR7jOi9+NGegDt0JuTH9lLVNjOoVU9kr6zpr1yBRrc81PWJyIdz3yzw5m0f9OViqI5ccBhWMpz3Mww75ie9qSk8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714495912; c=relaxed/simple; bh=X1kVlmKoykgrGIOBnOPbHS/gm0hWrSVAGeWzcm3MPZU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SSu2vCDQsRppSK3et8tOD5CK8vwNIgnB8an5jscXJLRoznaFf78gFR2x2gp/GFh/37Vhv972Z5FV/RA40vszrR/W8x8py50GMJO2woNA8s5tFtjVQBvPZ+P/HZSFt7ReUv3IpcKJpOe4nuH9QYf0CM2ellfanYFR7f8gjLxBdmA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Xan8C6KY; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714495910; x=1746031910; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=X1kVlmKoykgrGIOBnOPbHS/gm0hWrSVAGeWzcm3MPZU=; b=Xan8C6KY4YOZVTMstS/Izw7W05gvRcZPSvCho20vnFhpJTsdpdor9DHl SWEaezo72jO4WpsTVPNSgiBUi9eQ8taeSRL46Sna9WghMHkJPCLnD44XT bLzvmIZThZminHu1FORvGQUJ5OuEOUr7ZdssVcs+trQ6C5jJXajHqqaSs GThg0wyHdkxIXQGqrGbb4cl+B03DQ9O728j41PQH+Fhhxe+UsGQRgw83m O5BwNJ8mIajuSHoFs9UplNBirRxJ8aaq9Fj4c4fiLUlHEMduZOE9HL35q qiKay34iyWtjbM8Z0GbzS4S9BhhqbrzjmNteOcQBenWAIvp1vCOf6hYWp A==; X-CSE-ConnectionGUID: hDl9+shBTJajARplRp8Y/Q== X-CSE-MsgGUID: wBMrOdidTki8FLDvcHI/zw== X-IronPort-AV: E=McAfee;i="6600,9927,11060"; a="10075792" X-IronPort-AV: E=Sophos;i="6.07,242,1708416000"; d="scan'208";a="10075792" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2024 09:51:23 -0700 X-CSE-ConnectionGUID: +0DddIMwSmigdoDZrLTMzg== X-CSE-MsgGUID: GzwnytXpSraOZfLqnYCZfw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,242,1708416000"; d="scan'208";a="26515514" Received: from agluck-desk3.sc.intel.com ([172.25.222.105]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2024 09:51:20 -0700 From: Tony Luck To: Borislav Petkov Cc: x86@kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck , "Rafael J . Wysocki" Subject: [PATCH v5 39/47] cpufreq: intel_pstate: Switch to new Intel CPU model defines Date: Tue, 30 Apr 2024 09:50:52 -0700 Message-ID: <20240430165100.73491-39-tony.luck@intel.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240430165100.73491-1-tony.luck@intel.com> References: <20240430164913.73473-1-tony.luck@intel.com> <20240430165100.73491-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_pstate.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 = { .get_val = core_get_val, }; -#define X86_MATCH(model, policy) \ - X86_MATCH_VENDOR_FAM_MODEL_FEATURE(INTEL, 6, INTEL_FAM6_##model, \ - X86_FEATURE_APERFMPERF, &policy) +#define X86_MATCH(vfm, policy) \ + X86_MATCH_VFM_FEATURE(vfm, X86_FEATURE_APERFMPERF, &policy) static const struct x86_cpu_id intel_pstate_cpu_ids[] = { - 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 = { - 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[] = { - X86_MATCH(KABYLAKE, core_funcs), + X86_MATCH(INTEL_KABYLAKE, core_funcs), {} }; @@ -3386,14 +3385,13 @@ static inline void intel_pstate_request_control_from_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 = { - 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_BROADWELL), + X86_MATCH_HWP(INTEL_BROADWELL_D, INTEL_PSTATE_HWP_BROADWELL), + X86_MATCH_HWP(INTEL_ANY, 0), {} }; @@ -3426,15 +3424,15 @@ static const struct x86_cpu_id intel_epp_default[] = { * 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_EPP_POWERSAVE, - HWP_EPP_BALANCE_POWERSAVE, 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_EPP(32)), + X86_MATCH_VFM(INTEL_METEORLAKE_L, HWP_SET_EPP_VALUES(HWP_EPP_POWERSAVE, + HWP_EPP_BALANCE_POWERSAVE, 115, 16)), {} }; static const struct x86_cpu_id intel_hybrid_scaling_factor[] = { - X86_MATCH_INTEL_FAM6_MODEL(METEORLAKE_L, HYBRID_SCALING_FACTOR_MTL), + X86_MATCH_VFM(INTEL_METEORLAKE_L, HYBRID_SCALING_FACTOR_MTL), {} }; -- 2.44.0