Merge branch 'core/urgent' into core/entry
[platform/kernel/linux-rpi.git] / kernel / entry / common.c
index 0a1e20f..3a1dfec 100644 (file)
@@ -135,7 +135,15 @@ static __always_inline void exit_to_user_mode(void)
 }
 
 /* Workaround to allow gradual conversion of architecture code */
-void __weak arch_do_signal(struct pt_regs *regs) { }
+void __weak arch_do_signal_or_restart(struct pt_regs *regs, bool has_signal) { }
+
+static void handle_signal_work(struct pt_regs *regs, unsigned long ti_work)
+{
+       if (ti_work & _TIF_NOTIFY_SIGNAL)
+               tracehook_notify_signal();
+
+       arch_do_signal_or_restart(regs, ti_work & _TIF_SIGPENDING);
+}
 
 static unsigned long exit_to_user_mode_loop(struct pt_regs *regs,
                                            unsigned long ti_work)
@@ -157,11 +165,10 @@ static unsigned long exit_to_user_mode_loop(struct pt_regs *regs,
                if (ti_work & _TIF_PATCH_PENDING)
                        klp_update_patch_state(current);
 
-               if (ti_work & _TIF_SIGPENDING)
-                       arch_do_signal(regs);
+               if (ti_work & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
+                       handle_signal_work(regs, ti_work);
 
                if (ti_work & _TIF_NOTIFY_RESUME) {
-                       clear_thread_flag(TIF_NOTIFY_RESUME);
                        tracehook_notify_resume(regs);
                        rseq_handle_notify_resume(NULL, regs);
                }
@@ -320,7 +327,7 @@ noinstr irqentry_state_t irqentry_enter(struct pt_regs *regs)
                /*
                 * If RCU is not watching then the same careful
                 * sequence vs. lockdep and tracing is required
-                * as in irq_enter_from_user_mode().
+                * as in irqentry_enter_from_user_mode().
                 */
                lockdep_hardirqs_off(CALLER_ADDR0);
                rcu_irq_enter();
@@ -338,10 +345,10 @@ noinstr irqentry_state_t irqentry_enter(struct pt_regs *regs)
         * already contains a warning when RCU is not watching, so no point
         * in having another one here.
         */
+       lockdep_hardirqs_off(CALLER_ADDR0);
        instrumentation_begin();
        rcu_irq_enter_check_tick();
-       /* Use the combo lockdep/tracing function */
-       trace_hardirqs_off();
+       trace_hardirqs_off_finish();
        instrumentation_end();
 
        return ret;