Message ID | 20230106085617.17248-33-xin3.li@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp729306wrt; Fri, 6 Jan 2023 01:25:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXvW5zxRNZ5VW8qOLbotJ/UJOQQbIs7VHcm3gO0uOFIchZ7c+rRojmRC3QvWBHZyzGRZnRdB X-Received: by 2002:a17:907:a07c:b0:841:13b0:7238 with SMTP id ia28-20020a170907a07c00b0084113b07238mr46151422ejc.25.1672997150977; Fri, 06 Jan 2023 01:25:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672997150; cv=none; d=google.com; s=arc-20160816; b=iSBlNjUl6K7gTqoDL6ELM0G7JJarvlHmtqMzUmIb9dP6E41bRsEPb92C8xsPcxtjC4 sB5w0ivQVv4OD10NrJj82Rwe1ayD5QL9OwUFTgRN7NN3koruLcmMDEQjMf+ln5vfR9o6 y9NWOvRd58qYijaBXaB0HT9FbAdirXNQNXRWQndL+7/i4OsoZzZffVzTD26ujigT5EDu JMmz33okdYgu9AzBbAxZBO2ZCrBo0FcFTBPHCQZDr4TPgj1pKN/li0BqcJPLqs7kT1n8 X/TXyyXVpGGMkDznU+IPDzDqgVUFotqa2xwdgRfdNQQLKw1/pxQrfw8ZKINr4m4sq16w WeeA== 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=jyechudPjcDRgraXFwScJul3Fz3xhvt/Dj31e1KFmVk=; b=XszNSe/0OXEWlXC+5XkyMTv4rWEmMhIJ3Lm6nL8bqG8M1HJOYZbRyI1tiW1xq/eyi4 LfeG95/y1HuTyFfi8SS2qeiAZONn6X02K4pXc/rnt0n7Y58g/jYZSTSLgAn40cc8PXBw 61XWFf3aOHaz/uK0n5w9JiS8tsdprnjmuL80roarswAMNDSinnWOL13ldI1VcpOTqYyF rmJe8lEH06PrsLYhL/PGBrsGW4wQtKJibJqcCpKAwPAPDWLcy4SH6XQnIBsJRBy2w6TT j3sVOjyV+Pu6C5TZgxnEsg6e7Kq30lpmE8DAI72eUpbQS7SId3zY7fGVVP4kFQqMuwOv D3ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eE9OBvBm; 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 oz8-20020a1709077d8800b007c0c9bd6206si911545ejc.553.2023.01.06.01.25.25; Fri, 06 Jan 2023 01:25:50 -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=eE9OBvBm; 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 S233971AbjAFJXY (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Fri, 6 Jan 2023 04:23:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233148AbjAFJU1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 6 Jan 2023 04:20:27 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFDF36B5EB; Fri, 6 Jan 2023 01:20:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672996826; x=1704532826; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dG+PmrxecS8Zp0V+8AcHi6OKB+U1bLaxzvtp836DcuY=; b=eE9OBvBmznC75p+YTz6kMY4RuDAFS7E19x0rvg1P+UaZ2Yf+TfOR532k uRo3D6moZUo6TS/BjMI8pwGIU1aJLE9Uqfboz+Z1/BE1UZDH2A/A63DjX F0MkPuGfhVApX3F4PNA+AG+dxFiEgyMJT/i6+YjpsbuGkT/9WOhEY+g9f kwzNZfWbs078nLz7yZ0IyoocuUJsEiU/A0QDl5lZR1B8bZkiYceen8aUF 37S6mi9VQW3ecIL1SVmfkMOjyTToQVfMgH/311ptSNIC8thh8qZulcmjw OpqZSlO9yaSafR6Px2mm0XZPFpZc6F0hnOd+7JZdYVEy5eoqs29sr3AHk g==; X-IronPort-AV: E=McAfee;i="6500,9779,10581"; a="322511667" X-IronPort-AV: E=Sophos;i="5.96,304,1665471600"; d="scan'208";a="322511667" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2023 01:20:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10581"; a="719139472" X-IronPort-AV: E=Sophos;i="5.96,304,1665471600"; d="scan'208";a="719139472" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga008.fm.intel.com with ESMTP; 06 Jan 2023 01:20:18 -0800 From: Xin Li <xin3.li@intel.com> 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 v2 32/32] x86/fred: disable FRED by default in its early stage Date: Fri, 6 Jan 2023 00:56:17 -0800 Message-Id: <20230106085617.17248-33-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230106085617.17248-1-xin3.li@intel.com> References: <20230106085617.17248-1-xin3.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754264660783592319?= X-GMAIL-MSGID: =?utf-8?q?1754264660783592319?= |
Series |
x86: enable FRED for x86-64
|
|
Commit Message
Li, Xin3
Jan. 6, 2023, 8:56 a.m. UTC
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 <xin3.li@intel.com>
---
Documentation/admin-guide/kernel-parameters.txt | 4 ++++
arch/x86/kernel/cpu/common.c | 3 +++
2 files changed, 7 insertions(+)
Comments
On January 6, 2023 12:56:17 AM PST, Xin Li <xin3.li@intel.com> wrote: >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 <xin3.li@intel.com> >--- > 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 42af9ca0127e..0bc76d926dd4 100644 >--- a/Documentation/admin-guide/kernel-parameters.txt >+++ b/Documentation/admin-guide/kernel-parameters.txt >@@ -1506,6 +1506,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 5de68356fe62..1a160337ad41 100644 >--- a/arch/x86/kernel/cpu/common.c >+++ b/arch/x86/kernel/cpu/common.c >@@ -1434,6 +1434,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 Specifically, the intent is to enable it by default once hardware is widely available. This allows e.g. distros to compile in the support for opt-in field testing before throwing the switch. The motivation for this comes from the SMAP experience where the code was functional and correct when merged, but a change elsewhere in the kernel code base broke it during the intervening period.
> >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 <xin3.li@intel.com> > >--- > > 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 42af9ca0127e..0bc76d926dd4 100644 > >--- a/Documentation/admin-guide/kernel-parameters.txt > >+++ b/Documentation/admin-guide/kernel-parameters.txt > >@@ -1506,6 +1506,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 > >5de68356fe62..1a160337ad41 100644 > >--- a/arch/x86/kernel/cpu/common.c > >+++ b/arch/x86/kernel/cpu/common.c > >@@ -1434,6 +1434,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 > > Specifically, the intent is to enable it by default once hardware is widely available. > This allows e.g. distros to compile in the support for opt-in field testing before > throwing the switch. > > The motivation for this comes from the SMAP experience where the code was > functional and correct when merged, but a change elsewhere in the kernel code > base broke it during the intervening period. Thanks for the clarification.
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 42af9ca0127e..0bc76d926dd4 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -1506,6 +1506,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 5de68356fe62..1a160337ad41 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1434,6 +1434,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