Skip to content

Commit e2b48e4

Browse files
author
Peter Zijlstra
committed
x86/xen: Remove .fixup usage
Employ the fancy new EX_TYPE_IMM_REG to store -EFAULT in the return register and use this to remove some Xen .fixup usage. All callers of these functions only test for 0 return, so the actual return value change from -1 to -EFAULT is immaterial. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Reviewed-by: Josh Poimboeuf <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 99641e0 commit e2b48e4

File tree

1 file changed

+3
-11
lines changed
  • arch/x86/include/asm/xen

1 file changed

+3
-11
lines changed

arch/x86/include/asm/xen/page.h

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,7 @@ static inline int xen_safe_write_ulong(unsigned long *addr, unsigned long val)
9696

9797
asm volatile("1: mov %[val], %[ptr]\n"
9898
"2:\n"
99-
".section .fixup, \"ax\"\n"
100-
"3: sub $1, %[ret]\n"
101-
" jmp 2b\n"
102-
".previous\n"
103-
_ASM_EXTABLE(1b, 3b)
99+
_ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, %[ret])
104100
: [ret] "+r" (ret), [ptr] "=m" (*addr)
105101
: [val] "r" (val));
106102

@@ -110,16 +106,12 @@ static inline int xen_safe_write_ulong(unsigned long *addr, unsigned long val)
110106
static inline int xen_safe_read_ulong(const unsigned long *addr,
111107
unsigned long *val)
112108
{
113-
int ret = 0;
114109
unsigned long rval = ~0ul;
110+
int ret = 0;
115111

116112
asm volatile("1: mov %[ptr], %[rval]\n"
117113
"2:\n"
118-
".section .fixup, \"ax\"\n"
119-
"3: sub $1, %[ret]\n"
120-
" jmp 2b\n"
121-
".previous\n"
122-
_ASM_EXTABLE(1b, 3b)
114+
_ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, %[ret])
123115
: [ret] "+r" (ret), [rval] "+r" (rval)
124116
: [ptr] "m" (*addr));
125117
*val = rval;

0 commit comments

Comments
 (0)