From patchwork Mon May 30 07:42:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12864343 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37551C433F5 for ; Mon, 30 May 2022 07:42:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XIlOP5cfO1m64VDVRosx8U+kKkGa+dwlHky514Mt+Go=; b=pBnhaD1EWFp1qzIlU0Eejx9Vj8 bHIx9wXZ429hmNvH7Uwgi6bSlW+AASBjqhaCFH2SlmOJRJoAIN4npvziv+ozcsHf6NU/DAaNaDV0c XZB9Qvh4EdUt7xMKEvIxH5bdhy+6tSHUgNjFrDdvJ+wBDjNk69iCBtVzxa1/aeZvdpAxNZ8tl7ORo IIxR+BZpk+qhW1H6OsBbcPsk/vbCpDHocvQKPjB4Mj+868g0VdZ2/m6iooWecK8Z2MGExAO2wVIcJ VcGPqMDRrkXVrOR+ClLt2l+xxRzc0+LJSKIQTNNudofXiLuKeEby7MdZTQSLja57bKWsfuhcj6S8u Y8nlOwDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nva2o-005j15-E5; Mon, 30 May 2022 07:42:30 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nva2k-005iyN-Og for linux-riscv@lists.infradead.org; Mon, 30 May 2022 07:42:29 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nva2d-0006ni-4F; Mon, 30 May 2022 09:42:19 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nva2W-005PS2-BU; Mon, 30 May 2022 09:42:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nva2T-00D2mA-SD; Mon, 30 May 2022 09:42:09 +0200 Date: Mon, 30 May 2022 09:42:02 +0200 From: Uwe =?utf-8?q?Kleine-K=C3=B6nig?= To: Li Zhengyu , Palmer Dabbelt Cc: alex@ghiti.fr, aou@eecs.berkeley.edu, bjorn.topel@gmail.com, guoren@linux.alibaba.com, jszhang@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, mick@ics.forth.gr, paul.walmsley@sifive.com, penberg@kernel.org, sunnanyong@huawei.com, wangkefeng.wang@huawei.com, Christophe Leroy , "liaochang (A)" , Stephen Rothwell , Andrew Morton , Palmer Dabbelt , Eric Biederman , kernel@pengutronix.de, "Naveen N. Rao" , linuxppc-dev@lists.ozlabs.org, Li Zhengyu Subject: [PATCH] RISC-V: Prepare dropping week attribute from arch_kexec_apply_relocations[_add] Message-ID: <20220530074202.pydmbbgvbtaugw5j@pengutronix.de> References: <20220519091237.676736-1-naveen.n.rao@linux.vnet.ibm.com> <20220529065637.xgapqjp2342flbuj@pengutronix.de> <264786d9-7756-19e0-2742-8b8d17f5ace5@csgroup.eu> <20220529140655.bnd4fgggccrorj4t@pengutronix.de> <59e8faec-05fd-805d-7de0-4b0508f8467f@huawei.com> MIME-Version: 1.0 In-Reply-To: <59e8faec-05fd-805d-7de0-4b0508f8467f@huawei.com> X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-riscv@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220530_004226_858398_0CB7999C X-CRM114-Status: GOOD ( 27.16 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Without this change arch/riscv/kernel/elf_kexec.c fails to compile once commit 233c1e6c319c ("kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add]") is also contained in the tree. This currently happens in next-20220527. Prepare the RISC-V similar to the s390 adaption done in 233c1e6c319c. This is safe to do on top of the riscv change even without the change to arch_kexec_apply_relocations. Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file") Looks-good-to: liaochang (A) Signed-off-by: Uwe Kleine-König --- On Mon, May 30, 2022 at 09:43:26AM +0800, liaochang (A) wrote: > > I can confirm that doing > > > > diff --git a/arch/riscv/include/asm/kexec.h b/arch/riscv/include/asm/kexec.h > > index 206217b23301..eee260e8ab30 100644 > > --- a/arch/riscv/include/asm/kexec.h > > +++ b/arch/riscv/include/asm/kexec.h > > @@ -55,6 +55,13 @@ extern riscv_kexec_method riscv_kexec_norelocate; > > > > #ifdef CONFIG_KEXEC_FILE > > extern const struct kexec_file_ops elf_kexec_ops; > > + > > +struct purgatory_info; > > +int arch_kexec_apply_relocations_add(struct purgatory_info *pi, > > + Elf_Shdr *section, > > + const Elf_Shdr *relsec, > > + const Elf_Shdr *symtab); > > +#define arch_kexec_apply_relocations_add arch_kexec_apply_relocations_add > > #endif > > > > #endif > > LGTM, you could send a fixup patch to riscv, thanks. > > > > > on top of 838b3e28488f results in a compilable tree. And when merging > > 233c1e6c319c into this, it is still building. > > > > I'm not enough into kexec (and riscv) to judge if this is sensible, or > > create a useful commit log but the obvious way forward is to apply the > > above patch to the riscv tree before it hits Linus' tree. Ok, here comes a patch with a generic commit log. @riscv people: If you prefer, squash it into 838b3e28488f. Best regards Uwe arch/riscv/include/asm/kexec.h | 7 +++++++ 1 file changed, 7 insertions(+) base-commit: 838b3e28488f702e2b5477b393f009b2639d2b1a diff --git a/arch/riscv/include/asm/kexec.h b/arch/riscv/include/asm/kexec.h index 206217b23301..eee260e8ab30 100644 --- a/arch/riscv/include/asm/kexec.h +++ b/arch/riscv/include/asm/kexec.h @@ -55,6 +55,13 @@ extern riscv_kexec_method riscv_kexec_norelocate; #ifdef CONFIG_KEXEC_FILE extern const struct kexec_file_ops elf_kexec_ops; + +struct purgatory_info; +int arch_kexec_apply_relocations_add(struct purgatory_info *pi, + Elf_Shdr *section, + const Elf_Shdr *relsec, + const Elf_Shdr *symtab); +#define arch_kexec_apply_relocations_add arch_kexec_apply_relocations_add #endif #endif