mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "Luis R. Rodriguez" <mcgrof@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	kvm list <kvm@vger.kernel.org>, X86 ML <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Jan Beulich <JBeulich@suse.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@suse.de>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: [Xen-devel] [RFC v3 2/2] x86/xen: allow privcmd hypercalls to be preempted
Date: Thu, 22 Jan 2015 16:16:17 -0500	[thread overview]
Message-ID: <20150122161617.0ee2b092@gandalf.local.home> (raw)
In-Reply-To: <CALCETrUTekrhz=tXF=bAn1wuZBA+Kh+CgU+USwx--hNALvR5Mw@mail.gmail.com>

On Thu, 22 Jan 2015 12:58:00 -0800
Andy Lutomirski <luto@amacapital.net> wrote:

> On Thu, Jan 22, 2015 at 12:37 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> > On Thu, 22 Jan 2015 12:24:47 -0800
> > Andy Lutomirski <luto@amacapital.net> wrote:
> >
> >> > Also, please remove the "notrace", because function tracing goes an
> >> > extra step to not require RCU being visible. The only thing you get
> >> > with notrace is not being able to trace an otherwise traceable function.
> >> >
> >>
> >> Is this also true for kprobes?  And can kprobes nest inside function
> >> tracing hooks?
> >
> > No, kprobes are a bit more fragile than function tracing or tracepoints.
> >
> > And nothing should nest inside a function hook (except for interrupts,
> > they are fine).
> >
> 
> But kprobes do nest inside interrupts, right?

A kprobe being called while a function trace is happening is fine, but
you should not have the kprobe set directly inside the function trace
callback code. Because that means a kprobe could happen anywhere
function tracing is happening (for instance, in NMI context).

> 
> >>
> >> The other issue, above and beyond RCU, is that we can't let kprobes
> >> run on the int3 stack.  If Xen upcalls can happen when interrupts are
> >> off, then we may need this protection to prevent that type of
> >> recursion.  (This will be much less scary in 3.20, because userspace
> >> int3 instructions will no longer execute on the int3 stack.)
> >
> > Does this execute between the start of the int3 interrupt handler and
> > the call of do_int3()?
> 
> I doubt it.
> 
> The thing I worry about is that, if do_int3 nests inside itself by any
> means (e.g. int3 sends a signal, scheduling for whatever reason
> (really shouldn't happen, but I haven't looked that hard)), then we're
> completely hosed -- the inner int3 will overwrite the outer int3's
> stack frame.  Since I have no idea what Xen upcalls do, I don't know
> whether they can fire inside do_int3.

I thought there's logic in the do_int3 handler (in the assembly code)
that can handle nested int3s.

I'm not sure what xen does though.

-- Steve

  reply	other threads:[~2015-01-22 21:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22  2:17 [RFC v3 0/2] x86/xen: add xen hypercall preemption Luis R. Rodriguez
2015-01-22  2:17 ` [RFC v3 1/2] x86/xen: add xen_is_preemptible_hypercall() Luis R. Rodriguez
2015-01-22  3:07   ` Andy Lutomirski
2015-01-22 19:30     ` Luis R. Rodriguez
2015-01-22 20:01       ` Andy Lutomirski
2015-01-22 21:09         ` Luis R. Rodriguez
2015-01-22 21:44           ` Andrew Cooper
2015-01-22 22:44             ` Luis R. Rodriguez
2015-01-22  2:17 ` [RFC v3 2/2] x86/xen: allow privcmd hypercalls to be preempted Luis R. Rodriguez
2015-01-22  3:18   ` Andy Lutomirski
2015-01-22 12:55     ` [Xen-devel] " David Vrabel
2015-01-22 17:56       ` Luis R. Rodriguez
2015-01-22 19:30     ` Luis R. Rodriguez
2015-01-22 11:50   ` [Xen-devel] " Andrew Cooper
2015-01-22 13:56     ` Steven Rostedt
2015-01-22 18:39       ` Luis R. Rodriguez
2015-01-22 20:16         ` Steven Rostedt
2015-01-22 20:24           ` Andy Lutomirski
2015-01-22 20:37             ` Steven Rostedt
2015-01-22 20:58               ` Andy Lutomirski
2015-01-22 21:16                 ` Steven Rostedt [this message]
2015-01-22 21:21                   ` Andy Lutomirski
2015-01-22 22:29                 ` Andrew Cooper
2015-01-22 21:07           ` Paul E. McKenney
2015-01-22 18:41     ` Luis R. Rodriguez
2015-01-22 13:10   ` Julien Grall
2015-01-22 18:56     ` Luis R. Rodriguez
2015-01-22 20:31       ` Julien Grall

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=20150122161617.0ee2b092@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@suse.de \
    --cc=david.vrabel@citrix.com \
    --cc=hpa@zytor.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mcgrof@do-not-panic.com \
    --cc=mcgrof@suse.com \
    --cc=mingo@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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®