Re: [PATCH v5 3.1.0-rc4-tip 13/26] x86: define a x86 specificexception notifier.

From: Oleg Nesterov
Date: Fri Oct 07 2011 - 14:35:21 EST


On 09/20, Srikar Dronamraju wrote:
>
> +int uprobe_exception_notify(struct notifier_block *self,
> + unsigned long val, void *data)
> +{
> + struct die_args *args = data;
> + struct pt_regs *regs = args->regs;
> + int ret = NOTIFY_DONE;
> +
> + /* We are only interested in userspace traps */
> + if (regs && !user_mode_vm(regs))
> + return NOTIFY_DONE;
> +
> + switch (val) {
> + case DIE_INT3:
> + /* Run your handler here */
> + if (uprobe_bkpt_notifier(regs))
> + ret = NOTIFY_STOP;
> + break;

OK, but I simply can't understand do_int3(). It uses DIE_INT3 or
DIE_TRAP depending on CONFIG_KPROBES.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/