From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93D09C433EF for ; Wed, 11 May 2022 15:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245543AbiEKPMQ (ORCPT ); Wed, 11 May 2022 11:12:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245505AbiEKPMO (ORCPT ); Wed, 11 May 2022 11:12:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3C6A6211B for ; Wed, 11 May 2022 08:12:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5C1BE6186A for ; Wed, 11 May 2022 15:12:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AB63C340EE; Wed, 11 May 2022 15:12:09 +0000 (UTC) Date: Wed, 11 May 2022 11:12:07 -0400 From: Steven Rostedt To: Masami Hiramatsu Cc: Mark Rutland , Wang ShaoBo , cj.chengjian@huawei.com, huawei.libin@huawei.com, xiexiuqi@huawei.com, liwei391@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, zengshun.wu@outlook.com, Jiri Olsa Subject: Re: [RFC PATCH -next v2 3/4] arm64/ftrace: support dynamically allocated trampolines Message-ID: <20220511111207.25d1a693@gandalf.local.home> In-Reply-To: <20220511233450.40136cdf6a53eb32cd825be8@kernel.org> References: <20220421100639.03c0d123@gandalf.local.home> <20220421114201.21228eeb@gandalf.local.home> <20220421130648.56b21951@gandalf.local.home> <20220422114541.34d71ad9@gandalf.local.home> <20220426174749.b5372c5769af7bf901649a05@kernel.org> <20220505121538.04773ac98e2a8ba17f675d39@kernel.org> <20220509142203.6c4f2913@gandalf.local.home> <20220510181012.d5cba23a2547f14d14f016b9@kernel.org> <20220510104446.6d23b596@gandalf.local.home> <20220511233450.40136cdf6a53eb32cd825be8@kernel.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 May 2022 23:34:50 +0900 Masami Hiramatsu wrote: > OK, so fregs::regs will have a subset of pt_regs, and accessibility of > the registers depends on the architecture. If we can have a checker like > > ftrace_regs_exist(fregs, reg_offset) Or something. I'd have to see the use case. > > kprobe on ftrace or fprobe user (BPF) can filter user's requests. > I think I can introduce a flag for kprobes so that user can make a > kprobe handler only using a subset of registers. > Maybe similar filter code is also needed for BPF 'user space' library > because this check must be done when compiling BPF. Is there any other case without full regs that the user would want anything other than the args, stack pointer and instruction pointer? That is, have a flag that says "only_args" or something, that says they will only get the registers for arguments, a stack pointer, and the instruction pointer (note, the fregs may not have the instruction pointer as that is passed to the the caller via the "ip" parameter. If the fregs needs that, we can add a "ftrace_regs_set_ip()" before calling the callback registered to the fprobe). -- Steve