From patchwork Fri Feb 24 07:01:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 61174 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp762007wrd; Thu, 23 Feb 2023 23:46:21 -0800 (PST) X-Google-Smtp-Source: AK7set+THP0tpQi9nu24H66WQUkNqfVLpVhBq/w44ZcITaeNJtVqG4c6EE/NYcVvm7OhKV/0PCRZ X-Received: by 2002:a05:6a20:158f:b0:c6:3d79:6360 with SMTP id h15-20020a056a20158f00b000c63d796360mr7239026pzj.2.1677224781659; Thu, 23 Feb 2023 23:46:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677224781; cv=none; d=google.com; s=arc-20160816; b=WOmuVtJ+bheygMD+9zOaubT1gApC0aDMz6OV8Bd+ooJSIjHageOySFmXNxl53m7OLE BmDyV2nU1JV/FBp2MN28fU0kP3iUW+D9u7WCDfguj/Bj7HFiAj8pceG6dhlENxcQe/P/ WIzYApNDTzHh00j7GIW6m9OsjRRM6r05tSviBe2Bzd3wNTCOy8nOS+ZiyxDSCowg75+L wobox+dCBHZowCGDZqobJ3Cw7tLUoPvaIpSZjoLKNuEEnsZ2ZHWIaA4703UzPdhZ4Kw6 1JrSAPCVJobQON2XTQnG3butW5Inn3QDhV68GIp40iOGFBAJXT9CtYDwO8NUFmypRosm 2BeQ== 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=Gzrn5wbk1Bu3NXyLyDZrH+Zzx08oBSZYwd9kmqkM4VM=; b=BhXjik0oc3Sx2uod5ybXjdxdSiSIYP1ZNU5rjUPpvtKADgif7FQyXl+jLsHdxvAZq1 ekY0/Wz90AlShTKEJK7QqjQuqxhjOt/MXmmJENxmaiead9aSQTy6qSCAKGR0aeNyYgT/ ZQ5ez6e2aRewzzqdVfQdK8AgRzBj04jh3WF3Mj48qDkGR5Y8Ns2ymHBZWe20dxiUghav HCAjiNu+FD2y7KyrZ8DpVxqJzpqFqTfJmWoGmJiTQt835WkQr2KRxKIMxfBFZ1/uQVJP 3HLivQJ/AxhBgcoND2a+iRrUrLzVhY3vIswrlxauGfyVjKaIPjgDtWhosLE+JeOl8Bef cwjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dkuMacOh; 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 s9-20020aa78bc9000000b00597c2ecd86dsi5276307pfd.251.2023.02.23.23.46.08; Thu, 23 Feb 2023 23:46:21 -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=dkuMacOh; 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 S229974AbjBXHaT (ORCPT + 99 others); Fri, 24 Feb 2023 02:30:19 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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?1758697652625581520?= X-GMAIL-MSGID: =?utf-8?q?1758697652625581520?= 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