From patchwork Mon Mar 27 07:58:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 75263 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1354945vqo; Mon, 27 Mar 2023 01:32:24 -0700 (PDT) X-Google-Smtp-Source: AKy350ajAp5n+3l6MSrV6Bgt2Xn8iTbkSVisBAlEXi/aXh/SJWX/nMJ1UjZoHotboJuav44Ta+N9 X-Received: by 2002:aa7:cc0e:0:b0:500:50f6:dd34 with SMTP id q14-20020aa7cc0e000000b0050050f6dd34mr10993324edt.1.1679905944629; Mon, 27 Mar 2023 01:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679905944; cv=none; d=google.com; s=arc-20160816; b=EPwvHTsfs367SlAbSe1AbMrlWB5A/fDvaiSxlMlTG0flqCTAxAf1FRUOCxhPM2vN0h rv2B/Zz71b2uFP0wKJuZCzbfcpTGlwPHw7uqQD/C9yV84HrwTCQ7d3LowYxuSSLzXFQt OnR7QgYcHoZOMN99gclMU3Pk8jI79n4EU2sNDmUMEPAUB6fpYJHnpQqpBwGH/ELd88sB CyxTSOB1Y2DE7K4P913ODimxvaB+5fOWaSOUz138Dq9BhxF2GDXPbQrxA+A76pyS8lGQ K+p6DG2FHmHWga8skWFVyvzsbFEh/94nXs0V0uVmFoAZ5ltMnQSvQq/DKyP01b2BfJHq O17w== 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=QMlsDGqDKx3cBzxANAmQlKVy8LddLgpebvEojtwNhHk8EyAijG/Dh3kUuEwEjSgrZK cji3gL+y1dFkBMx3gsSTHsdZ029iem95hUrxqcTTfkMKGOQPb4d+KVATC48KgDpWwek0 a9qVxC0DkrBo5GhqsvNPP+zVaC82g3OhKAX/Zw30RJIp+mjgK1s92TYt5jiwfnC3eO2a H3hFDgUvsKVR8hiA48Wwa41G9QkmzwUl2rx6GAwz7EbT0RE5uJqsoMZ+P7HW0QMwNiDJ 2QBAF3uHLt+NdVzmemYQuvVtJuukKsXUwY9TTJ7m7pw8AjBgUBoQIx2Iibs0RFNfCCBg y2VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CaDQqz4b; 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 j13-20020aa7c0cd000000b004c08dd41db8si5392629edp.106.2023.03.27.01.32.00; Mon, 27 Mar 2023 01:32:24 -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=CaDQqz4b; 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 S232935AbjC0I1Y (ORCPT + 99 others); Mon, 27 Mar 2023 04:27:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233240AbjC0I0z (ORCPT ); Mon, 27 Mar 2023 04:26:55 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3321655BE; Mon, 27 Mar 2023 01:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679905500; x=1711441500; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nd37h2vxkhLXg5jhh870M6BiFI8TxVn0dDXlR1ukIGo=; b=CaDQqz4biBKIUebVXOjp08vSpEgbZB5LohEewk8IHf34Z+alF3B6P/Rl q8jlLHgOIpAvGdkbPuBs+c3cpXLuezuXZonSguqepRAkLKqaT3MJfeqki FhYCZlbOYuHnUe66bWAZn50ARIv2+8/tcDQZ4ggca5OBRZ7UPCyxeABC/ eP+ioHpGvNByNNJ+PMlJjeEVlHow/JlWuHsUzyqDMYUD2KSEf2NMGUTIN aa/2BUUOli+Z91rBKsrDGANLyGhEo3jaJX3taQT43V2KLLIs8yEk/9wta Ki6pFhKZIkoRhlEYQ9GOPPjqZRB+4EOgTEjFfoAl5CTI9WNeCpeSR6vIa g==; X-IronPort-AV: E=McAfee;i="6600,9927,10661"; a="338930428" X-IronPort-AV: E=Sophos;i="5.98,294,1673942400"; d="scan'208";a="338930428" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2023 01:24:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10661"; a="713787165" X-IronPort-AV: E=Sophos;i="5.98,294,1673942400"; d="scan'208";a="713787165" Received: from unknown (HELO fred..) ([172.25.112.68]) by orsmga008.jf.intel.com with ESMTP; 27 Mar 2023 01:24:41 -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 v6 32/33] x86/fred: disable FRED by default in its early stage Date: Mon, 27 Mar 2023 00:58:37 -0700 Message-Id: <20230327075838.5403-33-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230327075838.5403-1-xin3.li@intel.com> References: <20230327075838.5403-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,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?1761509056066149467?= X-GMAIL-MSGID: =?utf-8?q?1761509056066149467?= 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