Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2543776rwl; Mon, 27 Mar 2023 01:29:59 -0700 (PDT) X-Google-Smtp-Source: AKy350aXhXlU5MTjcY70Fqy00XjIP9/Ua7Fpg5xSkuPtbzT6E32e3G8T+haecBv+1YC3KKNMb+PJ X-Received: by 2002:a05:6402:514a:b0:4fa:4810:95f9 with SMTP id n10-20020a056402514a00b004fa481095f9mr10179609edd.34.1679905798972; Mon, 27 Mar 2023 01:29:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679905798; cv=none; d=google.com; s=arc-20160816; b=hPsXMAG8ZJawxAmg64j5s6H7CLgZlzqdhc0O+QaDvVKTK46gszDURJryt5gw08MFRg q0GnxGoYEYwN6/N2l5+c3HFWtJcJi88Hdwu/7Yk+3OPzt+LhgSHhTCFRvEDnLHWBHaU4 dKYZrw5FAtlLEp/7+OGDTnnnRyAsQwAnCfll/i/0XK19W4MAM6TXJYn2h7CnFZlgdiyD xHTv1/hP1qeTJfbh6rcl1CuP8QzKEFYRw0AGJWjHTwBMMdRJhaXjEMtkl0nMEtTb4nWZ lJ5g7WQqxeKObU9s/Yksp9kpkyKHjZrl5N/bCQHGghnIiWyxdNSxPJZcoBfkRuwEAIB0 J9Fg== 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 Return-Path: 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.29.34; Mon, 27 Mar 2023 01:29:58 -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 S233386AbjC0I1Y (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 Content-Transfer-Encoding: 8bit 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 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 -- 2.34.1