From patchwork Tue Apr 4 10:27:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 79002 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2934806vqo; Tue, 4 Apr 2023 04:03:39 -0700 (PDT) X-Google-Smtp-Source: AKy350YVq7b7LITx13Tj/Ed0tc2strhZGR5O2i/7OdaQ3CNI9PbWnXmekyaUmAFbjkuf/PjVzV4a X-Received: by 2002:a17:906:68ca:b0:92c:6fbf:4d with SMTP id y10-20020a17090668ca00b0092c6fbf004dmr1780541ejr.40.1680606219397; Tue, 04 Apr 2023 04:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680606219; cv=none; d=google.com; s=arc-20160816; b=vfpuQ+pLNWXkETLDdSIVe/NZSgrP2PjnmLsgneErWk0OvmAb+Bseq1ehU4ZgR2DCC4 jqG/Uw2VLhdKCkequvTGSYLm6xY0poSJRII/fado4CfDkMZ/Ie6ubIVgZvVZGL99aZ89 1ytEDi1FrOmxgYXfucHHCjzjBKViVb4/+kSzsDDHb9Wz6jr2M7AmgrbytOqPmN+8sSD1 iLYxkNJgZrSzmIWSt/RM9tKbzaMBp/dnvFo94UhZToSru9eypT8fUrZONiE3Kz85yA2x 4pCPdiwC1iuDNXGyBVDO601DkVwPZY05SB5utI4fBVuIx8V0QxyG6/zWKZfLySvCKr/l IdsA== 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=kTBcKAMTLKESJNxm3nGpE/vMc0d6+JyySFIu52kBSMM=; b=OXLG+zN/4JVgT+fysQpT5V+svpItuck47mHRsUcbCN/oJHkg5JcCLtBAwARsOqkL2f +YRRj9QLvUViCK6s84eZeok+q3rrziIRUiqJGbmkScHg0Yw5xsPTBl74VUCjGmvcPdMK SXr1MshNOicsdulm4VHW/nPmGSmI1JHd7nmBa7TOXK71CciVUDIG8gIGKVgsUHGHycaZ Pzd9w6cubIWYHE6ojUl3ZZ5s6XzFpALxbF9hUnlLeiIBTN/DPFhaeWvbTg3skfn/UXRC hXDMmNIC75hR13D5w3xWnO+La08io2nJ3rG4Dhj4XcJ+/08k69eOwJpUu4V0ctxNdmg4 FNvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fJio8BMx; 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 le10-20020a170906ae0a00b00930a3fe36f2si9342381ejb.38.2023.04.04.04.03.15; Tue, 04 Apr 2023 04:03:39 -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=fJio8BMx; 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 S234976AbjDDK4x (ORCPT + 99 others); Tue, 4 Apr 2023 06:56:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234881AbjDDK4Z (ORCPT ); Tue, 4 Apr 2023 06:56:25 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6E9B4C2B; Tue, 4 Apr 2023 03:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680605662; x=1712141662; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nd37h2vxkhLXg5jhh870M6BiFI8TxVn0dDXlR1ukIGo=; b=fJio8BMxUX6ApK4LuLMSK+FilafXGK5cD5f84wVU8iZo1cFs2zW5wwWB fxd+uircQ6Jes2IMZoPLzzShtyHA6tGuM73qe/eMRbbieMD2GiQWwYvIv 33B8cIZ0XABoScI4K9QHByfR4dui3VP7r4euRYnWV0Isy6GT3RV+TL7xD r2wlglu2jYvzPQK2pmMifv3ufnqkF2JO03Ry9XruteAYsLsuMiWodlqHD gmwladPFASv+sjOy4hhu8A5+yyzmzY9mQTEHQk71fXx+SqcRvi/hk5kZL umH+Td85Zpu59+eMZAgb67sGEl5Mgpd7W4fdg2pPrR3MMBekD3bpQ0HfO Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10669"; a="330734252" X-IronPort-AV: E=Sophos;i="5.98,317,1673942400"; d="scan'208";a="330734252" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2023 03:53:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10669"; a="775597874" X-IronPort-AV: E=Sophos;i="5.98,317,1673942400"; d="scan'208";a="775597874" Received: from unknown (HELO fred..) ([172.25.112.68]) by FMSMGA003.fm.intel.com with ESMTP; 04 Apr 2023 03:53:06 -0700 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, jiangshanlai@gmail.com, shan.kang@intel.com Subject: [PATCH v7 32/33] x86/fred: disable FRED by default in its early stage Date: Tue, 4 Apr 2023 03:27:15 -0700 Message-Id: <20230404102716.1795-33-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230404102716.1795-1-xin3.li@intel.com> References: <20230404102716.1795-1-xin3.li@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=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=unavailable 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?1762243346988879054?= X-GMAIL-MSGID: =?utf-8?q?1762243346988879054?= Disable FRED by default in its early stage. To enable FRED, a new kernel command line option "fred" needs to be added. Tested-by: Shan Kang 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 6221a1d057dd..c55ea60e1a0c 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -1498,6 +1498,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 eea41cb8722e..4db5e619fc97 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1467,6 +1467,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