Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp707100rwd; Mon, 12 Jun 2023 22:04:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5sQcONvnFA/uwgUe+1e6eBDtvOAHNAn6tB7qC3l+fZ22rmPe7NQDJnHjwW9B/RSEtMSmJW X-Received: by 2002:a17:90a:1de:b0:256:675f:1d49 with SMTP id 30-20020a17090a01de00b00256675f1d49mr13449856pjd.0.1686632663216; Mon, 12 Jun 2023 22:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686632663; cv=none; d=google.com; s=arc-20160816; b=CAPoTIci89K2Xa+uVahTpayaxPqJRHh0mbmSJ45Y+cUTZgTbwsfBsU3Rqmn+eiME5d RPCNo0PykhY2gDc1o/pxgow5T0pDjGMGoBtPX0ih/kW9PGGbrzCcZd5dJL2TMk+PKYul lUZNsK5zJjsi8GauGDYSj93ELpvfns3URmvjXWdlIBPBiXujDP/lBuEq39t0cajeAIKJ 5W2tT3gybBcUURG3hSdU3+2DGyZl1EjQGkTbwsnh3QRTdeyXSyPtLSLNWARQF07V5iMT 5FR5o33gOHI5cyzaOrqtYgc/VEFFlrLzhtpGPjJL3uSJdsKoQK8ry5h+XO9DJGG9/H2q 6ndA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=N1L3g+kNVWt8kIyJPvcO5cPxiAhzurxWSSMedJezj6A=; b=V6r6y0Y6SB8WPUfc7l0nvwC8iEV0lQRZU7dhxsROjkzmf5CkTQwq2wjhx+QHgnfySo fFYuXlMXXb5tp5cMxqb7hYENtteENunOiRixiGe/lFGSFMO+UAFy/u49wX91lU1Sernd XneFU6SnPrE+eXgwCWPvT7qDaS1qhZ2T+W4uGycLQ8i0CGcUJHBxF0s5FLQ6xppSlH9y jO9HmNEUHSES6IkQd9zrXDooKlfp66NhmIR9E6p570iamlLCdzzDLaQuvzatHp/BSCtt yPSugrfjRjjASCItGtlfQYTpi2PNvMcUjnoHGhNlKPYS4HKGu/ZCimCQF4RiUY9JUhSD k7rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZcKREqPJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 93-20020a17090a0fe600b0025bc1728a83si4092022pjz.26.2023.06.12.22.04.10; Mon, 12 Jun 2023 22:04:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZcKREqPJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239689AbjFMEXO (ORCPT + 99 others); Tue, 13 Jun 2023 00:23:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239331AbjFMEWS (ORCPT ); Tue, 13 Jun 2023 00:22:18 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CA3310DC; Mon, 12 Jun 2023 21:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686630111; x=1718166111; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=CrOiqTVb1eZOl3V7qBg0hPpm63j88QwlS+s2uEc7SgM=; b=ZcKREqPJUeFxqdibSGJ45E9M56mzfyilHzA492b5JEC+QuBveCWj7kai 0d2xy++iH3udZbaTT6JG70TBc/bY31XZoefVGz8VfRbvkjankphHeqqG1 ztmeKuNKrR63MEx+DPfvhWJ/vFnZxyqM4K+9d3DdeM3zCNpZ2Es5bPRi8 AuxJUKL/ngxPklZMJu5e9o6nD8kHQlW9b+TdGJiwu58TWDxuxg1MsUCkt DB8kp+qJZA3UCubKLgqCu6LmVXXCWHAwDkMZj5n6cUDiuGE5WY08w5kpI VucH9uq+GsnWDhl/eNqDoEf1ZdQvlVEl1Ugb7T6Ee+9qskTnC1GOlhh9S w==; X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="358222171" X-IronPort-AV: E=Sophos;i="6.00,238,1681196400"; d="scan'208";a="358222171" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2023 21:21:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="661854968" X-IronPort-AV: E=Sophos;i="6.00,238,1681196400"; d="scan'208";a="661854968" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orsmga003.jf.intel.com with ESMTP; 12 Jun 2023 21:21:49 -0700 From: Ricardo Neri To: "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot Cc: Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Tim Chen , Valentin Schneider , Lukasz Luba , Ionela Voinescu , Zhao Liu , "Yuan, Perry" , x86@kernel.org, "Joel Fernandes (Google)" , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ricardo Neri , "Tim C . Chen" , Zhao Liu Subject: [PATCH v4 12/24] x86/cpufeatures: Add the Intel Thread Director feature definitions Date: Mon, 12 Jun 2023 21:24:10 -0700 Message-Id: <20230613042422.5344-13-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230613042422.5344-1-ricardo.neri-calderon@linux.intel.com> References: <20230613042422.5344-1-ricardo.neri-calderon@linux.intel.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Intel Thread Director (ITD) provides hardware resources to classify the current task. The classification reflects the type of instructions that a task currently executes. ITD extends the Hardware Feedback Interface table to provide performance and energy efficiency capabilities for each of the supported classes of tasks. Cc: Ben Segall Cc: Daniel Bristot de Oliveira Cc: Dietmar Eggemann Cc: Ionela Voinescu Cc: Joel Fernandes (Google) Cc: Len Brown Cc: Lukasz Luba Cc: Mel Gorman Cc: Perry Yuan Cc: Rafael J. Wysocki Cc: Srinivas Pandruvada Cc: Steven Rostedt Cc: Tim C. Chen Cc: Valentin Schneider Cc: Zhao Liu Cc: x86@kernel.org Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Ricardo Neri --- Changes since v3: * None Changes since v2: * None Changes since v1: * Removed dependency on CONFIG_INTEL_THREAD_DIRECTOR. Instead, depend on CONFIG_IPC_CLASSES. * Added DISABLE_ITD to the correct DISABLE_MASK: 14 instead of 13. --- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/include/asm/disabled-features.h | 8 +++++++- arch/x86/kernel/cpu/cpuid-deps.c | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index cb8ca46213be..98a84cbf4261 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -353,6 +353,7 @@ #define X86_FEATURE_HWP_EPP (14*32+10) /* HWP Energy Perf. Preference */ #define X86_FEATURE_HWP_PKG_REQ (14*32+11) /* HWP Package Level Request */ #define X86_FEATURE_HFI (14*32+19) /* Hardware Feedback Interface */ +#define X86_FEATURE_ITD (14*32+23) /* Intel Thread Director */ /* AMD SVM Feature Identification, CPUID level 0x8000000a (EDX), word 15 */ #define X86_FEATURE_NPT (15*32+ 0) /* Nested Page Table support */ diff --git a/arch/x86/include/asm/disabled-features.h b/arch/x86/include/asm/disabled-features.h index fafe9be7a6f4..fad78bd840cd 100644 --- a/arch/x86/include/asm/disabled-features.h +++ b/arch/x86/include/asm/disabled-features.h @@ -105,6 +105,12 @@ # define DISABLE_TDX_GUEST (1 << (X86_FEATURE_TDX_GUEST & 31)) #endif +#ifdef CONFIG_IPC_CLASSES +# define DISABLE_ITD 0 +#else +# define DISABLE_ITD (1 << (X86_FEATURE_ITD & 31)) +#endif + /* * Make sure to add features to the correct mask */ @@ -123,7 +129,7 @@ DISABLE_CALL_DEPTH_TRACKING) #define DISABLED_MASK12 (DISABLE_LAM) #define DISABLED_MASK13 0 -#define DISABLED_MASK14 0 +#define DISABLED_MASK14 (DISABLE_ITD) #define DISABLED_MASK15 0 #define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP| \ DISABLE_ENQCMD) diff --git a/arch/x86/kernel/cpu/cpuid-deps.c b/arch/x86/kernel/cpu/cpuid-deps.c index f6748c8bd647..7a87b823eef3 100644 --- a/arch/x86/kernel/cpu/cpuid-deps.c +++ b/arch/x86/kernel/cpu/cpuid-deps.c @@ -81,6 +81,7 @@ static const struct cpuid_dep cpuid_deps[] = { { X86_FEATURE_XFD, X86_FEATURE_XSAVES }, { X86_FEATURE_XFD, X86_FEATURE_XGETBV1 }, { X86_FEATURE_AMX_TILE, X86_FEATURE_XFD }, + { X86_FEATURE_ITD, X86_FEATURE_HFI }, {} }; -- 2.25.1