Skip to content

Commit 1c3b909

Browse files
author
Peter Zijlstra
committed
x86/fpu: Remove .fixup usage
Employ EX_TYPE_EFAULT_REG to store '-EFAULT' into the %[err] register on exception. All the callers only ever test for 0, so the change from -1 to -EFAULT is immaterial. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Josh Poimboeuf <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e2b48e4 commit 1c3b909

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

arch/x86/kernel/fpu/legacy.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ static inline void ldmxcsr(u32 mxcsr)
3535
int err; \
3636
asm volatile("1:" #insn "\n\t" \
3737
"2:\n" \
38-
".section .fixup,\"ax\"\n" \
39-
"3: movl $-1,%[err]\n" \
40-
" jmp 2b\n" \
41-
".previous\n" \
42-
_ASM_EXTABLE(1b, 3b) \
38+
_ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, %[err]) \
4339
: [err] "=r" (err), output \
4440
: "0"(0), input); \
4541
err; \

arch/x86/kernel/fpu/xstate.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,7 @@ static inline u64 xfeatures_mask_independent(void)
108108
"\n" \
109109
"xor %[err], %[err]\n" \
110110
"3:\n" \
111-
".pushsection .fixup,\"ax\"\n" \
112-
"4: movl $-2, %[err]\n" \
113-
"jmp 3b\n" \
114-
".popsection\n" \
115-
_ASM_EXTABLE(661b, 4b) \
111+
_ASM_EXTABLE_TYPE_REG(661b, 3b, EX_TYPE_EFAULT_REG, %[err]) \
116112
: [err] "=r" (err) \
117113
: "D" (st), "m" (*st), "a" (lmask), "d" (hmask) \
118114
: "memory")

0 commit comments

Comments
 (0)