Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754119AbbBTMwa (ORCPT ); Fri, 20 Feb 2015 07:52:30 -0500 Received: from mail-wg0-f54.google.com ([74.125.82.54]:56194 "EHLO mail-wg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753972AbbBTMw2 (ORCPT ); Fri, 20 Feb 2015 07:52:28 -0500 Date: Fri, 20 Feb 2015 13:52:23 +0100 From: Ingo Molnar To: Masami Hiramatsu Cc: Petr Mladek , "David S. Miller" , Anil S Keshavamurthy , Ananth NMavinakayanahalli , Frederic Weisbecker , Steven Rostedt , Jiri Kosina , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] kprobes/x86: Use 5-byte NOP when the code might be modified by ftrace Message-ID: <20150220125223.GA28882@gmail.com> References: <20150218212205.GA26334@gmail.com> <1424427402-11795-1-git-send-email-pmladek@suse.cz> <1424427402-11795-2-git-send-email-pmladek@suse.cz> <20150220102625.GC25076@gmail.com> <54E72ABA.8050804@hitachi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <54E72ABA.8050804@hitachi.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1318 Lines: 37 * Masami Hiramatsu wrote: > (2015/02/20 19:26), Ingo Molnar wrote: > > > > * Petr Mladek wrote: > > > >> can_probe() checks if the given address points to the > >> beginning of an instruction. It analyzes all the > >> instructions from the beginning of the function until the > >> given address. The code might be modified by another > >> Kprobe. In this case, the current code is read into a > >> buffer, int3 breakpoint is replaced by the saved opcode > >> in the buffer, and can_probe() analyzes the buffer > >> instead. > >> > >> [...] > > > > Had to drop this patch due to build failures on 32-bit x86: > > > > arch/x86/kernel/kprobes/core.c:258:40: error: ‘MCOUNT_INSN_SIZE’ undeclared (first use in this function) > > Oops, MCOUNT_INSN_SIZE actually depends on > CONFIG_FUNCTION_TRACER... I think we can use 5 instead of > that since we are copying NOP_ATOMIC5. Or just make the define more widely available? It's not like the size changes from disabling the function tracer. Thanks, Ingo -- 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/