Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2347938rdb; Thu, 21 Sep 2023 16:28:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGRFD5SKr1ErbIGBK5M8zS/DXmVevVTG99JBNdpKMhNl8ioLi37Xg3C4sGcTCRj5o1YlglW X-Received: by 2002:a05:6808:7c2:b0:3a7:5475:ed30 with SMTP id f2-20020a05680807c200b003a75475ed30mr6098602oij.57.1695338893769; Thu, 21 Sep 2023 16:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695338893; cv=none; d=google.com; s=arc-20160816; b=XOelnivpa2dkOO6pKyratcYJNYoEjbPgZmShhlZdMmznJjWLziZiZJ8VKYyNNsj7/q lkEoITw4K/jibwlPQ59MG8Bg8L/jG3OZOcyws0AE03WxeiEUwxEUV1g0b2ANoj/mtIH0 1OLU7ZRfjjnmMNqnJTLHCrpMO40V7y/WE5eeNW8qz7LGVwXPNCpODPifzvEizQH8gRH8 Nc6KgsTbKJapIRYBRe0ubfCQP5ZhyDHYz7Z9nZwJksNZyY246wc3cFcZuNL9FD2Gi0qZ u+mmTFt+ybED07lcr1NKZxmNzOP8geYa6Mz/W/X6iVpyzz7VlBCqpQBO8TGONCzzffDB ZIHw== 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=lBQ9L3RlB45kZvbJWfiQxiFwc8HMdP6/NHhfMJr5W7Q=; fh=68SotMlCOnhDjOWz8s4sbBW4F45lwa8uov6faMqr4hA=; b=n7MGpvJXJ3UudxEv8bcYV0v3Ks2XP7aUZdi8oMDbsjgHPvQYa37c2Q36rhckhgGPCE GC1H45fIzk/dcjG3iCbtKd0IkHSnLY8+dmGASwIJL9VgEXqP1NVEbIXuATQXJWHvjIf+ nQLCFXNOWOSoL/9FaX9bjs7ElINPzSa3PkWKmABR1xdhW6egYhX8mgDtczGK11QR5TUi XdKYOPz7TUiOVsGn9Ow5Nm9ZCumZ9KSNX1frxafaUQXegWrd68aTRdXMbjUaxQtdCIpK 6rOJQWt4eowp05jH/lUSSkB6xvQKAcD9xhSC421ua56UVos8LGTqP6XeiVwJ7OdeYYPm Brqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=V2bR9vdU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id cv7-20020a056a0044c700b00690cc6f7598si2537610pfb.247.2023.09.21.16.28.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 16:28:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=V2bR9vdU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 46F49838F07D; Thu, 21 Sep 2023 12:55:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229988AbjIUTzY (ORCPT + 99 others); Thu, 21 Sep 2023 15:55:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229743AbjIUTzD (ORCPT ); Thu, 21 Sep 2023 15:55:03 -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 7E2C6EAA37 for ; Thu, 21 Sep 2023 12:23:01 -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=lBQ9L3RlB45kZvbJWfiQxiFwc8HMdP6/NHhfMJr5W7Q=; b=V2bR9vdUKJ2S0HUMIe7i8sl+Sy 1Z4nxvZYME70drFBH69pCo7Si+S0O+nKOB98tJj0+mcj+m7GITUSU1Ikejy7tomtgIQTp1wtpesLV 75aq7j5UERmvZyusm7Eusz9XMIk/7p7lZDj+18gT7qhaNDuZLogE9hxE9Xrov+A8kAc+CHSjb6RRs Uxq7BVdNQTzrfVFLAiJtqNMmdTGgJPYN1EfoU38yNIz2gxIwHR8tfX8ZrwU3D8HBcghe5e/AizEK8 l7INCahuqJJncAxAplEPh7vyb4VX3NhnN8h26J0KBKE7oV5zjtZl/CNVwADQdJrMSkLWN7M1/szZy +/SRhv9w==; 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 1qjPGG-00FaZz-27; Thu, 21 Sep 2023 19:22:54 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id A86C53002F1; Thu, 21 Sep 2023 21:22:53 +0200 (CEST) Date: Thu, 21 Sep 2023 21:22:53 +0200 From: Peter Zijlstra To: Fangrui Song Cc: x86@kernel.org, Josh Poimboeuf , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Nick Desaulniers Subject: Re: [PATCH] x86/speculation, objtool: Use absolute relocations for annotations Message-ID: <20230921192253.GA39480@noisy.programming.kicks-ass.net> References: <20230920001728.1439947-1-maskray@google.com> <20230921072655.GA14803@noisy.programming.kicks-ass.net> <20230921153537.GG14803@noisy.programming.kicks-ass.net> <20230921171900.GB29413@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 21 Sep 2023 12:55:38 -0700 (PDT) On Thu, Sep 21, 2023 at 10:36:27AM -0700, Fangrui Song wrote: > Well, only if the clever assembler doesn't support 32-bit absolute > relocation for a 64-bit architecture. > I don't know such an architecture. In addition, as long as the > architecture intends to support DWARF32, it has to support 32-bit > absolute relocations for a 64-bit architecture. Ooh... my bad. For some reason I thought that absolute meant native word size. But you already mentioned R_X86_64_32 (and I failed to check) and that is indeed an absolute (S+A) relocation of 32bit (dword) size. And apparently we also have R_X64_64_16 and R_X86_64_8, which would even allow something like: #define OBJTOOL_ANNOTATE(type) \ "999:\n\t" \ ".pushsection .discard.objtool_annotate\n\t" \ ".byte 999b\n\t" \ ".byte " __stringify(type) "\n\t" \ ".popsection\n\t" And since we only read the relocation and don't care for the actual result that would actually work just fine. Anyway, thanks for bearing with me. Acked-by: Peter Zijlstra (Intel)