Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8A0DC61DA3 for ; Fri, 24 Feb 2023 07:30:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230151AbjBXHaU (ORCPT ); Fri, 24 Feb 2023 02:30:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230094AbjBXH3m (ORCPT ); Fri, 24 Feb 2023 02:29:42 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 878F563DF2; Thu, 23 Feb 2023 23:28:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677223725; x=1708759725; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ya0P11FPkFOyO+yBLyGUvt4s2z0lBoRy6ViZph9dwjI=; b=dkuMacOhSDqoB2MVaomQ49B+vZfYOseK/jkjtYO8tLlxPEdmO4bO8bts Gi17ZhRTI5XJD4kzlY5HgR21eBYtNZZZfqkkNsAQDvSsYUy07y6B5SQAu ndGH7lWB7zd6oJyPT+d3AkBrqe2CZBATzDrFNO+japzsjRFusUo8YA8E/ Swoh221gFUHT33hEQWPI9ygczR7uOmeowBfBxu1+ulyh58FSBz2AAwavr 1y19ujS0GC9694K9l267J1KqBSf1Xsicl8DHOtc7Ftm182l7HPDaFZG4M xCQ4pzGl/in6VCkFWuGRpoO8YLxce7eLHowPOFVzvJSunupbYoY+HYlgI g==; X-IronPort-AV: E=McAfee;i="6500,9779,10630"; a="334836193" X-IronPort-AV: E=Sophos;i="5.97,324,1669104000"; d="scan'208";a="334836193" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2023 23:27:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10630"; a="815639290" X-IronPort-AV: E=Sophos;i="5.97,324,1669104000"; d="scan'208";a="815639290" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga001.fm.intel.com with ESMTP; 23 Feb 2023 23:27:26 -0800 From: Xin Li To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, peterz@infradead.org, andrew.cooper3@citrix.com, seanjc@google.com, pbonzini@redhat.com, ravi.v.shankar@intel.com Subject: [RFC PATCH v3 32/32] x86/fred: disable FRED by default in its early stage Date: Thu, 23 Feb 2023 23:01:45 -0800 Message-Id: <20230224070145.3572-33-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230224070145.3572-1-xin3.li@intel.com> References: <20230224070145.3572-1-xin3.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Disable FRED by default in its early stage. To enable FRED, a new kernel command line option "fred" needs to be added. Signed-off-by: Xin Li --- Documentation/admin-guide/kernel-parameters.txt | 4 ++++ arch/x86/kernel/cpu/common.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 1d2f92edb5a1..7d0a0c303e06 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -1519,6 +1519,10 @@ Warning: use of this parameter will taint the kernel and may cause unknown problems. + fred + Forcefully enable flexible return and event delivery, + which is otherwise disabled by default. + ftrace=[tracer] [FTRACE] will set and start the specified tracer as early as possible in order to facilitate early diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 550da2a61ae2..8f1a6cdb0108 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1461,6 +1461,9 @@ static void __init cpu_parse_early_param(void) char *argptr = arg, *opt; int arglen, taint = 0; + if (!cmdline_find_option_bool(boot_command_line, "fred")) + setup_clear_cpu_cap(X86_FEATURE_FRED); + #ifdef CONFIG_X86_32 if (cmdline_find_option_bool(boot_command_line, "no387")) #ifdef CONFIG_MATH_EMULATION -- 2.34.1