Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28769846rwd; Wed, 5 Jul 2023 02:23:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ63oJK4iKPqK32+dj/Ff2XzJ6dTbtrEToASO7bAVbDLunLhexNjJVh0+4qVn+tliYo/3mYa X-Received: by 2002:a05:6808:309a:b0:3a1:d629:d1dd with SMTP id bl26-20020a056808309a00b003a1d629d1ddmr16338587oib.56.1688549011638; Wed, 05 Jul 2023 02:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688549011; cv=none; d=google.com; s=arc-20160816; b=T2EW2QB9VuO8OMWkoU3R7cML6xMkd8fBopcvoCflYbOl3TOKSyni59QNyRtWDgpUIz QafgMxbFdbWrxxJF1hyvQZcEoZ8xF2kzPLPt5OYtg42gfc5VlZl/9nj67BLu6iVpoUGY fiBbBs4eNC2IDsnhuxCoh5a5ftBGYbt7IZ6VlpIyFIZWJ+/yBR3n6DUmeSs+fFtQ53pf eODlTySjHlOO85ZlBXsLfTtXqyGeyhpfYcSQnmezcXyv2ygRtSYz6eohHyKNw6deahVO hWUZNfYmVTug6Y0iHwhyfbQwCAkWcvDNJSt+MEIwbusnZRTLvxFPRcjKj5lvDYKxLhj7 0Mnw== 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=hakQolOQjMnf+B++c/8vfOBnENC9wc+YeNh/Nom7T94=; fh=bPlsvHYikFMh4iU7gmflCDB72qBt+ZPi6P0tXCa3zfU=; b=homYxby+DyV8BoryVAnER896PoVlVvPTMdrZdCkjaeBVh5gz7UVRSTyWwACgbaSju4 UTsX+117QkDX2KlMyOxApleqsfZ580Q+8T8qvzUvaqzTUd5DfrICgeTopXQTdfVg4FrE cM/TevsoLY2gvLQNub8D8jX1qgF41dwt6/uvQGL2WInL7qRArG/j2qZ6jM8ImDsbBDqk QUxKvZj1hjI3GpZiWvYd7di3/BABuC/xKX/WuBMlUqst2hdPl1Bo3/msJh2jGE61KD80 WX39ATWAgbWqBp+CX8f7w6/iRO4RQ66SX+c4j191q3+PrlbFrU6JQEVfbUXL3TUSYiLS EaEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=S8aOPhEQ; 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 t24-20020a17090a449800b00262fe4585f3si1187658pjg.150.2023.07.05.02.23.16; Wed, 05 Jul 2023 02:23:31 -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=desiato.20200630 header.b=S8aOPhEQ; 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 S231853AbjGEJBJ (ORCPT + 99 others); Wed, 5 Jul 2023 05:01:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229906AbjGEJBI (ORCPT ); Wed, 5 Jul 2023 05:01:08 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A42611F; Wed, 5 Jul 2023 02:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=hakQolOQjMnf+B++c/8vfOBnENC9wc+YeNh/Nom7T94=; b=S8aOPhEQBb4HZry+9oUF+BUGDo uZeTyCJcuVwLai6Ic1+5GsRIwRpOS/lb5lxjxbqCJRZWqOaNDcnrQEJns2w5PjOydMKrdvjkXwRcb vAj3bdrRPrumj03Rfb/J+t0pGx3RNajwJIk+IGBxlysGy3SVO5EJHr0XAsTBjPwQoLNF08rfNNXTi SIyfwSOm06qhBlxQSRMvC4BTUPlGyR2Oh+AZpaDjAn4ZJyAHLP/GF+84DR0a5Hwc0LQZ5aU2hHJ9U zOF5CLs0+Gd0DNx6SwkaNl+Eu8IX4BoZ+jrQV15L6+FWOX113ytAgi9qd5dC9Qnffaqyc/ayitBR4 3KsQmVeQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qGyLi-00C36Z-17; Wed, 05 Jul 2023 09:00:58 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 803B330012F; Wed, 5 Jul 2023 10:58:57 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6321A2028F056; Wed, 5 Jul 2023 10:58:57 +0200 (CEST) Date: Wed, 5 Jul 2023 10:58:57 +0200 From: Peter Zijlstra To: Petr Pavlu Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, mhiramat@kernel.org, samitolvanen@google.com, x86@kernel.org, linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] x86/retpoline,kprobes: Avoid treating rethunk as an indirect jump Message-ID: <20230705085857.GG462772@hirez.programming.kicks-ass.net> References: <20230705081547.25130-1-petr.pavlu@suse.com> <20230705081547.25130-3-petr.pavlu@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230705081547.25130-3-petr.pavlu@suse.com> 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,URIBL_BLOCKED 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 Wed, Jul 05, 2023 at 10:15:47AM +0200, Petr Pavlu wrote: > Functions can_optimize() and insn_is_indirect_jump() consider jumps to > the range [__indirect_thunk_start, __indirect_thunk_end] as indirect > jumps and prevent use of optprobes in functions containing them. Why ?!? I mean, doing an opt-probe of an indirect jump/call instruction itself doesn't really make sense and I can see why you'd want to not do that. But why disallow an opt-probe if there's one in the function as a whole, but not the probe target?