Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp921039pxb; Fri, 22 Apr 2022 14:21:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3G9Fia8YXBoF9GrIPMSLd2ZL2OMoM9yYbnsSzA4yhQ+tFzycZEcn68xqo2bJ0NDYeKNAT X-Received: by 2002:a17:902:6bc2:b0:158:a26b:5884 with SMTP id m2-20020a1709026bc200b00158a26b5884mr6308421plt.38.1650662470286; Fri, 22 Apr 2022 14:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650662470; cv=none; d=google.com; s=arc-20160816; b=uVjOmKPC8pd9i3d83VPBMvzlKO1xqnGZjzlT96luWzP3Ml2/U5UdTm35UlW29+B0q9 DYe2eDjarxaiSF67EIkuKzj9s2ewMwIzzugngTTJzoXbUIt0FIWQck8MRumIxx/FHhdo M1D/0AFYVVe0VmMmkZA9DOxVA8E0IKE8B+DGAAoxuTftbjGEKaPdU3wVr0YCYqrhYyVK xz5zankZDl1cFvDxmiubl5C1tjWIhCBybaFJxJx5G5nAnAyvLs97buGyKti0CNgP7ij3 5k3MvP+YWfSytK3qxKO2DgzOYXIu03jrRgoLdXqRRYEDoMDlPpPfyllUCjE3fAkkavRS OKyg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DmKV20mrS057BFjgATIFfZZcbYOc9ROzIdfK5243MKM=; b=Nfzlm+YtVLbgK3OAa9vKgza2+kwO4meH9MQuGD8p8UlE++QoUiwWeNe8B+5KOpJ8vm IBmne+geLqt1rTJGzLFD6pibsSKljxBpd0zM7dRJYdyzrN8s/uhzxSyxZNxSLl8APNYW lhsFCN12axgIMcH9z046rErKN0w22++mDlV10BXYR8PApxflfRS44oIuEL9/0uih4hfZ hdHBuOi7LFmgsVRcHswbiGbhHnRJ6jfSfl0JUikung9pxi+fYKocjBNyYfCLCrA3Dh33 ZhnRmccM6hzCbD1pj328jiI1NkUt0uu4/Ienuaz9UTaBlBpcO24FbCl8sJkvbyJk1DQZ Viqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=mjrfG+wk; 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 k7-20020a056a00168700b004fa3a8dffc4si9647736pfc.123.2022.04.22.14.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:21:10 -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=mjrfG+wk; 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 DF0C41D838D; Fri, 22 Apr 2022 12:28:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243704AbiDSNNg (ORCPT + 99 others); Tue, 19 Apr 2022 09:13:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347234AbiDSNNc (ORCPT ); Tue, 19 Apr 2022 09:13:32 -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 1C3492ED57 for ; Tue, 19 Apr 2022 06:10:49 -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-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=DmKV20mrS057BFjgATIFfZZcbYOc9ROzIdfK5243MKM=; b=mjrfG+wkWhTeI0dI2U3/RqSdqu JoEaZ6bbl++VC4ETSUfRnKxCv6dr1hOw+XrwTv4Ait7LcnTbVcAEtrFWMRnh9yoRhKXY4frfOgGbb WRNdWc0IHmp5CpK7GWAYLZbVXP/vtkU1UBtssh2G+cjh5mO1i6RnyjK8A83skYrT65Rhysx/LXvre CUahQjroG2a0As//v7wBm/gJiP24DK5hQMeHT1FrRe7hbWNQSh1xrTHR30i0eFoZYgiF46/PMslHf 4VaCpC3D9WOKP5xaWO72w1gsnZ2ld22v3EacVlCoKir72iUhhezdGKMRAHBZjDpa8mBgcJVydYGV4 f/URuBWw==; 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 1ngncl-006pDV-GG; Tue, 19 Apr 2022 13:10:31 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 3704A986195; Tue, 19 Apr 2022 15:10:29 +0200 (CEST) Date: Tue, 19 Apr 2022 15:10:29 +0200 From: Peter Zijlstra To: Andrew Cooper Cc: Andrew Cooper , Josh Poimboeuf , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , Miroslav Benes , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , "xen-devel@lists.xenproject.org" Subject: Re: [PATCH v2 06/25] x86/xen: Add ANNOTATE_ENDBR to startup_xen() Message-ID: <20220419131029.GV2731@worktop.programming.kicks-ass.net> References: <20220419115737.GU2731@worktop.programming.kicks-ass.net> <8fbbd4ca-54b1-8c1c-19bc-3d0e6044ff5d@srcf.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8fbbd4ca-54b1-8c1c-19bc-3d0e6044ff5d@srcf.net> 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 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, Apr 19, 2022 at 01:12:14PM +0100, Andrew Cooper wrote: > > Subject: x86/xen: Add ANNOTATE_ENDBR to startup_xen() > > From: Josh Poimboeuf > > Date: Mon, 18 Apr 2022 09:50:25 -0700 > > > > From: Josh Poimboeuf > > > > The startup_xen() kernel entry point is referenced by the ".note.Xen" > > section, and is the real entry point of the VM. It *will* be > > indirectly branched to, *however* currently Xen doesn't support PV VM > > with CET active. > > Technically it's always IRET'd to, but the point is that it's never > "branched to" by the execution context of the VM. > > So it would be better to say that it's never indirectly branched to.? > That's what the IBT checks care about. Right, so I was thinking the IRET could set the NEED_ENDBR bit, but yeah, that might be stretching the definition of an indirect-branch a wee bit. How about so then? --- Subject: x86/xen: Add ANNOTATE_NOENDBR to startup_xen() From: Josh Poimboeuf Date: Mon, 18 Apr 2022 09:50:25 -0700 From: Josh Poimboeuf The startup_xen() kernel entry point is referenced by the ".note.Xen" section, and is the real entry point of the VM. Control transfer is through IRET, which *could* set NEED_ENDBR, however Xen currently does no such thing. Add ANNOTATE_NOENDBR to silence future objtool warnings. Fixes: ed53a0d97192 ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls") Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andrew Cooper Link: https://lkml.kernel.org/r/a87bd48b06d11ec4b98122a429e71e489b4e48c3.1650300597.git.jpoimboe@redhat.com