Pull locking fixes from Borislav Petkov: - Allow the compiler to optimize away unused percpu accesses and change the local_lock_* macros back to inline functions - A couple of fixes to static call insn patching * tag 'locking_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: Revert "mm/page_alloc: mark pagesets as __maybe_unused" Revert "locking/local_lock: Make the empty local_lock_*() function a macro." x86/percpu: Remove volatile from arch_raw_cpu_ptr(). static_call: Remove __DEFINE_STATIC_CALL macro static_call: Properly initialise DEFINE_STATIC_CALL_RET0() static_call: Don't make __static_call_return0 static x86,static_call: Fix __static_call_return0 for i386
Showing the changes to arch (4 of 10 files). Show all
Unified · Split
| @@ -24,5 +24,6 @@ · 23 unmodified lines | ||
| 24 | 24 | |
| 25 | 25 | #define ARCH_DEFINE_STATIC_CALL_TRAMP(name, func) __PPC_SCT(name, "b " #func) |
| 26 | 26 | #define ARCH_DEFINE_STATIC_CALL_NULL_TRAMP(name) __PPC_SCT(name, "blr") |
| 27 | +#define ARCH_DEFINE_STATIC_CALL_RET0_TRAMP(name) __PPC_SCT(name, "b .+20") | |
| 27 | 28 | |
| 28 | 29 | #endif /* _ASM_POWERPC_STATIC_CALL_H */ |
| @@ -38,9 +38,9 @@ · 37 unmodified lines | ||
| 38 | 38 | #define arch_raw_cpu_ptr(ptr) \ |
| 39 | 39 | ({ \ |
| 40 | 40 | unsigned long tcp_ptr__; \ |
| 41 | − asm volatile("add " __percpu_arg(1) ", %0" \ | |
| 42 | − : "=r" (tcp_ptr__) \ | |
| 43 | − : "m" (this_cpu_off), "0" (ptr)); \ | |
| 41 | + asm ("add " __percpu_arg(1) ", %0" \ | |
| 42 | + : "=r" (tcp_ptr__) \ | |
| 43 | + : "m" (this_cpu_off), "0" (ptr)); \ | |
| 44 | 44 | (typeof(*(ptr)) __kernel __force *)tcp_ptr__; \ |
| 45 | 45 | }) |
| 46 | 46 | #else |
| @@ -38,6 +38,8 @@ · 37 unmodified lines | ||
| 38 | 38 | #define ARCH_DEFINE_STATIC_CALL_NULL_TRAMP(name) \ |
| 39 | 39 | __ARCH_DEFINE_STATIC_CALL_TRAMP(name, "ret; int3; nop; nop; nop") |
| 40 | 40 | |
| 41 | +#define ARCH_DEFINE_STATIC_CALL_RET0_TRAMP(name) \ | |
| 42 | + ARCH_DEFINE_STATIC_CALL_TRAMP(name, __static_call_return0) | |
| 41 | 43 | |
| 42 | 44 | #define ARCH_ADD_TRAMP_KEY(name) \ |
| 43 | 45 | asm(".pushsection .static_call_tramp_key, \"a\" \n" \ |
| @@ -12,10 +12,9 @@ enum insn_type { · 11 unmodified lines | ||
| 12 | 12 | }; |
| 13 | 13 | |
| 14 | 14 | /* |
| 15 | − * data16 data16 xorq %rax, %rax - a single 5 byte instruction that clears %rax | |
| 16 | − * The REX.W cancels the effect of any data16. | |
| 15 | + * cs cs cs xorl %eax, %eax - a single 5 byte instruction that clears %[er]ax | |
| 17 | 16 | */ |
| 18 | −static const u8 xor5rax[] = { 0x66, 0x66, 0x48, 0x31, 0xc0 }; | |
| 17 | +static const u8 xor5rax[] = { 0x2e, 0x2e, 0x2e, 0x31, 0xc0 }; | |
| 19 | 18 | |
| 20 | 19 | static const u8 retinsn[] = { RET_INSN_OPCODE, 0xcc, 0xcc, 0xcc, 0xcc }; |
| 21 | 20 | |