]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/kprobes.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / kprobes.c
index 34a591283f5d9e5fb602e8e5f93e3dd5a1a1615e..b8c6743a13daddad0446d686d3f36436b3ac7531 100644 (file)
@@ -410,13 +410,13 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
 static void __kprobes clear_btf(void)
 {
        if (test_thread_flag(TIF_DEBUGCTLMSR))
-               wrmsrl(MSR_IA32_DEBUGCTLMSR, 0);
+               update_debugctlmsr(0);
 }
 
 static void __kprobes restore_btf(void)
 {
        if (test_thread_flag(TIF_DEBUGCTLMSR))
-               wrmsrl(MSR_IA32_DEBUGCTLMSR, current->thread.debugctlmsr);
+               update_debugctlmsr(current->thread.debugctlmsr);
 }
 
 static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
@@ -489,7 +489,7 @@ static int __kprobes reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
                break;
        case KPROBE_HIT_SS:
                if (p == kprobe_running()) {
-                       regs->flags &= ~TF_MASK;
+                       regs->flags &= ~X86_EFLAGS_TF;
                        regs->flags |= kcb->kprobe_saved_flags;
                        return 0;
                } else {
@@ -858,15 +858,15 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs)
        if (!cur)
                return 0;
 
+       resume_execution(cur, regs, kcb);
+       regs->flags |= kcb->kprobe_saved_flags;
+       trace_hardirqs_fixup_flags(regs->flags);
+
        if ((kcb->kprobe_status != KPROBE_REENTER) && cur->post_handler) {
                kcb->kprobe_status = KPROBE_HIT_SSDONE;
                cur->post_handler(cur, regs, 0);
        }
 
-       resume_execution(cur, regs, kcb);
-       regs->flags |= kcb->kprobe_saved_flags;
-       trace_hardirqs_fixup_flags(regs->flags);
-
        /* Restore back the original saved kprobes variables and continue. */
        if (kcb->kprobe_status == KPROBE_REENTER) {
                restore_previous_kprobe(kcb);