Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/ptrace: Always inline trivial accessors

A KASAN build bloats these single load/store helpers such that
it fails to inline them:

vmlinux.o: error: objtool: irqentry_exit+0x5e8: call to instruction_pointer_set() with UACCESS enabled

Make sure the compiler isn't allowed to do stupid.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20251031105435.GU4068168@noisy.programming.kicks-ass.net

authored by

Peter Zijlstra and committed by
Ingo Molnar
1fe4002c 323d93f0

+10 -10
+10 -10
arch/x86/include/asm/ptrace.h
··· 187 187 extern void send_sigtrap(struct pt_regs *regs, int error_code, int si_code); 188 188 189 189 190 - static inline unsigned long regs_return_value(struct pt_regs *regs) 190 + static __always_inline unsigned long regs_return_value(struct pt_regs *regs) 191 191 { 192 192 return regs->ax; 193 193 } 194 194 195 - static inline void regs_set_return_value(struct pt_regs *regs, unsigned long rc) 195 + static __always_inline void regs_set_return_value(struct pt_regs *regs, unsigned long rc) 196 196 { 197 197 regs->ax = rc; 198 198 } ··· 277 277 } 278 278 #endif 279 279 280 - static inline unsigned long kernel_stack_pointer(struct pt_regs *regs) 280 + static __always_inline unsigned long kernel_stack_pointer(struct pt_regs *regs) 281 281 { 282 282 return regs->sp; 283 283 } 284 284 285 - static inline unsigned long instruction_pointer(struct pt_regs *regs) 285 + static __always_inline unsigned long instruction_pointer(struct pt_regs *regs) 286 286 { 287 287 return regs->ip; 288 288 } 289 289 290 - static inline void instruction_pointer_set(struct pt_regs *regs, 291 - unsigned long val) 290 + static __always_inline 291 + void instruction_pointer_set(struct pt_regs *regs, unsigned long val) 292 292 { 293 293 regs->ip = val; 294 294 } 295 295 296 - static inline unsigned long frame_pointer(struct pt_regs *regs) 296 + static __always_inline unsigned long frame_pointer(struct pt_regs *regs) 297 297 { 298 298 return regs->bp; 299 299 } 300 300 301 - static inline unsigned long user_stack_pointer(struct pt_regs *regs) 301 + static __always_inline unsigned long user_stack_pointer(struct pt_regs *regs) 302 302 { 303 303 return regs->sp; 304 304 } 305 305 306 - static inline void user_stack_pointer_set(struct pt_regs *regs, 307 - unsigned long val) 306 + static __always_inline 307 + void user_stack_pointer_set(struct pt_regs *regs, unsigned long val) 308 308 { 309 309 regs->sp = val; 310 310 }