/* * This preempt_disable() matches the preempt_enable_no_resched() * in post_kprobe_handler(). */ preempt_disable(); 
static inline int kprobe_handler(struct pt_regs *regs){	struct kprobe *p;	int ret = 0;	unsigned int *addr = (unsigned int *)regs->nip;	/* Check we're not actually recursing */	if (kprobe_running()) {		/* We *are* holding lock here, so this is safe.		   Disarm the probe we just hit, and ignore it. */		p = get_kprobe(addr);		if (p) {			kprobe_opcode_t insn = *p->ainsn.insn;			if (kprobe_status == KPROBE_HIT_SS &&					is_trap(insn)) {				regs->msr &= ~MSR_SE;				regs->msr |= kprobe_saved_msr;				unlock_kprobes();				goto no_kprobe;			}			/* We have reentered the kprobe_handler(), since			 * another probe was hit while within the handler.			 * We here save the original kprobes variables and			 * just single step on the instruction of the new probe			 * without calling any user handlers.			 */			save_previous_kprobe();			current_kprobe = p;			kprobe_saved_msr = regs->msr;			p->nmissed++;			prepare_singlestep(p, regs);			kprobe_status = KPROBE_REENTER;			return 1;		} else {			p = current_kprobe;			if (p->break_handler && p->break_handler(p, regs)) {				goto ss_probe;			}		}		/* If it's not ours, can't be delete race, (we hold lock). */		goto no_kprobe;	}	lock_kprobes();	p = get_kprobe(addr);	if (!p) {		unlock_kprobes();		if (*addr != BREAKPOINT_INSTRUCTION) {			/*			 * PowerPC has multiple variants of the "trap"			 * instruction. If the current instruction is a			 * trap variant, it could belong to someone else			 */			kprobe_opcode_t cur_insn = *addr;			if (is_trap(cur_insn))		       		goto no_kprobe;			/*			 * The breakpoint instruction was removed right			 * after we hit it.  Another cpu has removed			 * either a probepoint or a debugger breakpoint			 * at this address.  In either case, no further			 * handling of this interrupt is appropriate.			 */			ret = 1;		}		/* Not one of ours: let kernel handle it */		goto no_kprobe;	}	kprobe_status = KPROBE_HIT_ACTIVE;	current_kprobe = p;	kprobe_saved_msr = regs->msr;	if (p->pre_handler && p->pre_handler(p, regs))		/* handler has already set things up, so skip ss setup */		return 1;ss_probe:	prepare_singlestep(p, regs);	kprobe_status = KPROBE_HIT_SS;	/*	 * This preempt_disable() matches the preempt_enable_no_resched()	 * in post_kprobe_handler().	 */	preempt_disable();	return 1;no_kprobe:	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/66ff2d0691e00e1e7bfdf398a970310c9a0fe671/kprobes.c/clean/arch/ppc64/kernel/kprobes.c