Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1919734rwo; Sun, 23 Jul 2023 03:59:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlFflCl62nkbigRVNZz0JcihZBzUrslf7NzPDzgWrqWFsTsg6S3EiCdm3iOZJFAJmiy4vlaI X-Received: by 2002:a17:906:12:b0:974:1e0e:91ee with SMTP id 18-20020a170906001200b009741e0e91eemr8165029eja.13.1690109951859; Sun, 23 Jul 2023 03:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690109951; cv=none; d=google.com; s=arc-20160816; b=SgFSmCkLqE6gLhcqHbYKyvYCnLl25V2aK4nSh0iCVyUeX/3BXjrn6GG5LQFPTN2rB0 6kS/3tKV4IOCGXDGUEdEDa35hdAVZ939TehZOlWTOqif4EwmJaL8p8UB54CRp8bXc1eW xnJyndsyrKMCRc9h2SV4FpRVIkiUVcIUx/lARAOrUMilPad/eJC/UpTysaau4y4av9v6 /ZnauOpWnXz3hnomW3he+Hspp/YWUYGPRmg1Fd+YcinrRydgju1qQSp4NptP8liYhXZ4 4dPicazBDWTIOZiy4HNmPWHtMTqE9rQubBQYsxnYZjXpvk1BQAYexqscpwPw1r+HrcP4 lhXQ== 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=PaAvINe2BvmAG7ApOOfV2J28G2ZgeJ/wkC5TAMDn7GU=; fh=0tIAt7yMkjDWL8A1XwJKDWHshavoJdoB7iAlyo81ZE8=; b=x5477FTv6NlOZuvAMBH6sI7wV8SNv8Rb7UPw4oZDkFNkywb0JBoubnxTdoH6yJumvJ dEj114VtWv1NuyQSP3IsQFI+VdDi0Akf74lDG7PGjI2AV2GAY0WmVMdGLY6i+MISAyXF Jwr+EWRyYI8LPeHJFHAhV3bE7HttFyic9J2bAEFnoeHUs7q3bMbIp43DaL7mYRp107it tenROGWaHlQVZPA6B3WwsNCQOoIAsGaTi/eaRhlMuPENz3EDDNxDzf3G2/EE1ODoREog flvGDj4KhctFP2g/iRG/xcbo3hPrGaPRNFp2CG/8rj+lJS7yokUw5caYPvpAAyIZn6F3 u7qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GNXCXw5B; 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 e6-20020a17090681c600b00992bfd14c42si4638952ejx.949.2023.07.23.03.58.48; Sun, 23 Jul 2023 03:59:11 -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=GNXCXw5B; 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 S229599AbjGWK2N (ORCPT + 99 others); Sun, 23 Jul 2023 06:28:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230248AbjGWK1v (ORCPT ); Sun, 23 Jul 2023 06:27:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4321130F4 for ; Sun, 23 Jul 2023 03:27:12 -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 3D61C60C77 for ; Sun, 23 Jul 2023 10:27:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68553C433C7; Sun, 23 Jul 2023 10:27:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690108029; bh=8VJc2tD2YELzixtvQn5M61U40vb9YcAHPcXQfgf7Q44=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GNXCXw5BJNcKTo+7KeMYXFsbJ1F79bgksCry1yFSSu+tXu0WRMfqPOBPfiPjadaEo O8v6w0Cc+uo9jKBm1NG4wejosRkIX7kvyju1eQX/L4AMV0sOyEflpq7/dOYSUm9lbi 7Ov9Reh+bFumn16h1HCg4tUH0b2qtcN3PYzZf3tpbU0uH4fyQs/iily+vaO8uEV/63 VeeUezUzGamNHKzB59HYiJjyForQ+pAQ22+qPtgKtS8/K+bYBS480DSSEghZPcQt6S p3f0sgAkEtLDPb5XyHgmbLLxlFaVJ1zqIpwFNMRma35fhIZl221G4JWRxMwkwRNCHA rNc9SFrTDYAZA== Date: Sun, 23 Jul 2023 11:27:05 +0100 From: Conor Dooley To: Conor Dooley Cc: Torsten Duwe , Palmer Dabbelt , Li Zhengyu , Paul Walmsley , Albert Ou , Li Huafei , Liao Chang , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, liubao918@huawei.com Subject: Re: [PATCH] riscv: relocate R_RISCV_CALL_PLT in kexec_file Message-ID: <20230723-sprig-audacious-4fff0306735d@spud> References: <20230310182726.GA25154@lst.de> <20230321160349.3b3a46df@blackhole.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="w/YJr8pXLUA/bSjV" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 --w/YJr8pXLUA/bSjV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Torsten, On Tue, Mar 21, 2023 at 03:35:38PM +0000, Conor Dooley wrote: > On Tue, Mar 21, 2023 at 04:03:49PM +0100, Torsten Duwe wrote: > > On Mon, 13 Mar 2023 11:13:17 +0800 > > Li Zhengyu wrote: > >=20 > > > On Fri, 10 Mar 2023 19:27:03 +0100, Torsten Duwe wrote: > > > > Depending on the toolchain (here: gcc-12, binutils-2.40) the > > > > relocation entries for function calls are no longer R_RISCV_CALL, b= ut > > > > R_RISCV_CALL_PLT. When trying kexec_load_file on such kernels, it w= ill > > > > fail with > > > > > > > > kexec_image: Unknown rela relocation: 19 > > > > kexec_image: Error loading purgatory ret=3D-8 > > > > > > > > The binary code at the call site remains the same, so tell > > > > arch_kexec_apply_relocations_add() to handle _PLT alike. > > >=20 > > > R_RISCV_CALL has already been deprecated, and replaced by R_RISCV_CAL= L_PLT. > > >=20 > > > See Enum 18-19 in Table 3. Relocation types from=20 > > > https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/risc= v-elf.adoc=20 > > > . > > >=20 > > > It was deprecated in ("Deprecated R_RISCV_CALL, prefer=20 > > > R_RISCV_CALL_PLT")=20 > > > https://github.com/riscv-non-isa/riscv-elf-psabi-doc/commit/a0dced850= 18d7a0ec17023c9389cbd70b1dbc1b0 > > >=20 > > > > > > > > fixes: 838b3e28488f702 ("Load purgatory in kexec_file") > > > > Signed-off-by: Torsten Duwe > > > > Cc: stable@vger.kernel.org > > > > > > > > --- > > > > --- a/arch/riscv/kernel/elf_kexec.c > > > > +++ b/arch/riscv/kernel/elf_kexec.c > > > > @@ -425,6 +425,7 @@ int arch_kexec_apply_relocations_add(struct pur= gatory_info *pi, > > > > * sym, instead of searching the whole relsec. > > > > */ > > > > case R_RISCV_PCREL_HI20: > > > > + case R_RISCV_CALL_PLT: > > > > case R_RISCV_CALL: > > > > *(u64 *)loc =3D CLEAN_IMM(UITYPE, *(u64 *)loc) | > > > > ENCODE_UJTYPE_IMM(val - addr); > > > > > > > > . > > >=20 > > > Palmer, please apply these references to the commit message. > > >=20 > > > Reviewed-by: Li Zhengyu > > >=20 > >=20 > > Ping? >=20 > It's not been all that longer than a week & you're in patchwork so you > won't be forgotten, Turns out it did get forgotten, or more accurately, marked as "Changes Requested". > but I noticed a complaint when I went looking on > patchwork about your fixes tag: >=20 > Commit: f28b81e30b4b ("riscv: relocate R_RISCV_CALL_PLT in kexec_file") > Fixes tag: fixes: 838b3e28488f702 ("Load purgatory in kexec_file") > Has these problem(s): > - Subject does not match target commit subject > Just use > git log -1 --format=3D'Fixes: %h ("%s")' >=20 > The fixes tag should be: > Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file") >=20 > Note the capital F & the missed RISC-V: prefix, checkpatch should have > complained about this. > Checkpatch also complains that your suse email in the Signoff doesn't > match the lst.de email that you used to send the patch (IOW you're > missing a From: header that send-email would add). >=20 > Could you fix those things up please & I suppose you can take the > opportunity to make the changes that Li Zhengyu suggested to the commit > message itself at the same time. Would you mind resending this with the Fixes & Signoff corrections? Thanks, Conor. --w/YJr8pXLUA/bSjV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZL0AdQAKCRB4tDGHoIJi 0tfSAP0QWC0Z93lHBZdkNOp+3L2ooUp4Y6wLUlFIEnzmb0yAlgD9GLB8lnvQSQHj 8tpflQZTVoJmy3fz+qAd/hsh/AE0GA0= =PHll -----END PGP SIGNATURE----- --w/YJr8pXLUA/bSjV--