Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp209341rdb; Tue, 5 Dec 2023 03:21:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrOYV0n8o3JFfwKxKiPYfOhHT9yYauamYko+vZvsQEHMAUb7J6QWDEMGX7qHxmO8NGXQWD X-Received: by 2002:a05:6a20:4286:b0:18f:97c:4f3d with SMTP id o6-20020a056a20428600b0018f097c4f3dmr3245414pzj.73.1701775310758; Tue, 05 Dec 2023 03:21:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701775310; cv=none; d=google.com; s=arc-20160816; b=x5ZvqbnRzRtQuAtYOFcKZ1vVcLxQ0ewrWnMDUVa3ZC8SEI9Z3S5eHhjDPXQtmAJOPj hGYVy0ur/K06ieHzLIfHZKaO7pE/flMF9wlo1CeiuhZ67IRmrGLtv4IDhZC6AbWLWq+I KG4zdBBGw4yI5KUGzZAJRRsp9Elhm7s/RX5ybdLOqu45DWSkfD8Z7wrhh7Ss1PylFPDD XGoBdcoVcVUzfLuUq0fykvgJEI2J78Aa6pPFEkoHQ3c0SHlVsQPUw9J+jKSsiMAjUZMn BSVixUgnIQxotlVosUxe7clPRaNbS5f4vYFKv4LhJrm1k9I39qOobYjrsGcPCZW8xoui 6fiw== 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=Eb75/OsfBQYO2H59+G91hgHA5wxCGdyH4ugFE8wpI48=; fh=uCCWEUVpLc/xDP/D3WvGY/BxHU9d0NQYu/T71GEsNmA=; b=n6eb7ieWNEZsL5IcsLmbEqcxztaMa/9az9YsaCrztJtagr8HtfJ2Xe63ckHzgQhtTd InYGhfFXmsOIa4oLlx7s2PmJqWQFEAlSw+/f7TXUTRtjgaz07u/1OS8u7KoL5dDi5AKp 8FxJZxfLb3ghrLpcVUsZcDMBjPHtrsZbFxnzI6BKOTPethZF+hRc8eoduDkZi6PseJhQ xILhLDLjJls++JedXTJg0jCCfhUUl/1A/Dlo8Dm7K/E8mO5rUbbAFEjYcykyczUqYMsp uCV8+tq4MAzrgiLbyJbId1bbjTy43YXKGLuIg9+LM2dEKtTkXqsReD0n8QLR2prw5q03 t5OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=L0tnBx4n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bf20-20020a17090b0b1400b0028648abac04si8446398pjb.58.2023.12.05.03.21.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 03:21:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=L0tnBx4n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 F115A80C0374; Tue, 5 Dec 2023 03:21:48 -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 S1442078AbjLELVc (ORCPT + 99 others); Tue, 5 Dec 2023 06:21:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442056AbjLELVQ (ORCPT ); Tue, 5 Dec 2023 06:21:16 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A008124; Tue, 5 Dec 2023 03:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701775283; x=1733311283; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=x84ckBkGQ2mHZOwuZkHd1Fjs3DcMdeHjBJ7YSwg1yco=; b=L0tnBx4ndrsTHKSAxMvlbY9v/FmawuRKuGgwUwn1fBTEHhZZpGeeNrWh sMRyreqfH2pVuhcopptvLn3KGO7Zb0AATW710Y3pOWw5aQEAzKunpZAsW KJgcSPMu4j3eiuSHZVeufE0EZMauwE2w1UNusEAeQYq91AbVGI7TiXp3j Zz5RaFZZ0uOPVazGIkBJODTHq4qg1SPgBXQZDG6p1vmkumFWXJd2xr06M kOtFYUCp3j9V09Ppp2GJ3m0TH5jqWCu3usb1wkubwm+0PiEx3oi/0gEge GTc2P2PRFVSFXehcYJ+oASHbwB+FHO9Gnt95Cros1/pK+tnsiD1WML/dH w==; X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="942399" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="942399" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2023 03:21:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="1018192919" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="1018192919" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga006.fm.intel.com with ESMTP; 05 Dec 2023 03:21:17 -0800 From: Xin Li To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, luto@kernel.org, pbonzini@redhat.com, seanjc@google.com, peterz@infradead.org, jgross@suse.com, ravi.v.shankar@intel.com, mhiramat@kernel.org, andrew.cooper3@citrix.com, jiangshanlai@gmail.com, nik.borisov@suse.com, shan.kang@intel.com Subject: [PATCH v13 07/35] x86/fred: Disable FRED support if CONFIG_X86_FRED is disabled Date: Tue, 5 Dec 2023 02:49:56 -0800 Message-ID: <20231205105030.8698-8-xin3.li@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231205105030.8698-1-xin3.li@intel.com> References: <20231205105030.8698-1-xin3.li@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_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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]); Tue, 05 Dec 2023 03:21:49 -0800 (PST) From: "H. Peter Anvin (Intel)" Add CONFIG_X86_FRED to to make cpu_feature_enabled() work correctly with FRED. Originally-by: Megha Dey Signed-off-by: H. Peter Anvin (Intel) Tested-by: Shan Kang Signed-off-by: Xin Li --- Changes since v10: * FRED feature is defined in cpuid word 12, not 13 (Nikolay Borisov). --- arch/x86/include/asm/disabled-features.h | 8 +++++++- tools/arch/x86/include/asm/disabled-features.h | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/disabled-features.h b/arch/x86/include/asm/disabled-features.h index 702d93fdd10e..f40b29d3abad 100644 --- a/arch/x86/include/asm/disabled-features.h +++ b/arch/x86/include/asm/disabled-features.h @@ -117,6 +117,12 @@ #define DISABLE_IBT (1 << (X86_FEATURE_IBT & 31)) #endif +#ifdef CONFIG_X86_FRED +# define DISABLE_FRED 0 +#else +# define DISABLE_FRED (1 << (X86_FEATURE_FRED & 31)) +#endif + /* * Make sure to add features to the correct mask */ @@ -133,7 +139,7 @@ #define DISABLED_MASK10 0 #define DISABLED_MASK11 (DISABLE_RETPOLINE|DISABLE_RETHUNK|DISABLE_UNRET| \ DISABLE_CALL_DEPTH_TRACKING|DISABLE_USER_SHSTK) -#define DISABLED_MASK12 (DISABLE_LAM) +#define DISABLED_MASK12 (DISABLE_FRED|DISABLE_LAM) #define DISABLED_MASK13 0 #define DISABLED_MASK14 0 #define DISABLED_MASK15 0 diff --git a/tools/arch/x86/include/asm/disabled-features.h b/tools/arch/x86/include/asm/disabled-features.h index 702d93fdd10e..f40b29d3abad 100644 --- a/tools/arch/x86/include/asm/disabled-features.h +++ b/tools/arch/x86/include/asm/disabled-features.h @@ -117,6 +117,12 @@ #define DISABLE_IBT (1 << (X86_FEATURE_IBT & 31)) #endif +#ifdef CONFIG_X86_FRED +# define DISABLE_FRED 0 +#else +# define DISABLE_FRED (1 << (X86_FEATURE_FRED & 31)) +#endif + /* * Make sure to add features to the correct mask */ @@ -133,7 +139,7 @@ #define DISABLED_MASK10 0 #define DISABLED_MASK11 (DISABLE_RETPOLINE|DISABLE_RETHUNK|DISABLE_UNRET| \ DISABLE_CALL_DEPTH_TRACKING|DISABLE_USER_SHSTK) -#define DISABLED_MASK12 (DISABLE_LAM) +#define DISABLED_MASK12 (DISABLE_FRED|DISABLE_LAM) #define DISABLED_MASK13 0 #define DISABLED_MASK14 0 #define DISABLED_MASK15 0 -- 2.43.0