]> git.baikalelectronics.ru Git - kernel.git/commitdiff
entry: rseq: Call rseq_handle_notify_resume() in tracehook_notify_resume()
authorSean Christopherson <seanjc@google.com>
Wed, 1 Sep 2021 20:30:27 +0000 (13:30 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Sep 2021 14:24:01 +0000 (10:24 -0400)
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 7cceb67783a5
("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 <mathieu.desnoyers@efficios.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210901203030.1292304-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/arm/kernel/signal.c
arch/arm64/kernel/signal.c
arch/csky/kernel/signal.c
arch/mips/kernel/signal.c
arch/powerpc/kernel/signal.c
include/linux/tracehook.h
kernel/entry/common.c
kernel/entry/kvm.c

index d0a800be04869bc08534964351bf90fd3876a409..a41e27ace391fa98450e1abd9b9a58e12758cba2 100644 (file)
@@ -628,7 +628,6 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
                                uprobe_notify_resume(regs);
                        } else {
                                tracehook_notify_resume(regs);
-                               rseq_handle_notify_resume(NULL, regs);
                        }
                }
                local_irq_disable();
index 9fe70b12b34f62ff1c672a600bfcc585c70e7ab5..c287b9407f287f21ca18ab527bdd488485e9f72f 100644 (file)
@@ -940,10 +940,8 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_flags)
                        if (thread_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
                                do_signal(regs);
 
-                       if (thread_flags & _TIF_NOTIFY_RESUME) {
+                       if (thread_flags & _TIF_NOTIFY_RESUME)
                                tracehook_notify_resume(regs);
-                               rseq_handle_notify_resume(NULL, regs);
-                       }
 
                        if (thread_flags & _TIF_FOREIGN_FPSTATE)
                                fpsimd_restore_current_state();
index 312f046d452d87e19f6da7230d4ab50db1140ed3..bc4238b9f709a8304d1766f1d7e2d3b06d9ac53c 100644 (file)
@@ -260,8 +260,6 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
        if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
                do_signal(regs);
 
-       if (thread_info_flags & _TIF_NOTIFY_RESUME) {
+       if (thread_info_flags & _TIF_NOTIFY_RESUME)
                tracehook_notify_resume(regs);
-               rseq_handle_notify_resume(NULL, regs);
-       }
 }
index f1e985109da013276857529bece31ed5bdbb8559..c9b2a75563e128ed91225f6ba2cea89808bd8e8b 100644 (file)
@@ -906,10 +906,8 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused,
        if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
                do_signal(regs);
 
-       if (thread_info_flags & _TIF_NOTIFY_RESUME) {
+       if (thread_info_flags & _TIF_NOTIFY_RESUME)
                tracehook_notify_resume(regs);
-               rseq_handle_notify_resume(NULL, regs);
-       }
 
        user_enter();
 }
index e600764a926c67b89254f6314ba91e3af69a1306..b93b87df499d7e5dfd4cf33f48f6c58d569451db 100644 (file)
@@ -293,10 +293,8 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
                do_signal(current);
        }
 
-       if (thread_info_flags & _TIF_NOTIFY_RESUME) {
+       if (thread_info_flags & _TIF_NOTIFY_RESUME)
                tracehook_notify_resume(regs);
-               rseq_handle_notify_resume(NULL, regs);
-       }
 }
 
 static unsigned long get_tm_stackpointer(struct task_struct *tsk)
index 3e80c4bc66f7cdc2f27dbde3e9301c0afec32d07..2564b7434b4d73fbaa74a9d5ea587f50f84a3ebf 100644 (file)
@@ -197,6 +197,8 @@ static inline void tracehook_notify_resume(struct pt_regs *regs)
 
        mem_cgroup_handle_over_high();
        blkcg_maybe_throttle_current();
+
+       rseq_handle_notify_resume(NULL, regs);
 }
 
 /*
index bf16395b9e1351f843edce4335df8bddb5a49686..d5a61d565ad5d186e8a9e206a9e17b4d285f93f6 100644 (file)
@@ -171,10 +171,8 @@ static unsigned long exit_to_user_mode_loop(struct pt_regs *regs,
                if (ti_work & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
                        handle_signal_work(regs, ti_work);
 
-               if (ti_work & _TIF_NOTIFY_RESUME) {
+               if (ti_work & _TIF_NOTIFY_RESUME)
                        tracehook_notify_resume(regs);
-                       rseq_handle_notify_resume(NULL, regs);
-               }
 
                /* Architecture specific TIF work */
                arch_exit_to_user_mode_work(regs, ti_work);
index 049fd06b4c3de348d3e47a9691880c3272a81c8f..49972ee99aff6a5f033a18cb9f90fd91c0c0e211 100644 (file)
@@ -19,10 +19,8 @@ static int xfer_to_guest_mode_work(struct kvm_vcpu *vcpu, unsigned long ti_work)
                if (ti_work & _TIF_NEED_RESCHED)
                        schedule();
 
-               if (ti_work & _TIF_NOTIFY_RESUME) {
+               if (ti_work & _TIF_NOTIFY_RESUME)
                        tracehook_notify_resume(NULL);
-                       rseq_handle_notify_resume(NULL, NULL);
-               }
 
                ret = arch_xfer_to_guest_mode_handle_work(vcpu, ti_work);
                if (ret)