Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5735108rwb; Wed, 9 Aug 2023 08:28:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEY/PV8plUO3IdNxYHaXo7DZ9ht8eJe9Q2dP1Ow7B/iX9kzlgUletuaxaLnEbmryn2PIIVT X-Received: by 2002:a17:902:dac4:b0:1b4:5699:aac1 with SMTP id q4-20020a170902dac400b001b45699aac1mr4465546plx.12.1691594924430; Wed, 09 Aug 2023 08:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691594924; cv=none; d=google.com; s=arc-20160816; b=rXNbubuSQm7LcQ5jVd1wCG/tGbmA5Mb/0Lyjx4+pME9+Jd+Jnwd2RuIsl5hZwsB3No /42KVPyznltEGwKvP8SoKbUIQUWMv24SijgjKbGESxDfDdWAkaEizG79/T0IkPBFZZYn hKZVGWwG9k/50esvAHbBvhlrpoQZW6VHUEl3fQoAjwdzEnQv2BBAfE0/WNiDIAZnls15 OM/5JmqXTSbZmMUBvvyXRRZS8tTAj/i7tnWm5EjSFQ9oE2noY6wrp/TVzplZQczRI2t9 dwWt0lDGpyXGyEX+RR8P5R1InjWTWwdMckof/zYswcHYgOk5iNv+i1tZPxKaVUXgjt54 daHw== 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=aW13Lhjbgtd0Hd5zjQwrMGIO5wUmMO3n48lpvRU0Flg=; fh=nIqJPQrB4V45MOdRoOCBABHD990j3QSMCgsf+X0qIaI=; b=yqe19bM0eQvp1dHnIUnxl24uXNpyjfFV4DJKNwjI1ofQAlgYKD91sv1S1EOyw2T+O2 jEgTT6BREL414mh+eBG6y4qV//nPerrA2vjsB6DUm5BZkGy6vLvtl2nRdsyb7GvKOgyR HzkZGi2i+n+Sjr5dBAgQFAwWdNqOoOTF3bRJXkwvNzxXySJ05EctCoMXsP5umaFrZ5rD RA14dudwkxAs69KtNteCws8JvIVu6vhj7mT5TfQNkuTyrnL+PGTYd+suiOeJuptJR15F MYQWRDEDEboz9hw11zNfBZeiKr6SE54aIyhY3KzzfUw3u/bn6OledeSfQdM30+cj+VzP peoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sX6sNxvD; 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 s9-20020a170902ea0900b001b89b7aea8fsi10085951plg.493.2023.08.09.08.28.32; Wed, 09 Aug 2023 08:28:44 -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=sX6sNxvD; 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 S233399AbjHIOeV (ORCPT + 99 others); Wed, 9 Aug 2023 10:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233569AbjHIOeO (ORCPT ); Wed, 9 Aug 2023 10:34:14 -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 8D29B2123 for ; Wed, 9 Aug 2023 07:34:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 22D9863C1F for ; Wed, 9 Aug 2023 14:34:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3477C433C8; Wed, 9 Aug 2023 14:34:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691591652; bh=Pxrp/nTjB2g7POw4gq6Z7s8LJfCLybCdtnbsoSynndQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sX6sNxvDYAEX8FZa2q34GC1g8GgzvihtbMCRcApCk63xBsO91IHB0nEUqunuriv6/ TFt+yP2NnVGUL4iYm41cAo4Wmlf+7DLJiTN73J5Jr40s+8RWJueKv7SYjijgp2j6OJ t3GMrjOGu+XJFCXpGnROtWgySb1OAkxoE396HYIsX9r5IJJyQBWqJ0qf5iuer5x+Z2 9wZlmr//Q9TlYYVWOwAUu4wiggF2dJosaFBt6kFqbUSmhLE9po9KvyX7In45dVYYlB 8lA+v6/6f4k6zwbD6xVXKDsVgqWD0qNFVUeCJCCQShcB2MDqQEsUj/YO6OXv+KWbHM q2sTDLo346ngQ== Date: Wed, 9 Aug 2023 10:34:09 -0400 From: Josh Poimboeuf To: Peter Zijlstra Cc: x86@kernel.org, linux-kernel@vger.kernel.org, David.Kaplan@amd.com, Andrew.Cooper3@citrix.com, gregkh@linuxfoundation.org Subject: Re: [RFC][PATCH 13/17] objtool/x86: Add arch_is_offset_insn() Message-ID: <20230809143409.5rs4jjvgsk64np6h@treble> References: <20230809071218.000335006@infradead.org> <20230809072201.326960605@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230809072201.326960605@infradead.org> 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 Wed, Aug 09, 2023 at 09:12:31AM +0200, Peter Zijlstra wrote: > Add a little wrappery to identify the magic symbols that are actually > inside another instruction -- yay for variable length instruction > encoding. > > Signed-off-by: Peter Zijlstra (Intel) > --- > tools/objtool/arch/x86/decode.c | 6 ++++++ > tools/objtool/check.c | 13 ++++++++++--- > tools/objtool/include/objtool/arch.h | 1 + > tools/objtool/include/objtool/elf.h | 1 + > 4 files changed, 18 insertions(+), 3 deletions(-) > > --- a/tools/objtool/arch/x86/decode.c > +++ b/tools/objtool/arch/x86/decode.c > @@ -826,3 +826,9 @@ bool arch_is_rethunk(struct symbol *sym) > { > return !strcmp(sym->name, "__x86_return_thunk"); > } > + > +bool arch_is_offset_insn(struct symbol *sym) > +{ > + return !strcmp(sym->name, "zen_return_thunk") || > + !strcmp(sym->name, "srso_safe_ret"); > +} arch_is_embedded_in_insn()? -- Josh