Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2601714rwl; Thu, 13 Apr 2023 08:30:14 -0700 (PDT) X-Google-Smtp-Source: AKy350Y/Lgqea5CU9+uiC369kloxiu0E/gF2zPRH/7mDV2NbMOWa0DDhWNHFiv6+A+O2uUv/baBC X-Received: by 2002:a05:6a00:1a4d:b0:63a:fcf5:fb48 with SMTP id h13-20020a056a001a4d00b0063afcf5fb48mr3624513pfv.27.1681399814411; Thu, 13 Apr 2023 08:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681399814; cv=none; d=google.com; s=arc-20160816; b=o4QZcHdIAsEVc2nG+riJxLxkwNdE6HcgAxXmuu0InvkgshGOHY6XiVeKUGz2o2iTbm LLDNKnuhAXeZFlGhj+pI2+EJfOO4BwMzi7wjldctSx3QssrR7xA3HGtZlukS6c1N57H9 1xRMgPwRuFq8Yon40dU6P0jOy9vZdRp86s7lz+zoqPh/BZ16sOMkp7MbXkqQ9DINZS9V RZKjGgLk1uqg+3B4YxDVErrL9Vlli59urMwM6yXm53M6/LpUFqB8Mfw5FiW/uK7B57GP KBI/9TSugYpWDjYwZM/mDgZGOkIkavxaggEeKILQbOLhs0q+kApeF2/uYp9AoFZxgvN3 kqWg== 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=dU4pSUoa23DxKc5KK3CyEA6yG9poHQu8R0BDfERjHpk=; b=x20yZ2+QF/cY/RPwTMdQzLHEE4HcysPdoMJjl6qj0Men+95koxQGINQl+GFjtf5tQQ gMKMUx6oZNPwnJnyzIlLc273rQTKrWHzqne2F6qeLDxa6tWMz/CRKeUV/2DtRM/9I5Ak dtZjwW/jEg90ajl1a/RXgUBt8F/0blcDS6XRMdjTX9ZPt3UViuvnTCxT/P6mRhyQFwGa sBXH4eMrd/m1gecobqhwUnESGtjS+hgRTlWi+/wMFJeygnhhks0IopGplr+2gDZ6e4eB qx9dRUCOQqseZeE5EpRbKdZsudpIOTpdCCpbV0O/gijrjfdR9Um6LC/ipODXgT4gjorj wbBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BKuj7TQ5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w2-20020a623002000000b006262531b3cdsi1854241pfw.356.2023.04.13.08.29.59; Thu, 13 Apr 2023 08:30:14 -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=@kernel.org header.s=k20201202 header.b=BKuj7TQ5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230360AbjDMP3i (ORCPT + 99 others); Thu, 13 Apr 2023 11:29:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbjDMP3h (ORCPT ); Thu, 13 Apr 2023 11:29:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66EEC1735 for ; Thu, 13 Apr 2023 08:29:36 -0700 (PDT) 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 03A3F60AE7 for ; Thu, 13 Apr 2023 15:29:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 395B8C433EF; Thu, 13 Apr 2023 15:29:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681399775; bh=5dfkd3AFKknao2793GLIU8nx8l+ZG7S9AQx9qMUJgTw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BKuj7TQ5FVI7ER6srK3pO42w50/rrB7TcJn8hw5wGwReN3ypiQZOyGXDMIUdRdcTU 0cIwliEc9FdGuUX0KUindQt13zelzICqt4BcwDckObnrGKKFjG2GXoO7mHkRSnR29h MNQImzXf/mAK4/vMTTfRQk2qo3jK391cKNuffkDUfaQMyN2Nzc/g208MdYBZiyo6ek Wf8Td1yaM9NvyKIFPEYiPIXa/VRlTVcpIa7iQH58jUYN2esh9rQ2lVimSFpleNHOvU cyWqj5oApmYxI+JJHhMlkSimcBk6nfp2X4bBmpHSc156YOjuaNSrpfhLxQk6JFzNE1 lOYgGvoQ967JA== Date: Thu, 13 Apr 2023 08:29:33 -0700 From: Josh Poimboeuf To: Peter Zijlstra Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Miroslav Benes Subject: Re: [PATCH 3/3] objtool: Generate ORC data for __pfx code Message-ID: <20230413152933.cxhmocvbdlucvizx@treble> References: <20230413112426.GM4253@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230413112426.GM4253@hirez.programming.kicks-ass.net> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 Thu, Apr 13, 2023 at 01:24:26PM +0200, Peter Zijlstra wrote: > > + if (!insn->cfi) { > > + /* > > + * This can happen if stack validation isn't enabled or the > > + * function is annotated with STACK_FRAME_NON_STANDARD. > > + */ > > + return 0; > > + } > > + > > + /* Propagate insn->cfi to the prefix code */ > > + cfi = cfi_hash_find_or_add(insn->cfi); > > + for (; prev != insn; prev = next_insn_same_sec(file, prev)) > > + prev->cfi = cfi; > > + > > return 0; > > } > > FWIW, this makes the whole thing hard rely on the prefix being single > byte NOPs -- which they are, but perhaps we should assert this? Couldn't they be any stack-invariant instructions? -- Josh