Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2607224rwb; Mon, 15 Aug 2022 08:13:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR6l3e0KGxmfcY4v9QBMGWHhhN6nZ9czqP59SG9GvjhGRV1IGxD4hEe+AgCtQYiLu75st1bq X-Received: by 2002:a63:151f:0:b0:420:849f:5e18 with SMTP id v31-20020a63151f000000b00420849f5e18mr14119561pgl.329.1660576383892; Mon, 15 Aug 2022 08:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660576383; cv=none; d=google.com; s=arc-20160816; b=I+ZEs7xx3yiqG6xZcn3RANFaOgdvjd/eLUl6C7v7buteWQW8cH0hpTqqE+UI5Y+gH3 Q1HFtIBLfbiUVSStZO2obpSLfn1e9dmCXPYpd0ji+70qgqI4Ae/ycRUCuN9qIfQunS6M BQ4WmawDNUPOR4HrWUZPAjYv23hYlAZ9kVTKGqvFFWE/cbPMrt7K5LxrCwdQKGfmRnuO iy2uOEfYPo6eoYKgDfClTUdTTpZd3pl9Xrd37uRcMAQIg4A0akca/v//R65K+zK3qNtv y8FrrOzE9JZIpm3JDzRCo2Sf5mAd90GBGef4b2Wt7FHTyurLPH+rwjb1CDkVq8fQx1kk o8Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZSXSrb04Cvhz9vI27pIR02EfAkscJlis2igbhxe+mTk=; b=b4nNU29Dgx2z9Df1E/vJD92SvcFLHkFE5JIMyYQwYbfMC2plfJp5vb2BDgGJS0SydR qCtyxqFw2kfkemQURSmYGApa8JCnWUsg9xoF9nxcx3T5s+UU31xhf5pOGrAWKBbf0GY5 z8ZeSYpBS0zbHW/B6LU41vDpmDKci3NruCkTdqYBUkwI11Ex5w86+kdBinLAph72Dgls +6rr0IUmjTi1BJtBRz5HB7QEtrJ7D9dywhs69R2h+seTVTCg1d0L7J8Yq0kq+KOX8AbE ORy7YHXTqddEKgTZMDT9k9lzfh8PfmuT0nG49rej6za0FCjZXjuYcjOI5LweSauoniun bvXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=oPu4jQM3; 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 c2-20020a170902d48200b0016efe8d827esi12661460plg.154.2022.08.15.08.12.51; Mon, 15 Aug 2022 08:13:03 -0700 (PDT) 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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=oPu4jQM3; 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 S232052AbiHOPCY (ORCPT + 99 others); Mon, 15 Aug 2022 11:02:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229727AbiHOPCV (ORCPT ); Mon, 15 Aug 2022 11:02:21 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E2EE1EAF3; Mon, 15 Aug 2022 08:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZSXSrb04Cvhz9vI27pIR02EfAkscJlis2igbhxe+mTk=; b=oPu4jQM31XR0NOwZgtR7V+hnCr pBbmQn7D2L7HMNLaw/2d3ZVIPrAETwq+Yf1wz3zHIfN4dDX4BoWsZpeyyRER2OU0izgKRgcRHfj6Y NpDk+Q5ZUNtDJmUxUAHlxN/H7F/ziQW6B+vCf3Y6GKodwuLcNhNr7NgLEpbMwc14PrYZTe7GNl1uz KmfC4xFZhSXkP9cW6VXAyDQyHIsnFlPKBTY4MUnRYIxnC2U8zief8CdomO4ieeaDmOfci4dq7Purh nVOjo4xKw5hY9smdNFz1rRDyBe9gj/y8o2Wo7rt+xNLefIfMnJjKRlR7Tljy06/11KkJu+UVziOkj kO3V/Onw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNbbQ-005o7d-Tv; Mon, 15 Aug 2022 15:02:05 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 7511F980153; Mon, 15 Aug 2022 17:02:03 +0200 (CEST) Date: Mon, 15 Aug 2022 17:02:03 +0200 From: Peter Zijlstra To: Alexei Starovoitov Cc: Jiri Olsa , Steven Rostedt , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Ingo Molnar , bpf , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , LKML , Josh Poimboeuf Subject: Re: [RFC] ftrace: Add support to keep some functions out of ftrace Message-ID: References: <20220722174120.688768a3@gandalf.local.home> <20220813150252.5aa63650@rorschach.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 Mon, Aug 15, 2022 at 07:45:16AM -0700, Alexei Starovoitov wrote: > On Mon, Aug 15, 2022 at 7:33 AM Peter Zijlstra wrote: > > It is in full control of the 'call __fentry__'. Absolute full NAK on you > > trying to make it otherwise. > > Don't mix 'call fentry' generated by the compiler with nop5 inserted > by macroses or JITs. Looking at: https://lore.kernel.org/all/20191211123017.13212-3-bjorn.topel@gmail.com/ this seems to want to prod at the __fentry__ sites. > > > Soon we will have nop5 in the middle of the function. > > > ftrace must not touch it. > > > > How are you generating that NOP and what for? > > We're generating nop5-s in JITed code to further > attach to. Ftrace doesn't know about those; so how can it break that? Likewise it doesn't know about the static_branch/static_call NOPs and nothing is broken. Ftrace only knows about the __fentry__ sites, and it *does* own them. Are you saying ftrace is writing to a code location not a __fentry__ site?