Skip to content

Commit a68de80

Browse files
sean-jcbonzini
authored andcommitted
entry: rseq: Call rseq_handle_notify_resume() in tracehook_notify_resume()
Invoke rseq_handle_notify_resume() from tracehook_notify_resume() now that the two function are always called back-to-back by architectures that have rseq. The rseq helper is stubbed out for architectures that don't support rseq, i.e. this is a nop across the board. Note, tracehook_notify_resume() is horribly named and arguably does not belong in tracehook.h as literally every line of code in it has nothing to do with tracing. But, that's been true since commit a42c6de ("move key_repace_session_keyring() into tracehook_notify_resume()") first usurped tracehook_notify_resume() back in 2012. Punt cleaning that mess up to future patches. No functional change intended. Acked-by: Mathieu Desnoyers <[email protected]> Signed-off-by: Sean Christopherson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 8646e53 commit a68de80

File tree

8 files changed

+8
-19
lines changed

8 files changed

+8
-19
lines changed

arch/arm/kernel/signal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,6 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
628628
uprobe_notify_resume(regs);
629629
} else {
630630
tracehook_notify_resume(regs);
631-
rseq_handle_notify_resume(NULL, regs);
632631
}
633632
}
634633
local_irq_disable();

arch/arm64/kernel/signal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -940,10 +940,8 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_flags)
940940
if (thread_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
941941
do_signal(regs);
942942

943-
if (thread_flags & _TIF_NOTIFY_RESUME) {
943+
if (thread_flags & _TIF_NOTIFY_RESUME)
944944
tracehook_notify_resume(regs);
945-
rseq_handle_notify_resume(NULL, regs);
946-
}
947945

948946
if (thread_flags & _TIF_FOREIGN_FPSTATE)
949947
fpsimd_restore_current_state();

arch/csky/kernel/signal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,6 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
260260
if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
261261
do_signal(regs);
262262

263-
if (thread_info_flags & _TIF_NOTIFY_RESUME) {
263+
if (thread_info_flags & _TIF_NOTIFY_RESUME)
264264
tracehook_notify_resume(regs);
265-
rseq_handle_notify_resume(NULL, regs);
266-
}
267265
}

arch/mips/kernel/signal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,10 +906,8 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused,
906906
if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
907907
do_signal(regs);
908908

909-
if (thread_info_flags & _TIF_NOTIFY_RESUME) {
909+
if (thread_info_flags & _TIF_NOTIFY_RESUME)
910910
tracehook_notify_resume(regs);
911-
rseq_handle_notify_resume(NULL, regs);
912-
}
913911

914912
user_enter();
915913
}

arch/powerpc/kernel/signal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,8 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
293293
do_signal(current);
294294
}
295295

296-
if (thread_info_flags & _TIF_NOTIFY_RESUME) {
296+
if (thread_info_flags & _TIF_NOTIFY_RESUME)
297297
tracehook_notify_resume(regs);
298-
rseq_handle_notify_resume(NULL, regs);
299-
}
300298
}
301299

302300
static unsigned long get_tm_stackpointer(struct task_struct *tsk)

include/linux/tracehook.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ static inline void tracehook_notify_resume(struct pt_regs *regs)
197197

198198
mem_cgroup_handle_over_high();
199199
blkcg_maybe_throttle_current();
200+
201+
rseq_handle_notify_resume(NULL, regs);
200202
}
201203

202204
/*

kernel/entry/common.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,8 @@ static unsigned long exit_to_user_mode_loop(struct pt_regs *regs,
171171
if (ti_work & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
172172
handle_signal_work(regs, ti_work);
173173

174-
if (ti_work & _TIF_NOTIFY_RESUME) {
174+
if (ti_work & _TIF_NOTIFY_RESUME)
175175
tracehook_notify_resume(regs);
176-
rseq_handle_notify_resume(NULL, regs);
177-
}
178176

179177
/* Architecture specific TIF work */
180178
arch_exit_to_user_mode_work(regs, ti_work);

kernel/entry/kvm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ static int xfer_to_guest_mode_work(struct kvm_vcpu *vcpu, unsigned long ti_work)
1919
if (ti_work & _TIF_NEED_RESCHED)
2020
schedule();
2121

22-
if (ti_work & _TIF_NOTIFY_RESUME) {
22+
if (ti_work & _TIF_NOTIFY_RESUME)
2323
tracehook_notify_resume(NULL);
24-
rseq_handle_notify_resume(NULL, NULL);
25-
}
2624

2725
ret = arch_xfer_to_guest_mode_handle_work(vcpu, ti_work);
2826
if (ret)

0 commit comments

Comments
 (0)