From: Ingo Molnar <mingo@kernel.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, Yang Bo <yangbo@deepin.com>,
Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org,
Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Steven Rostedt <rostedt@goodmis.org>,
Laura Abbott <labbott@redhat.com>
Subject: Re: [PATCH -tip] x86: kprobes: Cleanup preempt disabling and enabling
Date: Sat, 3 Mar 2018 10:58:23 +0100 [thread overview]
Message-ID: <20180303095823.phaoeuvcjhoirwg3@gmail.com> (raw)
In-Reply-To: <152004878307.12012.17534094592580782444.stgit@devbox>
* Masami Hiramatsu <mhiramat@kernel.org> wrote:
> +/*
> + * Interrupts are disabled on entry as trap3 is an interrupt gate and they
> + * remain disabled throughout this function.
> + */
> +int kprobe_int3_handler(struct pt_regs *regs)
> +{
> + struct kprobe_ctlblk *kcb;
> + int ret;
> +
> + if (user_mode(regs))
> + return 0;
> +
> + /*
> + * We don't want to be preempted for the entire
> + * duration of kprobe processing.
> + */
> + preempt_disable();
> +
> + kcb = get_kprobe_ctlblk();
> + ret = kprobe_int3_dispatcher(regs, kcb);
> +
> + if (!kprobe_ready_for_singlestep(regs))
> + preempt_enable_no_resched();
> +
> + return ret;
What's the point of disabling preemption, if IRQs are disabled already?
There's no preemption when IRQs are off...
Thanks,
Ingo
next prev parent reply other threads:[~2018-03-03 9:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-03 3:46 Masami Hiramatsu
2018-03-03 9:58 ` Ingo Molnar [this message]
2018-03-03 12:25 ` Masami Hiramatsu
2018-03-04 9:50 ` Masami Hiramatsu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180303095823.phaoeuvcjhoirwg3@gmail.com \
--to=mingo@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=ananth@linux.vnet.ibm.com \
--cc=hpa@zytor.com \
--cc=labbott@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yangbo@deepin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®