From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753256AbdBNMk5 (ORCPT ); Tue, 14 Feb 2017 07:40:57 -0500 Received: from ozlabs.org ([103.22.144.67]:43053 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752515AbdBNMk3 (ORCPT ); Tue, 14 Feb 2017 07:40:29 -0500 X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 51c9c0843993528bffc920c54c2121d9e6f8b090 In-Reply-To: <1486547452-13510-2-git-send-email-anju@linux.vnet.ibm.com> To: Anju T , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org From: Michael Ellerman Cc: ananth@in.ibm.com, mahesh@linux.vnet.ibm.com, paulus@samba.org, mhiramat@kernel.org, naveen.n.rao@linux.vnet.ibm.com, hemant@linux.vnet.ibm.com, srikar@linux.vnet.ibm.com Subject: Re: [v4,1/2] arch/powerpc: Implement Optprobes Message-Id: <3vN27w1vFGz9s74@ozlabs.org> Date: Tue, 14 Feb 2017 23:40:28 +1100 (AEDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-02-08 at 09:50:51 UTC, Anju T wrote: > Current infrastructure of kprobe uses the unconditional trap instruction > to probe a running kernel. Optprobe allows kprobe to replace the trap with > a branch instruction to a detour buffer. Detour buffer contains instructions > to create an in memory pt_regs. Detour buffer also has a call to > optimized_callback() which in turn call the pre_handler(). > After the execution of the pre-handler, a call is made for instruction > emulation. The NIP is determined in advanced through dummy instruction > emulation and a branch instruction is created to the NIP at the end of > the trampoline. > > To address the limitation of branch instruction in POWER architecture, > detour buffer slot is allocated from a reserved area. For the time being, > 64KB is reserved in memory for this purpose. > > Instructions which can be emulated using analyse_instr() are the candidates > for optimization. Before optimization ensure that the address range > between the detour buffer allocated and the instruction being probed > is within +/- 32MB. > > Signed-off-by: Anju T Sudhakar > Signed-off-by: Naveen N. Rao > Acked-by: Masami Hiramatsu Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/51c9c0843993528bffc920c54c2121 cheers