]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/fred: Fix 64bit identifier in fred_ss
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 2 Sep 2025 23:01:17 +0000 (00:01 +0100)
committerDave Hansen <dave.hansen@linux.intel.com>
Mon, 13 Oct 2025 21:05:42 +0000 (14:05 -0700)
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.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Xin Li (Intel) <xin@zytor.com>
Reviewed-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Acked-by: H. Peter Anvin (Intel) <hpa@zytor.com>
arch/x86/entry/entry_fred.c
arch/x86/include/asm/fred.h
arch/x86/include/asm/ptrace.h

index f004a4dc74c2dafa3c03e7d36e5182e2042e6124..94e626cc6a0742973c31e22def1aac982c3f6758 100644 (file)
@@ -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);
index 12b34d5b2953ea8f75f5621b00ef8ca54e063a57..2bb65677c079b23cc178fe6e2df3deeb65cd1a31 100644 (file)
@@ -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);
index 50f75467f73d0f897f78f766579dad9a9b4f3c92..37370c3b1ffd4021755e2ba9226cfc252892bb8e 100644 (file)
@@ -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.