Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753204AbbBXKYl (ORCPT ); Tue, 24 Feb 2015 05:24:41 -0500 Received: from mail9.hitachi.co.jp ([133.145.228.44]:57681 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752601AbbBXKYj (ORCPT ); Tue, 24 Feb 2015 05:24:39 -0500 Message-ID: <54EC5160.7090400@hitachi.com> Date: Tue, 24 Feb 2015 19:24:32 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Eugene Shatokhin Cc: linux-kernel@vger.kernel.org Subject: Re: Re: Kprobes: pre-handler with interrupts enabled - is it possible? References: <54EB4194.7040901@rosalab.ru> <54EBF464.7020704@hitachi.com> <54EC1487.4020902@rosalab.ru> In-Reply-To: <54EC1487.4020902@rosalab.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1797 Lines: 46 (2015/02/24 15:04), Eugene Shatokhin wrote: > 24.02.2015 06:47, Masami Hiramatsu пишет: >> No, that is not allowed. I mean, you can do anything you want to do >> on your handler (enabling preemption/irq etc.) but the result may be >> not safe (it can crash your kernel, but it's not a kprobes' bug). > > Yes, that is why I am asking. > >> Actually, enable interrupts on kprobe handlers can cause reentering >> kprobes (by kprobes on interrupt handlers), and currently kprobe skips >> all those reentered kprobes. >> Is it acceptable that some of your kprobe handlers are not fired when >> hitting? > > I think, yes. When a software breakpoint hits, my system decodes the > instruction, finds the address that is about to be accessed and tries to > place a hardware breakpoint on that memory area. > > There are only 4 hardware breakpoints a CPU can use on x86, so if the > software breakpoint hits too often, the system will not be able to > process all hits anyway because all HW breakpoints may be already in use. > >> Would you mean sleep on your handler?? > > No, I use mdelay(). It is, in essence, a busy-wait loop as far as I > know. The delay intervals may vary, the default is 5 jiffies. Hmm, here I couldn't understand. If mdelay() does busy-wait loop, why would you like to enable irq?? Other code doesn't work on the core while waiting. Thank you, -- Masami HIRAMATSU Software Platform Research Dept. Linux Technology Research Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: masami.hiramatsu.pt@hitachi.com -- 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/