Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753670Ab0A0Kox (ORCPT ); Wed, 27 Jan 2010 05:44:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751923Ab0A0Kow (ORCPT ); Wed, 27 Jan 2010 05:44:52 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:38167 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751393Ab0A0Kou (ORCPT ); Wed, 27 Jan 2010 05:44:50 -0500 Date: Wed, 27 Jan 2010 02:43:39 -0800 (PST) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Peter Zijlstra cc: Tom Tromey , Kyle Moffett , "Frank Ch. Eigler" , Oleg Nesterov , Andrew Morton , Stephen Rothwell , Fr??d??ric Weisbecker , LKML , Steven Rostedt , Arnaldo Carvalho de Melo , linux-next@vger.kernel.org, "H. Peter Anvin" , utrace-devel@redhat.com, Thomas Gleixner , JimKeniston Subject: Re: linux-next: add utrace tree In-Reply-To: <1264575134.4283.1983.camel@laptop> Message-ID: References: <20100121013822.28781960.sfr@canb.auug.org.au> <20100122005147.GD22003@redhat.com> <20100121170541.7425ff10.akpm@linux-foundation.org> <20100122182827.GA13185@redhat.com> <20100122200129.GG22003@redhat.com> <20100122221348.GA4263@redhat.com> <1264575134.4283.1983.camel@laptop> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1310 Lines: 30 On Wed, 27 Jan 2010, Peter Zijlstra wrote: > > Right, so you're going to love uprobes, which does exactly that. The > current proposal is overwriting the target instruction with an INT3 and > injecting an extra vma into the target process's address space > containing the original instruction(s) and possible jumps back to the > old code stream. Just out of interest, how does it handle the threading issue? Last I saw, at least some CPU people were _very_ nervous about overwriting instructions if another CPU might be just about to execute them. Even the "overwrite only the first byte with 'int3'" made them go "umm, I need to talk to some core CPU people to see if that's ok". They mumble about possible CPU errata, I$ coherency, instruction retry etc. I realize kprobes does this very thing, but kprobes is esoteric stuff and doesn't have much choice. In user space, you _could_ do the modification on a different physical page and then just switch the page table entry instead, and not get into the whole D$/I$ coherency thing at all. Linus -- 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/