Skip to contentSkip to conversation

x86/fred: enable FRED by default

PATCH Superseded H. Peter Anvin 5 participants 17 messages Mar 23 – Mar 25

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

H. Peter Anvin

author maintainer
#0 lore raw

cover x86/fred: enable FRED by default

From: H. Peter Anvin (Intel) <[email protected]>

When FRED was added to the mainline kernel, it was set up as an explicit opt-in due to the risk of regressions before hardware was available publicly.

Now, Panther Lake (Core Ultra 300 series) has been released, and benchmarking by Phoronix has shown that it provides a significant performance benefit on most workloads:

https://www.phoronix.com/review/intel-fred-panther-lake

Accordingly, enable FRED by default if the CPU supports it. FRED can of course still be disabled via the fred=off command line option.

---

 Documentation/admin-guide/kernel-parameters.txt | 4 ++--
 arch/x86/Kconfig                                | 2 +-
 arch/x86/kernel/cpu/common.c                    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +2 -2
index 03a550630644..bfa8a20ccc37 100644
@@ -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.
+			off: disable FRED.
 
 	ftrace=[tracer]
 			[FTRACE] will set and start the specified tracer
arch/x86/Kconfig +1 -1
index e2df1b147184..876b663dcf38 100644
@@ -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.
arch/x86/kernel/cpu/common.c +1 -1
index a8ff4376c286..e22a49869380 100644
@@ -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);
 
 	arglen = cmdline_find_option(boot_command_line, "clearcpuid", arg, sizeof(arg));
Acked-by on the v1 series
#1 lore raw
Quoted 6 lines · H. Peter Anvin

From: H. Peter Anvin (Intel) <[email protected]>

When FRED was added to the mainline kernel, it was set up as an explicit opt-in due to the risk of regressions before hardware was available publicly.

Quoted 8 lines

Now, Panther Lake (Core Ultra 300 series) has been released, and benchmarking by Phoronix has shown that it provides a significant performance benefit on most workloads:

https://www.phoronix.com/review/intel-fred-panther-lake

Accordingly, enable FRED by default if the CPU supports it. FRED can of course still be disabled via the fred=off command line option.

author maintainer
#2 lore raw

PATCH 1/2 x86/fred: enable FRED by default

In reply to H. Peter Anvin

When FRED was added to the mainline kernel, it was set up as an explicit opt-in due to the risk of regressions before hardware was available publicly.

Now, Panther Lake (Core Ultra 300 series) has been released, and benchmarking by Phoronix has shown that it provides a significant performance benefit on most workloads:

https://www.phoronix.com/review/intel-fred-panther-lake

Accordingly, enable FRED by default if the CPU supports it. FRED can of course still be disabled via the fred=off command line option.

---
 Documentation/admin-guide/kernel-parameters.txt | 4 ++--
 arch/x86/kernel/cpu/common.c                    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +2 -2
index 03a550630644..bfa8a20ccc37 100644
@@ -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.
+			off: disable FRED.
 
 	ftrace=[tracer]
 			[FTRACE] will set and start the specified tracer
arch/x86/kernel/cpu/common.c +1 -1
index a8ff4376c286..e22a49869380 100644
@@ -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);
 
 	arglen = cmdline_find_option(boot_command_line, "clearcpuid", arg, sizeof(arg));
Signature · 1 line
2.53.0
author maintainer
#3 lore raw

PATCH 2/2 x86/Kconfig: tighten up wording of the CONFIG_X86_FRED help text

In reply to H. Peter Anvin

The CONFIG_X86_FRED help text has both "try to" and "if the system supports it", which are redundant statements.

Remove "try to".

---
 arch/x86/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/Kconfig +1 -1
index e2df1b147184..876b663dcf38 100644
@@ -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.
Signature · 1 line
2.53.0
#4 lore raw
In reply to H. Peter Anvin

On 3/23/2026 1:15 PM, H. Peter Anvin wrote:

Can we please include this as well?

arch/x86/kernel/fred.c +0 -3
index e736b19e18de..117aa06d25ca 100644
@@ -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

Documentation/admin-guide/kernel-parameters.txt Kernel parameters · line 1753

Quoted 12 lines
Documentation/admin-guide/kernel-parameters.txt +1 -2
index 03a550630644..bfa8a20ccc37 100644
@@ -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.

Quoted 22 lines
Documentation/admin-guide/kernel-parameters.txt +1 -0
+			off: disable FRED.
 
 	ftrace=[tracer]
 			[FTRACE] will set and start the specified tracer
