Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp679910pxm; Fri, 25 Feb 2022 17:04:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfLHc7yQNC067sOJKLtJfNbJuaaO+Bb8Nz/KmtPhxnBsC2yMW+op/IWdolvLnAJBSpTFVa X-Received: by 2002:a05:6402:2801:b0:410:a592:a5d0 with SMTP id h1-20020a056402280100b00410a592a5d0mr9489347ede.253.1645837483237; Fri, 25 Feb 2022 17:04:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645837483; cv=none; d=google.com; s=arc-20160816; b=pQqFjci0i8KZnjZ+AokHi8M/n0E6ui67Y1OA9BMazDKx0YMJxUFmx/3a5OXaT97pO9 nTh0upib/TdYvdY5CW0QJTuL28nkrc6xaiZznVw4TsbbG+ldIsHjNdDTi63mXuXMbOCh +I8dZZypOQJW1gmtwO1AjALkow0QrZxbWXZnzfnu//R84fi1BVRTvvORUH7TbAGrWuA0 TB45cFzPSkFQWcDXkfs+63wH0UwY+6vDYaHOPWcLR9VJHZEJgc9hRQrFskqb0JtpBska 1HnSz7AwHdHv+S3dHSuIFt0tmPlOwUGC5v9F2BZPLHFmB51HjCSj5Pw9T1xWT67JDOB2 6qOg== 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=KP+tuznEeOujKhLuZPOcz4KdX18X2S5AOyTvyZqLyH4=; b=gaT/dYVx7gh2Ukb3B4THBSKcxQ4VBMr03bM7Pt592PlBXTVKqi4KOh5o9GVVI9CO3V wknqIwH69kvvAdgRd9ZNIKCNHh0vRWu8DXSMASZs6C2Aj021Euw5m80lx+pydCY8XnqR mHDn67kO/8GhkrZ5rrbwr7qmDIp0EQ9ONU0+f51hUs5xiE/TzlF9tBbUZqeHdOV5kDl7 Gggk4OnWharSm4bZsSos4UcrRvsrja/gR59wbzz2OJn5/E3628xUjNil+j9BynrWEHPY +sCEzUK6p49oKptlAAGrZQsjDXth4nhE02USa515CzD/Y4jlfKPhBLns+8qwofadx5Ly /h7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f2-20020a056402004200b00403212b6b58si2635890edu.622.2022.02.25.17.04.19; Fri, 25 Feb 2022 17:04:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240974AbiBYOOr (ORCPT + 99 others); Fri, 25 Feb 2022 09:14:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236789AbiBYOOq (ORCPT ); Fri, 25 Feb 2022 09:14:46 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C82421DA036 for ; Fri, 25 Feb 2022 06:14:13 -0800 (PST) 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 4246360F13 for ; Fri, 25 Feb 2022 14:14:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14895C340E7; Fri, 25 Feb 2022 14:14:10 +0000 (UTC) Date: Fri, 25 Feb 2022 09:14:09 -0500 From: Steven Rostedt To: Peter Zijlstra Cc: Masami Hiramatsu , x86@kernel.org, joao@overdrivepizza.com, hjl.tools@gmail.com, jpoimboe@redhat.com, andrew.cooper3@citrix.com, linux-kernel@vger.kernel.org, ndesaulniers@google.com, keescook@chromium.org, samitolvanen@google.com, mark.rutland@arm.com, alyssa.milburn@intel.com, mbenes@suse.cz, alexei.starovoitov@gmail.com Subject: Re: [PATCH v2 15/39] x86/ibt,kprobes: Fix more +0 assumptions Message-ID: <20220225091409.0963e7d2@gandalf.local.home> In-Reply-To: References: <20220224145138.952963315@infradead.org> <20220224151322.892372059@infradead.org> <20220225103215.77080de0b3edd0fa2839b8fa@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=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Fri, 25 Feb 2022 11:46:23 +0100 Peter Zijlstra wrote: > Given all that, kprobe users are in a bit of a bind. Determining the > __fentry__ point basically means they *have* to first read the function > assembly to figure out where it is. Technically I think that's what kprobes has been designed for. But realistically, I do not think anyone actually does that (outside of academic and niche uses). Really, when people use func+0 they just want to trace the function, and ftrace is the fastest way to do so, and if it's not *exactly* at function entry, but includes the arguments, then it should be fine. That said, perhaps we should add a config to know if the architecture uses function entry or the old mcount that is after the frame set up (that is, you can not get to the arguments). CONFIG_HAVE_FTRACE_FUNCTION_START ? Because, if the arch still uses the old mcount method (where it's after the frame set up), then a kprobe at func+0 really wants the breakpoint. -- Steve