[PATCH] i386: remove xtime_lock'ing around cpufreq notifier
[powerpc.git] / arch / i386 / kernel / kprobes.c
index fc79e1e..b545bc7 100644 (file)
@@ -184,7 +184,7 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
 void __kprobes arch_remove_kprobe(struct kprobe *p)
 {
        mutex_lock(&kprobe_mutex);
-       free_insn_slot(p->ainsn.insn);
+       free_insn_slot(p->ainsn.insn, (p->ainsn.boostable == 1));
        mutex_unlock(&kprobe_mutex);
 }
 
@@ -333,7 +333,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
                return 1;
 
 ss_probe:
-#ifndef CONFIG_PREEMPT
+#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM)
        if (p->ainsn.boostable == 1 && !p->post_handler){
                /* Boost up -- we can execute copied instructions directly */
                reset_current_kprobe();
@@ -363,7 +363,7 @@ no_kprobe:
                        "       pushf\n"
                        /* skip cs, eip, orig_eax */
                        "       subl $12, %esp\n"
-                       "       pushl %gs\n"
+                       "       pushl %fs\n"
                        "       pushl %ds\n"
                        "       pushl %es\n"
                        "       pushl %eax\n"
@@ -387,7 +387,7 @@ no_kprobe:
                        "       popl %edi\n"
                        "       popl %ebp\n"
                        "       popl %eax\n"
-                       /* skip eip, orig_eax, es, ds, gs */
+                       /* skip eip, orig_eax, es, ds, fs */
                        "       addl $20, %esp\n"
                        "       popf\n"
                        "       ret\n");
@@ -408,7 +408,7 @@ fastcall void *__kprobes trampoline_handler(struct pt_regs *regs)
        spin_lock_irqsave(&kretprobe_lock, flags);
        head = kretprobe_inst_table_head(current);
        /* fixup registers */
-       regs->xcs = __KERNEL_CS;
+       regs->xcs = __KERNEL_CS | get_kernel_rpl();
        regs->eip = trampoline_address;
        regs->orig_eax = 0xffffffff;