Re: [PATCH 0/2] x86/fred: enable FRED by default
From: Sohil Mehta
Date: Mon Mar 23 2026 - 21:15:39 EST
On 3/23/2026 1:15 PM, H. Peter Anvin wrote:
Can we please include this as well?
diff --git a/arch/x86/kernel/fred.c b/arch/x86/kernel/fred.c
index e736b19e18de..117aa06d25ca 100644
--- a/arch/x86/kernel/fred.c
+++ b/arch/x86/kernel/fred.c
@@ -27,9 +27,6 @@ EXPORT_PER_CPU_SYMBOL(fred_rsp0);
void cpu_init_fred_exceptions(void)
{
- /* When FRED is enabled by default, remove this log message */
- pr_info("Initialize FRED on CPU%d\n", smp_processor_id());
-
/*
* If a kernel event is delivered before a CPU goes to user level for
* the first time, its SS is NULL thus NULL is pushed into the SS field
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 03a550630644..bfa8a20ccc37 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -1750,8 +1750,8 @@ Kernel parameters
> fred= [X86-64]
> Enable/disable Flexible Return and Event Delivery.
> Format: { on | off }
> - on: enable FRED when it's present.
> - off: disable FRED, the default setting.
> + on: enable FRED when it's present, the default setting.
Why do we need the fred=on line after this series? It can't really
enable FRED when the compile option is disabled. Seems like a dead (and
slightly confusing) option to me.
> + off: disable FRED.
>
> ftrace=[tracer]
> [FTRACE] will set and start the specified tracer
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index e2df1b147184..876b663dcf38 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -557,7 +557,7 @@ config X86_FRED
> bool "Flexible Return and Event Delivery"
> depends on X86_64
> help
> - When enabled, try to use Flexible Return and Event Delivery
> + When enabled, use Flexible Return and Event Delivery
> instead of the legacy SYSCALL/SYSENTER/IDT architecture for
> ring transitions and exception/interrupt handling if the
> system supports it.
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index a8ff4376c286..e22a49869380 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -1746,7 +1746,7 @@ static void __init cpu_parse_early_param(void)
>
> /* Minimize the gap between FRED is available and available but disabled. */
> arglen = cmdline_find_option(boot_command_line, "fred", arg, sizeof(arg));
> - if (arglen != 2 || strncmp(arg, "on", 2))
> + if (arglen > 0 && (arglen != 2 || strncmp(arg, "on", 2)))
> setup_clear_cpu_cap(X86_FEATURE_FRED);
Nit: Would it be better to compare with "off" rather than not on?
>
> arglen = cmdline_find_option(boot_command_line, "clearcpuid", arg, sizeof(arg));