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: 1636803 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LBS7t6Cshz9s09 for ; Mon, 30 May 2022 17:43:22 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LBS7s0Zktz3bnM for ; Mon, 30 May 2022 17:43:21 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=pengutronix.de (client-ip=2001:67c:670:201:290:27ff:fe1d:cc33; helo=metis.ext.pengutronix.de; envelope-from=ukl@pengutronix.de; receiver=) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4LBS7f1X8xz302N for ; Mon, 30 May 2022 17:43:07 +1000 (AEST) 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 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 Content-Disposition: inline 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: linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: wangkefeng.wang@huawei.com, guoren@linux.alibaba.com, sunnanyong@huawei.com, Palmer Dabbelt , jszhang@kernel.org, mick@ics.forth.gr, linux-riscv@lists.infradead.org, Stephen Rothwell , alex@ghiti.fr, "Naveen N. Rao" , Li Zhengyu , aou@eecs.berkeley.edu, "liaochang \(A\)" , paul.walmsley@sifive.com, bjorn.topel@gmail.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, penberg@kernel.org, Eric Biederman , kernel@pengutronix.de, Andrew Morton , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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