Skip to content

Commit 5fc77b9

Browse files
author
Peter Zijlstra
committed
x86/segment: Remove .fixup usage
Create and use EX_TYPE_ZERO_REG to clear the register and retry the segment load on exception. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Josh Poimboeuf <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1c3b909 commit 5fc77b9

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

arch/x86/include/asm/extable_fixup_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@
4545

4646
#define EX_TYPE_IMM_REG 17 /* reg := (long)imm */
4747
#define EX_TYPE_EFAULT_REG (EX_TYPE_IMM_REG | EX_DATA_IMM(-EFAULT))
48+
#define EX_TYPE_ZERO_REG (EX_TYPE_IMM_REG | EX_DATA_IMM(0))
4849

4950
#endif

arch/x86/include/asm/segment.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,7 @@ do { \
307307
\
308308
asm volatile(" \n" \
309309
"1: movl %k0,%%" #seg " \n" \
310-
\
311-
".section .fixup,\"ax\" \n" \
312-
"2: xorl %k0,%k0 \n" \
313-
" jmp 1b \n" \
314-
".previous \n" \
315-
\
316-
_ASM_EXTABLE(1b, 2b) \
317-
\
310+
_ASM_EXTABLE_TYPE_REG(1b, 1b, EX_TYPE_ZERO_REG, %k0)\
318311
: "+r" (__val) : : "memory"); \
319312
} while (0)
320313

0 commit comments

Comments
 (0)