The patch titled kprobes: remove preempt_enable/disable from kprobe_handle_fault() has been added to the -mm tree. Its filename is kprobes-remove-preempt_enable-disable-from-kprobe_handle_fault.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: kprobes: remove preempt_enable/disable from kprobe_handle_fault() From: Harvey Harrison <harvey.harrison@xxxxxxxxx> Remove the preempt_disable/enable pair around kprobe_running which was originally added to avoid the assertion from smp_processor_id which would be hit an assertion if preemption was enabled. Kprobes can not be running if we are preemptible, so test explicitly for preemption and bail out before hitting kprobe_running(). Signed-off-by: Harvey Harrison <harvey.harrison@xxxxxxxxx> Cc: Heiko Carstens <heiko.carstens@xxxxxxxxxx> Acked-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx> Cc: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx> Cc: "Luck, Tony" <tony.luck@xxxxxxxxx> Cc: Paul Mackerras <paulus@xxxxxxxxx> Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Prasanna S Panchamukhi <prasanna@xxxxxxxxxx> Cc: Ananth N Mavinakayanahalli <ananth@xxxxxxxxxx> Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/kprobes.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff -puN include/linux/kprobes.h~kprobes-remove-preempt_enable-disable-from-kprobe_handle_fault include/linux/kprobes.h --- a/include/linux/kprobes.h~kprobes-remove-preempt_enable-disable-from-kprobe_handle_fault +++ a/include/linux/kprobes.h @@ -223,19 +223,16 @@ static inline struct kprobe *kprobe_runn return (__get_cpu_var(current_kprobe)); } +/* + * If it is a kprobe pagefault we can not be preemptible so return before + * calling kprobe_running() as it will assert on smp_processor_id if + * preemption is enabled. + */ static inline int kprobe_handle_fault(struct pt_regs *regs, int trapnr) { - int ret = 0; - - /* kprobe_running() needs smp_processor_id() */ - if (!user_mode(regs)) { - preempt_disable(); - if (kprobe_running() && kprobe_fault_handler(regs, trapnr)) - ret = 1; - preempt_enable(); - } - - return ret; + if (!user_mode(regs) && !preemptible() && kprobe_running()) + return kprobe_fault_handler(regs, trapnr); + return 0; } static inline void reset_current_kprobe(void) _ Patches currently in -mm which might be from harvey.harrison@xxxxxxxxx are origin.patch specialixc-fix-possible-double-unlock.patch git-x86.patch git-alsa.patch agp-fix-shadowed-variable-warning-in-amd-k7-agpc.patch cifs-remove-global_extern-macro.patch radeon-fix-integer-as-null-pointer-warnings-in-radeon_memc.patch git-dvb.patch git-dlm.patch git-kvm.patch pata_amd-fix-sparse-warning.patch jffs2-include-function-prototype-for-jffs2_ioctl.patch jffs2-fix-sparse-warning-in-nodemgmtc.patch jffs2-fix-sparse-warning-in-writec.patch jffs2-fix-sparse-warnings-in-gcc.patch git-ubi.patch git-nfsd.patch block-fix-shadowed-variable-warning-in-blk-mapc.patch block-remove-extern-on-function-definition.patch kernel-add-clamp-and-clamp_t-macros.patch kernel-add-clamp-and-clamp_t-macros-checkpatch-fixes.patch kernel-add-clamp-and-clamp_t-macros-fix.patch remove-sparse-warning-for-mmzoneh.patch remove-sparse-warning-for-mmzoneh-checkpatch-fixes.patch smack-fix-integer-as-null-pointer-warning-in-smack_lsmc.patch adfs-work-around-bogus-sparse-warning.patch coda-add-static-to-functions-in-dirc.patch befs-fix-sparse-warning-in-linuxvfsc.patch autofs4-fix-sparse-warning-in-rootc.patch ncpfs-add-prototypes-to-ncp_fsh.patch ncpfs-fix-sparse-warnings-in-ioctlc.patch ncpfs-fix-sparse-warning-in-ncpsign_kernelc.patch serial-remove-double-initializer.patch char-make-functions-static-in-synclinkmpc.patch kprobes-introduce-kprobe_handle_fault.patch kprobes-introduce-kprobe_handle_fault-ia64-fix.patch kprobes-remove-preempt_enable-disable-from-kprobe_handle_fault.patch capi-fix-sparse-warnings-using-integer-as-null-pointer.patch avm-fix-sparse-warning-using-integer-as-null-pointer.patch eicon-fix-sparse-integer-as-null-pointer-warnings.patch xen-make-blkif_getgeo-static.patch fbcon-replace-mono_col-macro-with-static-inline.patch fbcon-replace-mono_col-macro-with-static-inline-fix.patch md-fix-integer-as-null-pointer-warnings-in-mdc.patch jbd-sparse-warnings-in-revokec-journalc.patch udf-fix-sparse-warning-in-nameic.patch reiserfs-fix-sparse-warnings-in-fix_nodec.patch reiserfs-fix-sparse-warnings-in-do_balanc.patch reiserfs-fix-sparse-warning-in-nameic.patch reiserfs-fix-sparse-warnings-in-lbalancec.patch reiserfs-fix-sparse-warning-in-journalc.patch reiserfs-fix-more-sparse-warnings-in-do_balanc.patch cgroup-fix-sparse-warning-of-shadow-symbol-in-cgroupc.patch char-fix-sparse-shadowed-variable-warnings-in-espc.patch char-espc-fix-possible-double-unlock.patch char-rocketc-fix-sparse-variable-shadowing-and-int-as-null-pointer.patch cycladesc-fix-sparse-shadowed-variable-warnings.patch epcac-static-functions-and-integer-as-null-pointer-fixes.patch epcac-static-functions-and-integer-as-null-pointer-fixes-checkpatch-fixes.patch mm-remove-remaining-__function__-occurances.patch block-remove-remaining-__function__-occurances.patch kernel-replace-remaining-__function__-occurances.patch lib-replace-remaining-__function__-occurances.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html