Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C1D6C6FD1D for ; Tue, 21 Mar 2023 15:24:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231290AbjCUPYf (ORCPT ); Tue, 21 Mar 2023 11:24:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbjCUPYc (ORCPT ); Tue, 21 Mar 2023 11:24:32 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E16A1B2CE for ; Tue, 21 Mar 2023 08:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1679412271; x=1710948271; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=aMLLh8V4kf7c9ciTlabKLcKZtNVTiRpS6IoNs5kWFIM=; b=utSm9+yxu/Cme58DVnjcRnFqYQ9DPloTnxt/8F7BCDFTBBWaj7NDvgVQ QqcbIUpwV9KunAzbNFLRMqycAOLXJ6QiZlLiROCnms45TASVk5Cwv6MHX fzzurIZKdqxJtyujfXyLnQGNYawhBEtXCmF8j+x9ZBK4cIaF6bJrFPJti We407WBdwWaK+/UlKWlY1/oXBoekHXPn/+i3Oc9FmJx2JbG7NS0njQzKE WPa3fJBkn7oHrtFTo9sZBmwERkTy6Zb8BYdhDb89lmmc4XLwows61Knqk fIdRG5sVlMsGbmwDDVqGOkZsMW1No7vKu8Ifua5dvbaYqmrrBGDjyKpgb g==; X-IronPort-AV: E=Sophos;i="5.98,279,1673938800"; d="asc'?scan'208";a="202710844" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Mar 2023 08:24:30 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 21 Mar 2023 08:24:29 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Tue, 21 Mar 2023 08:24:27 -0700 Date: Tue, 21 Mar 2023 15:35:38 +0000 From: Conor Dooley To: Torsten Duwe CC: Palmer Dabbelt , Li Zhengyu , Paul Walmsley , Albert Ou , Li Huafei , Liao Chang , , , Subject: Re: [PATCH] riscv: relocate R_RISCV_CALL_PLT in kexec_file Message-ID: 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="6Tf43noRFCb2ZP4i" Content-Disposition: inline In-Reply-To: <20230321160349.3b3a46df@blackhole.lan> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --6Tf43noRFCb2ZP4i Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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, but > > > R_RISCV_CALL_PLT. When trying kexec_load_file on such kernels, it will > > > 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_CALL_= 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/riscv-= 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/a0dced85018= d7a0ec17023c9389cbd70b1dbc1b0 > >=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 purga= tory_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? It's not been all that longer than a week & you're in patchwork so you won't be forgotten, but I noticed a complaint when I went looking on patchwork about your fixes tag: 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")' The fixes tag should be: Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file") 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). 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. Thanks, Conor. --6Tf43noRFCb2ZP4i Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZBnOxAAKCRB4tDGHoIJi 0hOtAQCLB6C9nIcVqUpFQ7xTtESnOBJTdvu8LY2vIaOeFiMjZwEAqc3Z6nZ80y9z M7VMSeGNvfoOb5RYfH7UWCUXAJ7SiQQ= =zuFb -----END PGP SIGNATURE----- --6Tf43noRFCb2ZP4i--