Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1665938pxp; Thu, 17 Mar 2022 14:01:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNAvOo24a1BT25FI2MSyHCTsxSiISYUWNnQZrVQrFuOexFi5M213+sg17ura8M9bQz11rH X-Received: by 2002:a9d:4d94:0:b0:5b2:34b3:1057 with SMTP id u20-20020a9d4d94000000b005b234b31057mr2343838otk.154.1647550889651; Thu, 17 Mar 2022 14:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647550889; cv=none; d=google.com; s=arc-20160816; b=fs6YnpSkF5dABJGcd+YOP2aixXSndxMlTe/xBLm8bECo3O383irZdaPs3NzyxmPhDh 2kV+sqhNo+rAMb7W9vXzXbwPkUr2u5xz1SyjEtsZ9IPpblquMTWE1I+rEcccW7CE/t9E xe3kLT5KrRxPHa8efgzz4xWzhHqjN1nkBbm/n+4lyFXdx517sfGwy7xFImMWhWnJfIud fQwI/OVNbOf6jbed2bdOAYnzQ/YUIRdgUdj7PG8SrxZpLadHWj+hASIchLTNqMaTY4cn BL+g3slwZZiLoJjGdQaRzAEcoYlfDsbe+k5j9G8XhIY2BgVVHgE5b32ljqzx9T5XP0Ij acig== 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=xR0Xh4vh08GEl/31xYqetrKFkUBS7jcWFuxXcXOUiME=; b=GBdCuYCL+8yEL9m3bEZSzVquhh2Upd8XPkLRihLZTptpHVX6zK8K9W7Yeh8Xm3S6VJ 2yMww9S1M/qH1PYo1PNH3F61JM1EjV0YTye9l4m6DHmMDqTm5v+wcvgezOq/5QlgiDkQ sR7SVmQ0/SoO8AArTReyryk4sXpRnEANTGx6mlJGa/t3fy7r/VzQGPEjdqwcpVfnCdUT rtqHJEMTVizNiPntSZOYplTj9tI45v1IjtsooCR1j+DfSJiXsvNJ9/EI/iTBKHM77ivU w5mZe5Sx76/VHNshRp5UWER7HFaXeYzOJDymTPwoRh5sfX8ZAhy3Aah709UCOWXjWK0I 1QgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=G9VgrZnw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v12-20020a056820004c00b003244bc5df22si67950oob.30.2022.03.17.14.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 14:01:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=G9VgrZnw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 1B6EF185446; Thu, 17 Mar 2022 13:28:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229673AbiCQU32 (ORCPT + 99 others); Thu, 17 Mar 2022 16:29:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbiCQU31 (ORCPT ); Thu, 17 Mar 2022 16:29:27 -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 37EAD184B47; Thu, 17 Mar 2022 13:28:10 -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=xR0Xh4vh08GEl/31xYqetrKFkUBS7jcWFuxXcXOUiME=; b=G9VgrZnwukc9WnA56jnt1JnSCn ueDpys8XWKhJlTH4ahmaGBXsQJUFZ50tnyCEBWYsKl30epdutFgvh0irWbEpe0mIZYcRS8mH1nK4o QA6YkQ1618lPwoIiMzC+6ZcWBl5f7l7LGbnLQbbv9jTvZ0Pz/4iLJH2aPmdyKGt206i7HGa2QIRTU 8NfXL99Pl44PXadqMmU/AGzs2uhNUdqcIMw3as8FwAbeG8tTxInU8OK6jFg4qYHvZ9dAxT33m9DFD VDSFNtc+USneRVDuSwFBgPKLAydAOLXDG6XzudS5bts1WPKceRkcBEvmu7gyu39FQ5Z51M5VPCAa5 UfetWT/Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUwik-001zXL-0y; Thu, 17 Mar 2022 20:27:43 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 558339882B3; Thu, 17 Mar 2022 21:27:41 +0100 (CET) Date: Thu, 17 Mar 2022 21:27:41 +0100 From: Peter Zijlstra To: Alexei Starovoitov Cc: Kumar Kartikeya Dwivedi , X86 ML , joao@overdrivepizza.com, hjl.tools@gmail.com, Josh Poimboeuf , Andrew Cooper , LKML , Nick Desaulniers , Kees Cook , Sami Tolvanen , Mark Rutland , alyssa.milburn@intel.com, Miroslav Benes , Steven Rostedt , Masami Hiramatsu , Daniel Borkmann , Andrii Nakryiko , bpf Subject: Re: [PATCH v4 00/45] x86: Kernel IBT Message-ID: <20220317202741.GP8939@worktop.programming.kicks-ass.net> References: <20220309190917.w3tq72alughslanq@ast-mbp.dhcp.thefacebook.com> <20220312154407.GF28057@worktop.programming.kicks-ass.net> <20220314204402.rpd5hqzzev4ugtdt@apollo> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 Tue, Mar 15, 2022 at 11:26:10AM -0700, Alexei Starovoitov wrote: > The bpf trampoline can attach to both indirect and non-indirect > functions. My understanding is that only indirect targets will have > endbr first insn. So the fix totally makes sense. Correct, the compiler is free to not emit endbr if it can determine the function will never be called indirectly (or it is explicitly marked so with a function attribute).