From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24583 invoked by alias); 25 Nov 2009 16:12:56 -0000 Received: (qmail 24571 invoked by uid 22791); 25 Nov 2009 16:12:55 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Nov 2009 16:12:50 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAPGCnie022676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 Nov 2009 11:12:49 -0500 Received: from [10.16.2.46] (dhcp-100-2-46.bos.redhat.com [10.16.2.46]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAPGClAU015751; Wed, 25 Nov 2009 11:12:47 -0500 Message-ID: <4B0D5789.3000303@redhat.com> Date: Wed, 25 Nov 2009 16:12:00 -0000 From: Masami Hiramatsu User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: Jason Baron CC: Frederic Weisbecker , Ingo Molnar , Ananth N Mavinakayanahalli , lkml , systemtap , DLE , Jim Keniston , Srikar Dronamraju , Christoph Hellwig , Steven Rostedt , "H. Peter Anvin" , Anders Kaseorg , Tim Abbott , Andi Kleen , Mathieu Desnoyers Subject: Re: [PATCH -tip v5 07/10] kprobes/x86: Support kprobes jump optimization on x86 References: <20091123232115.22071.71558.stgit@dhcp-100-2-132.bos.redhat.com> <20091123232211.22071.58974.stgit@dhcp-100-2-132.bos.redhat.com> <20091124162708.GA29995@redhat.com> <4B0C1BF8.9060408@redhat.com> In-Reply-To: <4B0C1BF8.9060408@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2009-q4/txt/msg00695.txt.bz2 Masami Hiramatsu wrote: > Jason Baron wrote: >> Also, with multiple users we don't want to trample over each others code >> patching. Thus, if each sub-system could register some type of >> 'is_reserved()' callback, and then we can call all these call backs from >> the '__multibyte_poke()' routine before we do any patching to make sure >> that we aren't trampling on each others code. After a successful >> patching, each sub-system can update its reserved set of code as >> appropriate. I can code a prototype here, if this makes sense. > > Hmm, we have to implement it carefully, because here kprobes already > inserted int3 and optprobe rewrites the int3 again. If is_reserved() > returns 1 and multibyte_poke returns error, we can't optimize it anymore. IMHO, all text-modifiers except kprobes provide is_reserved() callback and kprobes cancels probing if its target address is reserved, since only kprobes changes texts anywhere while others changes texts at fixed addresses. Anyway, I think this will be another bugfix for current kprobes/alternative. Thank you, -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: mhiramat@redhat.com