Lines Matching refs:regs

33 static struct thread_info *pt_regs_to_thread_info(struct pt_regs *regs)  in pt_regs_to_thread_info()  argument
36 (unsigned long)(regs + 1) + TOP_OF_KERNEL_STACK_PADDING; in pt_regs_to_thread_info()
49 static void do_audit_syscall_entry(struct pt_regs *regs, u32 arch) in do_audit_syscall_entry() argument
53 audit_syscall_entry(regs->orig_ax, regs->di, in do_audit_syscall_entry()
54 regs->si, regs->dx, regs->r10); in do_audit_syscall_entry()
58 audit_syscall_entry(regs->orig_ax, regs->bx, in do_audit_syscall_entry()
59 regs->cx, regs->dx, regs->si); in do_audit_syscall_entry()
76 unsigned long syscall_trace_enter_phase1(struct pt_regs *regs, u32 arch) in syscall_trace_enter_phase1() argument
78 struct thread_info *ti = pt_regs_to_thread_info(regs); in syscall_trace_enter_phase1()
83 BUG_ON(regs != task_pt_regs(current)); in syscall_trace_enter_phase1()
108 sd.nr = regs->orig_ax; in syscall_trace_enter_phase1()
109 sd.instruction_pointer = regs->ip; in syscall_trace_enter_phase1()
112 sd.args[0] = regs->di; in syscall_trace_enter_phase1()
113 sd.args[1] = regs->si; in syscall_trace_enter_phase1()
114 sd.args[2] = regs->dx; in syscall_trace_enter_phase1()
115 sd.args[3] = regs->r10; in syscall_trace_enter_phase1()
116 sd.args[4] = regs->r8; in syscall_trace_enter_phase1()
117 sd.args[5] = regs->r9; in syscall_trace_enter_phase1()
121 sd.args[0] = regs->bx; in syscall_trace_enter_phase1()
122 sd.args[1] = regs->cx; in syscall_trace_enter_phase1()
123 sd.args[2] = regs->dx; in syscall_trace_enter_phase1()
124 sd.args[3] = regs->si; in syscall_trace_enter_phase1()
125 sd.args[4] = regs->di; in syscall_trace_enter_phase1()
126 sd.args[5] = regs->bp; in syscall_trace_enter_phase1()
134 regs->orig_ax = -1; in syscall_trace_enter_phase1()
155 do_audit_syscall_entry(regs, arch); in syscall_trace_enter_phase1()
164 long syscall_trace_enter_phase2(struct pt_regs *regs, u32 arch, in syscall_trace_enter_phase2() argument
167 struct thread_info *ti = pt_regs_to_thread_info(regs); in syscall_trace_enter_phase2()
172 BUG_ON(regs != task_pt_regs(current)); in syscall_trace_enter_phase2()
182 regs->flags |= X86_EFLAGS_TF; in syscall_trace_enter_phase2()
199 tracehook_report_syscall_entry(regs)) in syscall_trace_enter_phase2()
203 trace_sys_enter(regs, regs->orig_ax); in syscall_trace_enter_phase2()
205 do_audit_syscall_entry(regs, arch); in syscall_trace_enter_phase2()
207 return ret ?: regs->orig_ax; in syscall_trace_enter_phase2()
210 long syscall_trace_enter(struct pt_regs *regs) in syscall_trace_enter() argument
213 unsigned long phase1_result = syscall_trace_enter_phase1(regs, arch); in syscall_trace_enter()
216 return regs->orig_ax; in syscall_trace_enter()
218 return syscall_trace_enter_phase2(regs, arch, phase1_result); in syscall_trace_enter()
225 static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) in exit_to_usermode_loop() argument
243 uprobe_notify_resume(regs); in exit_to_usermode_loop()
247 do_signal(regs); in exit_to_usermode_loop()
251 tracehook_notify_resume(regs); in exit_to_usermode_loop()
260 cached_flags = READ_ONCE(pt_regs_to_thread_info(regs)->flags); in exit_to_usermode_loop()
269 __visible inline void prepare_exit_to_usermode(struct pt_regs *regs) in prepare_exit_to_usermode() argument
271 struct thread_info *ti = pt_regs_to_thread_info(regs); in prepare_exit_to_usermode()
282 exit_to_usermode_loop(regs, cached_flags); in prepare_exit_to_usermode()
302 static void syscall_slow_exit_work(struct pt_regs *regs, u32 cached_flags) in syscall_slow_exit_work() argument
306 audit_syscall_exit(regs); in syscall_slow_exit_work()
309 trace_sys_exit(regs, regs->ax); in syscall_slow_exit_work()
321 tracehook_report_syscall_exit(regs, step); in syscall_slow_exit_work()
328 __visible inline void syscall_return_slowpath(struct pt_regs *regs) in syscall_return_slowpath() argument
330 struct thread_info *ti = pt_regs_to_thread_info(regs); in syscall_return_slowpath()
336 WARN(irqs_disabled(), "syscall %ld left IRQs disabled", regs->orig_ax)) in syscall_return_slowpath()
344 syscall_slow_exit_work(regs, cached_flags); in syscall_return_slowpath()
347 prepare_exit_to_usermode(regs); in syscall_return_slowpath()
364 __always_inline void do_syscall_32_irqs_on(struct pt_regs *regs) in do_syscall_32_irqs_on() argument
366 struct thread_info *ti = pt_regs_to_thread_info(regs); in do_syscall_32_irqs_on()
367 unsigned int nr = (unsigned int)regs->orig_ax; in do_syscall_32_irqs_on()
380 nr = syscall_trace_enter(regs); in do_syscall_32_irqs_on()
390 regs->ax = ia32_sys_call_table[nr]( in do_syscall_32_irqs_on()
391 (unsigned int)regs->bx, (unsigned int)regs->cx, in do_syscall_32_irqs_on()
392 (unsigned int)regs->dx, (unsigned int)regs->si, in do_syscall_32_irqs_on()
393 (unsigned int)regs->di, (unsigned int)regs->bp); in do_syscall_32_irqs_on()
396 syscall_return_slowpath(regs); in do_syscall_32_irqs_on()
401 __visible void do_syscall_32_irqs_off(struct pt_regs *regs) in do_syscall_32_irqs_off() argument
404 do_syscall_32_irqs_on(regs); in do_syscall_32_irqs_off()
409 __visible long do_fast_syscall_32(struct pt_regs *regs) in do_fast_syscall_32() argument
424 regs->ip = landing_pad; in do_fast_syscall_32()
438 __get_user(*(u32 *)&regs->bp, in do_fast_syscall_32()
439 (u32 __user __force *)(unsigned long)(u32)regs->sp) in do_fast_syscall_32()
441 get_user(*(u32 *)&regs->bp, in do_fast_syscall_32()
442 (u32 __user __force *)(unsigned long)(u32)regs->sp) in do_fast_syscall_32()
448 regs->ax = -EFAULT; in do_fast_syscall_32()
452 prepare_exit_to_usermode(regs); in do_fast_syscall_32()
457 do_syscall_32_irqs_on(regs); in do_fast_syscall_32()
469 return regs->cs == __USER32_CS && regs->ss == __USER_DS && in do_fast_syscall_32()
470 regs->ip == landing_pad && in do_fast_syscall_32()
471 (regs->flags & (X86_EFLAGS_RF | X86_EFLAGS_TF)) == 0; in do_fast_syscall_32()
484 regs->cs == __USER_CS && regs->ss == __USER_DS && in do_fast_syscall_32()
485 regs->ip == landing_pad && in do_fast_syscall_32()
486 (regs->flags & (X86_EFLAGS_RF | X86_EFLAGS_TF | X86_EFLAGS_VM)) == 0; in do_fast_syscall_32()