Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[muen/linux.git] / arch / x86 / entry / common.c
index 21dbdf0e476bbc8cc6641c2409835a9c34c9a239..74f6eee15179b51ea8b9ff758a6a0c02e8734d27 100644 (file)
@@ -154,6 +154,9 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags)
                if (cached_flags & _TIF_UPROBE)
                        uprobe_notify_resume(regs);
 
+               if (cached_flags & _TIF_PATCH_PENDING)
+                       klp_update_patch_state(current);
+
                /* deal with pending signal delivery */
                if (cached_flags & _TIF_SIGPENDING)
                        do_signal(regs);
@@ -166,9 +169,6 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags)
                if (cached_flags & _TIF_USER_RETURN_NOTIFY)
                        fire_user_return_notifiers();
 
-               if (cached_flags & _TIF_PATCH_PENDING)
-                       klp_update_patch_state(current);
-
                /* Disable IRQs and retry */
                local_irq_disable();