Skip to content

Commit 4ab13be

Browse files
andyhhphansendc
authored andcommitted
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. 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>
1 parent 3a86608 commit 4ab13be

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

arch/x86/entry/entry_fred.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ static noinstr void fred_intx(struct pt_regs *regs)
7878
static __always_inline void fred_other(struct pt_regs *regs)
7979
{
8080
/* The compiler can fold these conditions into a single test */
81-
if (likely(regs->fred_ss.vector == FRED_SYSCALL && regs->fred_ss.lm)) {
81+
if (likely(regs->fred_ss.vector == FRED_SYSCALL && regs->fred_ss.l)) {
8282
regs->orig_ax = regs->ax;
8383
regs->ax = -ENOSYS;
8484
do_syscall_64(regs, regs->orig_ax);
8585
return;
8686
} else if (ia32_enabled() &&
87-
likely(regs->fred_ss.vector == FRED_SYSENTER && !regs->fred_ss.lm)) {
87+
likely(regs->fred_ss.vector == FRED_SYSENTER && !regs->fred_ss.l)) {
8888
regs->orig_ax = regs->ax;
8989
regs->ax = -ENOSYS;
9090
do_fast_syscall_32(regs);

arch/x86/include/asm/fred.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static __always_inline void fred_entry_from_kvm(unsigned int type, unsigned int
7979
.type = type,
8080
.vector = vector,
8181
.nmi = type == EVENT_TYPE_NMI,
82-
.lm = 1,
82+
.l = 1,
8383
};
8484

8585
asm_fred_entry_from_kvm(ss);

arch/x86/include/asm/ptrace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ struct fred_ss {
8484
: 4,
8585
/* Event was incident to enclave execution */
8686
enclave : 1,
87-
/* CPU was in long mode */
88-
lm : 1,
87+
/* CPU was in 64-bit mode */
88+
l : 1,
8989
/*
9090
* Nested exception during FRED delivery, not set
9191
* for #DF.

0 commit comments

Comments
 (0)