Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1052976iob; Fri, 13 May 2022 21:14:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTTabB/dt5lgCJgSoey1fIRVE3pJbrK1ldLnHyOAIfDPQ+cQZEOaTyjm+crbXmeq8Gyd1u X-Received: by 2002:adf:e289:0:b0:1e3:14ad:75fe with SMTP id v9-20020adfe289000000b001e314ad75femr6269849wri.685.1652501660546; Fri, 13 May 2022 21:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652501660; cv=none; d=google.com; s=arc-20160816; b=NgqBa4dd734G90djDDv1LvF5WJCnfX3EZWElZg/1/qwIAeyKaWreLY87l3aFKJWrHT 5+UYnAzSN4hHmAWXAc2Yd2HXGPUlb1E6hJfAP5rWZpI8CwrVyGCj79i8qg7zRAn7x3gX BaYLpMBbxcJaQUm1EwY3RQJth3gMTyZi6dT4Qx1PA+re8mCj2s/v8Z+BZLDS35wzIaPU KbWD8f7c4CaGaQHWnDzRH2J8fyBpzikm1rCbcnGwhIP2lXXjPeIZ/uNgKBaWHO0fxDZj S41UNf/C0XUaR8+rkewIUnRE7GU7q3Vd9gZjLVSV4uFhDUR1UmSKHe5z4oZnccVHFSfs UJsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=SrcU+IZwLimvMSa8b0DA5ypdU5nwtK5SGhn4b/d1ASI=; b=ykNwXuBnUkCQwI4cbeMJw5D4tRPVtFrwgkpZU+xwRmqLCOl4UcdCD3yb4sZeqgkPLf va4MkRjyjzFwwbxT0U6EIBAC9qh+/kysLBG83DOoM8ZpMy3Cw1E2ne6cAPC3ZYtCRQTw wRYTL2ijOpUZw8lKoxYUlZNB3qEpilsONmBg1cnQCkqoSrRVFp+u4iduFG3Opi5Ikk0E PdsJn4lezXsGp2VSKMi/rBz7rgXT8jLgdAD+RWANkQYa/6nk2JzgFwQPdxuis7ALahCm 00pT06ZgPuUm2fx30QJp/Hc4rSOaqB9UgCp5ZxjWMJf6R9tO5IR2lmj1KZtSn5QckrX9 jOdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 8-20020a056000154800b0020cdf9e668asi5410221wry.327.2022.05.13.21.14.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 21:14:20 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6F9A63065C3; Fri, 13 May 2022 17:45:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245533AbiEKPMP (ORCPT + 99 others); Wed, 11 May 2022 11:12:15 -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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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