From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19041 invoked by alias); 12 Dec 2013 20:42:31 -0000 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 Received: (qmail 19009 invoked by uid 89); 12 Dec 2013 20:42:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Dec 2013 20:42:29 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBCKgHLD027481 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 12 Dec 2013 15:42:18 -0500 Received: from [10.3.113.74] (ovpn-113-74.phx2.redhat.com [10.3.113.74]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBCKgGjv029612; Thu, 12 Dec 2013 15:42:16 -0500 Message-ID: <52AA1FA8.30709@redhat.com> Date: Thu, 12 Dec 2013 20:42:00 -0000 From: Josh Stone User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Ingo Molnar , Masami Hiramatsu CC: Ananth N Mavinakayanahalli , Sandeepa Prabhu , x86@kernel.org, lkml , "Steven Rostedt (Red Hat)" , systemtap@sourceware.org, "David S. Miller" Subject: Re: [PATCH -tip v4 0/6] kprobes: introduce NOKPROBE_SYMBOL() and fixes crash bugs References: <20131204012841.22118.82992.stgit@kbuild-fedora.novalocal> <20131204084551.GA31772@gmail.com> <529FBA71.6070107@hitachi.com> <20131205102127.GA19923@gmail.com> <52A137B6.6030307@hitachi.com> <20131210152811.GA1195@gmail.com> <52A7CA0A.9060009@hitachi.com> <20131211133423.GB3101@gmail.com> <52A9515E.5050505@hitachi.com> <20131212140347.GA17059@gmail.com> In-Reply-To: <20131212140347.GA17059@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-q4/txt/msg00407.txt.bz2 On 12/12/2013 06:03 AM, Ingo Molnar wrote: >> No, because the int3 already changes the original instruction. >> This means that you cannot skip singlestep(or emulate) the >> instruction which is copied to execution buffer (ainsn->insn), >> even if you have such the flag. >> So, kprobe requires the annotations on the singlestep path. > I don't understand this reasoning. > > Lets assume we allow a probe to be inserted in the single-step path. > Such a probe will be an INT3 instruction and if it hits we get a > recursive INT3 invocation. In that case the INT3 handler should simply > restore the original instruction and _leave it so_. There's no > single-stepping needed - the probe is confused and must be discarded. So if you restore the original instruction, then you're essentially creating a dynamic blacklist for the singlestep path, right? I think that's fine, as long as you still allow recursive probes elsewhere to just singlestep and skip that occurrence. It also helps with the inlining issues, since an inlined function instance in the singlestep path can get dynamically blocked, while still allowing inline instances elsewhere to be probed normally. Then you don't have to force always/never inline decisions - whatever gcc decides to do with inlines and static functions can be dealt with. Josh