Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754398AbaKSLV1 (ORCPT ); Wed, 19 Nov 2014 06:21:27 -0500 Received: from mail-wi0-f179.google.com ([209.85.212.179]:39506 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbaKSLVZ (ORCPT ); Wed, 19 Nov 2014 06:21:25 -0500 MIME-Version: 1.0 In-Reply-To: <20141118145643.GO18842@arm.com> References: <1416292375-29560-1-git-send-email-dave.long@linaro.org> <1416292375-29560-2-git-send-email-dave.long@linaro.org> <20141118145643.GO18842@arm.com> Date: Wed, 19 Nov 2014 16:51:24 +0530 Message-ID: Subject: Re: [PATCH v3 1/5] arm64: Kprobes with single stepping support From: Sandeepa Prabhu To: Will Deacon Cc: David Long , "linux-arm-kernel@lists.infradead.org" , Russell King , William Cohen , Catalin Marinas , "Jon Medhurst (Tixy)" , Masami Hiramatsu , Ananth N Mavinakayanahalli , Anil S Keshavamurthy , "davem@davemloft.net" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18 November 2014 20:26, Will Deacon wrote: > One thing I noticed looking through this patch is that we're effectively > reinventing a bunch of the instruction decoding logic that we already have > in the kernel (introduced since Sandeepa last sent his patch). > > Could you take a look at include/asm/insn.h and kernel/insn.c please, and > see if you can at least consolidate some of this? Some of it should be easy > (i.e. reusing masks, using existing #defines to construct BRK encodings), > but I appreciate there may be places where kprobes needs to add extra bits, > in which case I'd really like to keep this all together if at all possible. > > We're currently in a position where the module loader, BPF jit, ftrace and > the proposed alternative patching scheme are all using the same instruction > manipulation functions, so we should try to continue that trend if we can. Will, kernel/insn.c support generating instruction encodings(forming opcodes with given specifications), so for kprobes, only BRK encoding can use this mechanism. For instruction simulation, the instruction behavior should be simulated on saved pt_regs, which is not supported on insn.c routines, so still need probes-simulate-insn.c. Please point me if I am missing something here. > > Thanks, > > Will -- 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/