Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753414Ab0A3RvG (ORCPT ); Sat, 30 Jan 2010 12:51:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752082Ab0A3RvF (ORCPT ); Sat, 30 Jan 2010 12:51:05 -0500 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.123]:60377 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751793Ab0A3RvD (ORCPT ); Sat, 30 Jan 2010 12:51:03 -0500 X-Authority-Analysis: v=1.0 c=1 a=VnNF1IyMAAAA:8 a=YaU6B9CEbnekWpMqVacA:9 a=oDO5V7FcrJZsU8IvJtIA:7 a=FUYnOcaKHY1XgjlAwjRseVHfc8EA:4 X-Cloudmark-Score: 0 X-Originating-IP: 74.67.89.75 Subject: Re: linux-next: add utrace tree From: Steven Rostedt To: Ingo Molnar Cc: Ananth N Mavinakayanahalli , Jim Keniston , Stephen Rothwell , Kyle Moffett , Arnaldo Carvalho de Melo , Peter Zijlstra , Fr??d??ric Weisbecker , Oleg Nesterov , LKML , Tom Tromey , "Frank Ch. Eigler" , linux-next@vger.kernel.org, "H. Peter Anvin" , utrace-devel@redhat.com, Linus Torvalds , Thomas Gleixner In-Reply-To: <20100129074241.GG14636@elte.hu> References: <1264575134.4283.1983.camel@laptop> <20100127085442.GA28422@elte.hu> <1264643539.5068.62.camel@localhost.localdomain> <20100128085502.GA7713@elte.hu> <20100129045546.GA16920@in.ibm.com> <20100129074241.GG14636@elte.hu> Content-Type: text/plain Date: Sat, 30 Jan 2010 12:49:10 -0500 Message-Id: <1264873751.4561.9155.camel@frodo> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2822 Lines: 70 On Fri, 2010-01-29 at 08:42 +0100, Ingo Molnar wrote: > * Ananth N Mavinakayanahalli wrote: > > > On Thu, Jan 28, 2010 at 09:55:02AM +0100, Ingo Molnar wrote: > > > > ... > > > > > Lets compare the two cases via a drawing. Your current uprobes submission > > > does: > > > > > > [kernel] do probe thing single-step trap > > > ^ | ^ | > > > | v | v > > > [user] INT3 XOL-ins next ins-stream > > > > > > ( add the need for serialization to make sure the whole single-step thing > > > does not get out of sync with reality. ) > > > > > > And emulator approach would do: > > > > > > [kernel] emul-demux-fastpath, do probe thing > > > ^ | > > > | v > > > [user] INT3 next ins-stream > > > > > > far simpler conceptually, and faster as well, because it's one kernel entry. > > > > Ingo, > > > > Yes, conceptually, emulation is simpler. In fact, it may even be the > > right thing to do from a housekeeping POV if gdb were enabled to use > > breakpoint assistance in the kernel. However... emulation is not > > easy. Just quoting Peter Anvin: > > > > > On the more general rule of interpretation: I'm really concerned about > > > having a bunch of partially-capable x86 interpreters all over the > > > kernel. x86 is *hard* to emulate, and it will only get harder as the > > > architecture evolves. > > > > > > -hpa > > This is obviously true for a full emulator. Except for the fact that: > > > Yes, I know you suggested we start with a small subset. > > and for the fact that we already have emulators in the kernel. But this would be emulating userspace instructions, correct? The kernel is limited to what instructions it can perform, no floating point for example (of course there are some exceptions). But generally, the instructions in the kernel should be easier to emulate than in userspace. Userspace is free to do any wacky thing it wants. Will this limit the ability to probe apps that take advantage of some strange op code that the user knows is available on their platform? -- Steve > > Plus we _already_ need to decode instructions for safe kprobing and have the > code for that upstream. So it's not like we can avoid decoding the > instructions. (and emulating certain instruction patterns is really just a > natural next step of a good decoder.) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/