arch/x86/Kconfig +1 -1
index e2df1b147184..876b663dcf38 100644
@@ -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.
arch/x86/kernel/cpu/common.c +0 -0
index a8ff4376c286..e22a49869380 100644

arch/x86/kernel/cpu/common.c static void __init cpu_parse_early_param(void) · line 1750

Quoted 6 lines
arch/x86/kernel/cpu/common.c +1 -1
@@ -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?

Quoted 2 lines
arch/x86/kernel/cpu/common.c +0 -0
 	arglen = cmdline_find_option(boot_command_line, "clearcpuid", arg, sizeof(arg));
maintainer
#5 lore raw
Quoted 13 lines · Sohil Mehta

Review static void __init cpu_parse_early_param(void) · line 1750

Quoted 8 lines
(quoted diff) +1 -1
@@ -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?

+1 :)

author maintainer
#6 lore raw
Quoted 14 lines · Xin Li
Quoted 13 lines · Sohil Mehta

Review static void __init cpu_parse_early_param(void) · line 1750

Quoted 8 lines
(quoted diff) +1 -1
@@ -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?

Quoted 2 lines

+1 :)

It would change the meaning of something like "fred=0" though.

-hpa

#7 lore raw
Quoted 7 lines · H. Peter Anvin
Quoted 4 lines
Quoted 1 line

Nit: Would it be better to compare with "off" rather than not on?

+1 :)

It would change the meaning of something like "fred=0" though.

I don't believe we have ever supported fred=0 or fred=1, did we?

Also, I am not sure about letting userspace be creative with command line parameters :) For example, fred=yes and fred=enable will both pass the same check and cause FRED to be disabled.

#8 lore raw
Quoted 6 lines · Sohil Mehta
Quoted 5 lines · H. Peter Anvin
Quoted 4 lines
Quoted 1 line

Nit: Would it be better to compare with "off" rather than not on?

+1 :)

Quoted 6 lines
Quoted 2 lines

It would change the meaning of something like "fred=0" though.

I don't believe we have ever supported fred=0 or fred=1, did we?

Also, I am not sure about letting userspace be creative with command

s/userspace/users

Quoted 2 lines

line parameters :) For example, fred=yes and fred=enable will both pass the same check and cause FRED to be disabled.

author maintainer
#9 lore raw
In reply to Sohil Mehta
Quoted 6 lines · Sohil Mehta
Quoted 5 lines · H. Peter Anvin
Quoted 4 lines
Quoted 1 line

Nit: Would it be better to compare with "off" rather than not on?

+1 :)

Quoted 8 lines
Quoted 2 lines

It would change the meaning of something like "fred=0" though.

I don't believe we have ever supported fred=0 or fred=1, did we?

Also, I am not sure about letting userspace be creative with command line parameters :) For example, fred=yes and fred=enable will both pass the same check and cause FRED to be disabled.

Unfortunately right now we *are* being creative: anytime but the exact string "on" disables FRED. This is a general problem. In the kernel; overall I feel promoting foo= syntax for booleans, which was not the original style, was a mistake, but here we are.

Anyway, I don't have a strong preference and I think we can leave that policy decision to the maintainers.

#10 lore raw

On 3/24/2026 12:50 AM, H. Peter Anvin wrote:

Giving it one last try if I can change your mind :)

Quoted 10 lines · Sohil Mehta
Quoted 9 lines · H. Peter Anvin
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Nit: Would it be better to compare with "off" rather than not on?

+1 :)

It would change the meaning of something like "fred=0" though.

Quoted 7 lines
Quoted 5 lines

I don't believe we have ever supported fred=0 or fred=1, did we?

Also, I am not sure about letting userspace be creative with command line parameters :) For example, fred=yes and fred=enable will both pass the same check and cause FRED to be disabled.

Unfortunately right now we *are* being creative: anytime but the exact string "on" disables FRED.

You are right, we are accepting invalid inputs today. There is a slight difference though. The default right now is FRED disabled. So any invalid input would not change the kernel default. Only fred=on enables the feature.

With FRED proposed to be default on, I think we should match the above and only let fred=off disable it. All other inputs should be ignored.

Quoted 1 line

This is a general problem.

I agree. In general, we shouldn't even need special command line parameters to *disable* features. clearcpuid=fred would have been equivalent to fred=off if it didn't taint the kernel. I don't know the exact history about why the taint is needed.

Quoted 4 lines

