From patchwork Mon Nov 28 13:20:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 26759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5657460wrr; Mon, 28 Nov 2022 05:15:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf5PE/HrmDaPprbzqXj43OjKfkdr7JCt1gpFbzc2cX838Cx64JsRaJ+3WcRETSBOfw3ZApbw X-Received: by 2002:a62:1413:0:b0:574:e84e:d7a1 with SMTP id 19-20020a621413000000b00574e84ed7a1mr11147430pfu.83.1669641316978; Mon, 28 Nov 2022 05:15:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669641316; cv=none; d=google.com; s=arc-20160816; b=pF5LHxocu4FyL0btYRRUQu/bKrDhxBWEsiO0D3q5HHi/hXSiKzcSlP/2dZ+rs1ucTY JOnp+J0YBu6eaVxuU/yIBt4gw01mrsEZiyi/R1gAl+zr5/NeA724IN+h3U2Tea18TG8B X040hSKNRo0YwSswnM29xJn+b0horQ1c+M49xBIvvqSaNkSQX5xO1K/X+cntVCgOCBOZ XMmmmcv0OtF09mb7jee8d8cSkKnROOnHMRAPs++h1++bbBz8xurA6yDxZ/eRTIq3WdQ5 Ms1eWL3aN8/jx1NB1+Mem1jnIrxirjuzHrEIHwS7g8k95fxcU2CXTc+zPePuUokxqkXg dU0g== 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=jQ1DXAVwj+Ivs2AA3yuC+OjIPLs9DN1UNld7uzJ+aK4=; b=U5o5mAoNowUNcuXwun1Yf8mwSWbdJ6DVB0JSRbXkFpG6xlPw9ZXN14jxUBPGmd8TIi 6UmckT5HQzPaVixG2HTHvD68y3iDGZK/xOkd4+BQ3ECEus2ztAbuKeovDiHNg3BG4MpX AUeFjfqY/Gsp23wvS/EZXSRDtifoeQ5gC9FsbpeGbWwr5DZueWLiPVK7YKmOoaqRelEN +VOf/OCqfmZ32og63jpGgjblxtT97FH+sEscF2XLJZEXLKfm3x0j5iblgpm1AyUYCcPC Z1F3Cu9hdkuuw2u+9l7JJbxTl8LogtHSOohbGl4TK0S4ZBDw9IMkGZoym0cNHmFXepMP YvIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j1tgSnHG; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n2-20020a170902d2c200b00186a2274394si13115394plc.476.2022.11.28.05.14.57; Mon, 28 Nov 2022 05:15:16 -0800 (PST) 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=j1tgSnHG; 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 S231671AbiK1NO3 (ORCPT + 99 others); Mon, 28 Nov 2022 08:14:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231534AbiK1NNk (ORCPT ); Mon, 28 Nov 2022 08:13:40 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CD919FF5; Mon, 28 Nov 2022 05:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669641219; x=1701177219; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=NJihmyOVPjkl7Qdl9zakJCCiujspncSo1d7+r1Yn1vU=; b=j1tgSnHGyUwiofNoNQJraegM0j4LuNnx+zCCM2jYqRiLkxoP/Vwx4J5z BGBQ5d3Ipfu2FcCVOFjP8G7HtbRyU4wyjRXbpeFPjGB7bT13LysulJch7 Vd0HPc+2czVZKdUmwEWEaLNokZGSRvMV4T7+LqbZWx42lGizr3FM0Uk82 jiLpXJIr5oeGVne9gEVsEKpMBlc7ubqoz8j9N5CMrz8Wq18POzBnlNZQQ OGwDN+q59jzQpEU9jKMJ1lhXb0h0eu+HpIIuDN7u5LdrD+slRVIV08Hgm +Bfc4HhdF++bwTGnu7rYBEblsaCIhx8oe5ywV71Hul+upydruHaZxrhMu Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="401117169" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="401117169" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2022 05:13:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="749381366" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="749381366" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by fmsmga002.fm.intel.com with ESMTP; 28 Nov 2022 05:13:34 -0800 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 , x86@kernel.org, "Joel Fernandes (Google)" , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ricardo Neri , "Tim C . Chen" Subject: [PATCH v2 12/22] x86/cpufeatures: Add the Intel Thread Director feature definitions Date: Mon, 28 Nov 2022 05:20:50 -0800 Message-Id: <20221128132100.30253-13-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221128132100.30253-1-ricardo.neri-calderon@linux.intel.com> References: <20221128132100.30253-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 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750745813703070071?= X-GMAIL-MSGID: =?utf-8?q?1750745813703070071?= 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: Joel Fernandes (Google) Cc: Len Brown Cc: Mel Gorman Cc: Rafael J. Wysocki Cc: Srinivas Pandruvada Cc: Steven Rostedt Cc: Tim C. Chen Cc: Valentin Schneider Cc: x86@kernel.org Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Ricardo Neri --- 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 b6525491a41b..80b2beafc81e 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -344,6 +344,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 c44b56f7ffba..0edd9bef7f2e 100644 --- a/arch/x86/include/asm/disabled-features.h +++ b/arch/x86/include/asm/disabled-features.h @@ -99,6 +99,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 */ @@ -117,7 +123,7 @@ DISABLE_CALL_DEPTH_TRACKING) #define DISABLED_MASK12 0 #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 d95221117129..277f157e067e 100644 --- a/arch/x86/kernel/cpu/cpuid-deps.c +++ b/arch/x86/kernel/cpu/cpuid-deps.c @@ -79,6 +79,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 }, {} };