Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp375840rdg; Tue, 10 Oct 2023 12:57:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHd44CtY0QWyWiJe5GmcOgqOdCshkCWDj5bdNrZECPn7JLkHnB6/VK67RD5/RcepMD4oEAY X-Received: by 2002:a17:902:f541:b0:1b6:bced:1dc2 with SMTP id h1-20020a170902f54100b001b6bced1dc2mr20036599plf.0.1696967855951; Tue, 10 Oct 2023 12:57:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696967855; cv=none; d=google.com; s=arc-20160816; b=oesYSk25SLXcBeA7POcWCR0POGaFGhu1lRfkDqfQ6u56E8d+yrS43u+FiGuj8c2boV R6rnAtqBX1uIr3oyVNQEBB06Vwz4BjT1DP41qb4HMwJy1tmXDcMy9c3uBHYexozXKHeR G/cZAH6Sr+qLnQLY+Vsu+hNVQdsWLtjcnn0h7G6HIIbPjeAsrhBojGnelZHIV/cYK125 5FAZA+pKGMd5XLh01sSaR5X0nROR0TwvXqKfpSGaaTbJvs4r53aWkmP9JvPLSok0R68K fwwumVMUShZJqYEcKHKU0/QE9Jhgm00I6FtaRhprzf+Y4M8pKugE38tQy8Q/6c/qJHNF 6j2w== 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=lahuSK7zR3cZoZ+kobBbB+SvN0Mmv2tC3k3b0qyVlRo=; fh=1dPUzoJHa6iEDIS2nHp5JMYnAffqp5SfooTOlDzySjk=; b=Ja3ISqoim04WJ7jRlmQGz9pFncPEN5mRXbZOsAldvwjS0JZX1RZ8xI64eHRSYZJAIs AM93RJa9jq5S9pfTyVr/oSR8rOcOjT3RuCKOdNKQQfJbpVIl/8KpU+5GVzcqs96Tcabr gKFqoNy8Fkg/YwY/2Og0T1VdPcbgUbw9YBlPuShC/14FdCmqUXMEMNErcsqCw7r4EmwD tl8HbN8iBuzU3CbnyCoJsuhZpF6VBshwBGmCTGB0+VapIcNey5QDUgNQMcez/THVWpRf yU3opMeSoKPRopKClXQG4PzRm6WWhTbLbNfatylggU6KCPcb6cqJLrC1x5by7X1vOW/D Iowg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BeCHDQRR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id kg14-20020a170903060e00b001c4743e4a60si1464710plb.197.2023.10.10.12.57.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 12:57:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BeCHDQRR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B09A080A44CF; Tue, 10 Oct 2023 12:57:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229809AbjJJT50 (ORCPT + 99 others); Tue, 10 Oct 2023 15:57:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbjJJT5Z (ORCPT ); Tue, 10 Oct 2023 15:57:25 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE5C38E for ; Tue, 10 Oct 2023 12:57:23 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5CB4C433C7; Tue, 10 Oct 2023 19:57:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696967843; bh=ebhIkz6leoFsUxci+Od1cGHvCe9Dc0bDHHFkxrY3AT0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BeCHDQRRZYafZRmb6LLUT1d3ufjAM8Yg4hRlEsqCc8WorbRWRNA9a9NWFUMBVIf3v LkN1N57hDU688nj9zRURbdWowqVLSo7iUFXOylO7mRtRaOPQbCN7Xc53bXJ+J5K8po GS0nQv0phaYCsG+EONdrTT+19nYmiIk2d3XZSaTyFKgnaedWQ8ByLC4v3Z18c6BNoa D8CgjC6HcOYv0w4R25Y8kotCIj0j6lcoKugNnGATZ3tPCseVWcIDCMyTjjaakgd36H K9ubmwwX3+RemkK4ea96293jbtINOzheS1xmF/3LSqGbw5ErkqxMawjskxojCZV5Kn TZc5C25vo6Reg== Date: Tue, 10 Oct 2023 12:57:21 -0700 From: Josh Poimboeuf To: Peter Zijlstra Cc: David Kaplan , x86@kernel.org, luto@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] Revert "x86/retpoline: Remove .text..__x86.return_thunk section" Message-ID: <20231010195721.p5pb273kevg7ydxz@treble> References: <20231010171020.462211-1-david.kaplan@amd.com> <20231010171020.462211-2-david.kaplan@amd.com> <20231010174833.GG14330@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231010174833.GG14330@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Tue, 10 Oct 2023 12:57:33 -0700 (PDT) X-Spam-Level: ** On Tue, Oct 10, 2023 at 07:48:33PM +0200, Peter Zijlstra wrote: > On Tue, Oct 10, 2023 at 12:10:18PM -0500, David Kaplan wrote: > > > arch/x86/kernel/vmlinux.lds.S | 3 +++ > > arch/x86/lib/retpoline.S | 2 ++ > > 2 files changed, 5 insertions(+) > > > > diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S > > index 9cdb1a7332c4..54a5596adaa6 100644 > > --- a/arch/x86/kernel/vmlinux.lds.S > > +++ b/arch/x86/kernel/vmlinux.lds.S > > @@ -132,7 +132,10 @@ SECTIONS > > LOCK_TEXT > > KPROBES_TEXT > > SOFTIRQENTRY_TEXT > > +#ifdef CONFIG_RETPOLINE > > *(.text..__x86.indirect_thunk) > > + *(.text..__x86.return_thunk) > > +#endif > > STATIC_CALL_TEXT > > > > ALIGN_ENTRY_TEXT_BEGIN > > diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S > > index db813113e637..3da768a71cf9 100644 > > --- a/arch/x86/lib/retpoline.S > > +++ b/arch/x86/lib/retpoline.S > > @@ -129,6 +129,8 @@ SYM_CODE_END(__x86_indirect_jump_thunk_array) > > > > #ifdef CONFIG_RETHUNK > > Perhaps elucidate the future reader with a comment here? Lest someone > tries removing it again. Yes, please. Also we could make objtool properly detect the non-relocated jump target. But this works for now. -- Josh