In the kernel; overall I feel promoting foo= syntax for booleans, which was not the original style, was a mistake, but here we are.

Anyway, I don't have a strong preference and I think we can leave that policy decision to the maintainers.

Yes, that's completely fine with me. I won't push for it any further.

maintainer
#11 lore raw
Quoted 2 lines · Sohil Mehta

With FRED proposed to be default on, I think we should match the above and only let fred=off disable it. All other inputs should be ignored.

So we have only said so far that "on" enables FRED and "off" disables it. And we can do that by carving out the FRED option parsing into a separate function and acting only on those and ignoring the rest.

All those other fred=X things should simply be ignored.

Quoted 4 lines

I agree. In general, we shouldn't even need special command line parameters to *disable* features. clearcpuid=fred would have been equivalent to fred=off if it didn't taint the kernel. I don't know the exact history about why the taint is needed.

Because you should not poke at clearing CPUID features unless you know what you're doing and this cmdline option should not exist at all. But we have it so...

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
author maintainer
#12 lore raw
Quoted 10 lines · Borislav Petkov
Quoted 2 lines · Sohil Mehta

With FRED proposed to be default on, I think we should match the above and only let fred=off disable it. All other inputs should be ignored.

So we have only said so far that "on" enables FRED and "off" disables it. And we can do that by carving out the FRED option parsing into a separate function and acting only on those and ignoring the rest.

All those other fred=X things should simply be ignored.

Well, that's easy. I just didn't want to change existing behavior. If that is your policy decision then I'm fine with that.

We don't even need a new function; it is actually an even smaller change to the code than this patchset version, so I'll rev the patchset.

It WOULD be good to have a global function to parse boolean arguments in a kernel-coherent manner, but that is out of scope for this patchset.

Quoted 9 lines
Quoted 4 lines

I agree. In general, we shouldn't even need special command line parameters to *disable* features. clearcpuid=fred would have been equivalent to fred=off if it didn't taint the kernel. I don't know the exact history about why the taint is needed.

Because you should not poke at clearing CPUID features unless you know what you're doing and this cmdline option should not exist at all. But we have it so...

Well, it is useful for testing code paths for legacy hardware.

-hpa

maintainer
#13 lore raw
Quoted 8 lines · H. Peter Anvin

Well, that's easy. I just didn't want to change existing behavior. If that is your policy decision then I'm fine with that.

We don't even need a new function; it is actually an even smaller change to the code than this patchset version, so I'll rev the patchset.

It WOULD be good to have a global function to parse boolean arguments in a kernel-coherent manner, but that is out of scope for this patchset.

Right.

Quoted 6 lines
Quoted 4 lines

Because you should not poke at clearing CPUID features unless you know what you're doing and this cmdline option should not exist at all. But we have it so...

Well, it is useful for testing code paths for legacy hardware.

... which would presume you know what you're doing.

clearcpuid= is not something you or I or anyone else wants to debug when people start clearing random CPUID bits without knowing any better.

Thus the tainting.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
author maintainer
#14 lore raw
Quoted 10 lines · Borislav Petkov
Quoted 2 lines

Well, it is useful for testing code paths for legacy hardware.

... which would presume you know what you're doing.

clearcpuid= is not something you or I or anyone else wants to debug when people start clearing random CPUID bits without knowing any better.

Thus the tainting.

Exactly.

-hpa

#15 lore raw
In reply to Borislav Petkov
Quoted 5 lines · Borislav Petkov
Quoted 5 lines
Quoted 4 lines

Because you should not poke at clearing CPUID features unless you know what you're doing and this cmdline option should not exist at all. But we have it so...

Quoted 9 lines
Quoted 1 line

Well, it is useful for testing code paths for legacy hardware.

... which would presume you know what you're doing.

clearcpuid= is not something you or I or anyone else wants to debug when people start clearing random CPUID bits without knowing any better.

Thus the tainting.

Makes sense. Thanks for the insight.

maintainer
#16 lore raw
In reply to Sohil Mehta
Quoted 9 lines · Sohil Mehta

On 3/23/2026 1:15 PM, H. Peter Anvin wrote:

Can we please include this as well?

arch/x86/kernel/fred.c +0 -0
index e736b19e18de..117aa06d25ca 100644

arch/x86/kernel/fred.c EXPORT_PER_CPU_SYMBOL(fred_rsp0); · line 32

Quoted 9 lines
arch/x86/kernel/fred.c +0 -3
@@ -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

Yes please. This looks like some early bringup leftover.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette