Skip to contentSkip to conversation

x86/fred: Fix 64bit identifier in fred_ss

tip: x86/entry tip-bot2 for Andrew Cooper 1 participant 1 message Oct 13, 2025

Subsystems (4)
lore
Share & tools
lore

tip-bot2 for Andrew Cooper

author merge bot Applied
#0 lore raw

The following commit has been merged into the x86/entry branch of tip:

Commit-ID:     4ab13be5ed12f4954d1f46cc6298e1adb2d6681b
Gitweb:        https://git.kernel.org/tip/4ab13be5ed12f4954d1f46cc6298e1adb2d6681b
Author:        Andrew Cooper <[email protected]>
AuthorDate:    Wed, 03 Sep 2025 00:01:17 +01:00
Committer:     Dave Hansen <[email protected]>
CommitterDate: Mon, 13 Oct 2025 14:05:42 -07:00

x86/fred: Fix 64bit identifier in fred_ss

FRED can only be enabled in Long Mode. This is the 64bit mode (as opposed to compatibility mode) identifier, rather than being something hard-wired at 1.

No functional change.

---
 arch/x86/entry/entry_fred.c   | 4 ++--
 arch/x86/include/asm/fred.h   | 2 +-
 arch/x86/include/asm/ptrace.h | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
arch/x86/entry/entry_fred.c +2 -2
index f004a4d..94e626c 100644
@@ -78,13 +78,13 @@ static noinstr void fred_intx(struct pt_regs *regs)
 static __always_inline void fred_other(struct pt_regs *regs)
 {
 	/* The compiler can fold these conditions into a single test */
-	if (likely(regs->fred_ss.vector == FRED_SYSCALL && regs->fred_ss.lm)) {
+	if (likely(regs->fred_ss.vector == FRED_SYSCALL && regs->fred_ss.l)) {
 		regs->orig_ax = regs->ax;
 		regs->ax = -ENOSYS;
 		do_syscall_64(regs, regs->orig_ax);
 		return;
 	} else if (ia32_enabled() &&
-		   likely(regs->fred_ss.vector == FRED_SYSENTER && !regs->fred_ss.lm)) {
+		   likely(regs->fred_ss.vector == FRED_SYSENTER && !regs->fred_ss.l)) {
 		regs->orig_ax = regs->ax;
 		regs->ax = -ENOSYS;
 		do_fast_syscall_32(regs);
arch/x86/include/asm/fred.h +1 -1
index 12b34d5..2bb6567 100644
@@ -79,7 +79,7 @@ static __always_inline void fred_entry_from_kvm(unsigned int type, unsigned int 
 		.type   = type,
 		.vector = vector,
 		.nmi    = type == EVENT_TYPE_NMI,
-		.lm     = 1,
+		.l      = 1,
 	};
 
 	asm_fred_entry_from_kvm(ss);
arch/x86/include/asm/ptrace.h +2 -2
index 50f7546..37370c3 100644
@@ -84,8 +84,8 @@ struct fred_ss {
 			:  4,
 		/* Event was incident to enclave execution */
 		enclave	:  1,
-		/* CPU was in long mode */
-		lm	:  1,
+		/* CPU was in 64-bit mode */
+		l	:  1,
 		/*
 		 * Nested exception during FRED delivery, not set
 		 * for #DF.