Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3263490ioo; Sun, 29 May 2022 19:28:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+AiZJu0z84IzDvY6TkEHZFBJ89ExXw1y8enu/Gl0htRhYTwG93OosMmQpySe0ncJlQW0M X-Received: by 2002:a63:81c7:0:b0:3f9:f00e:71dc with SMTP id t190-20020a6381c7000000b003f9f00e71dcmr36455249pgd.592.1653877681841; Sun, 29 May 2022 19:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653877681; cv=none; d=google.com; s=arc-20160816; b=vNvknCEatFKYW9Mc8YKGVxh2RMJdY2svoD/WL+23WjtC/QetNVp38Je0ThC1XSTIGK nam3/kbdtBQavT+5SqVRg3tcgEH+QeiZlbc3UwLY/Vy58Dz1bEY4IN/G+Brmij2o8/KW BIs0xzdSDtMd8PpJ6RfQXZs3YIpWRBP+TI1h4/coZ7vyiWPMxKpS7X5dw8OJ5cJNOuK9 hMj8/5UOo9WKxIsbjH8jy1Jd9dyxe7Ap7GsDMzZe9NxuncLQP2bXYh1wz+KJPan78mv7 7oJRQ0Uuvvm5lxRZ2adZJpzh0KAinO6Tnv9HKxtMdJzgsrdAe9HePYGQU/uZbR1uiYfb UB8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=nVWhOdwrXDhdhe+s8Qj9WK1R770JjhQZDEGOPUHzPdo=; b=M7O0rIe9dJxqVDBfLqfNixxgoFIsJSQJvaJA0/FlkjWeLDk11jtp802CD31Mpys85r Gj2TqFcqJjOLc28S/crDWxxTWZdGzMBATDUGRcKy+F27vP5PbNAQupoLXRxSI7Bbq6hg PMZIdgYTzyyxjO4YADX8HDcG1g7Z0pUhm4OK3WkpJN/nN1AIEFVZXAwLteoPVp9taqqc jFAr+2s5Hw/1Tk1HzpWYfrFy929/4D/oafvxPkS4iQLr8ZbNAK75W33AYCNcMkrASACj 7xpqs+L6CWEucyLFn2ZCQGobBA7eIm3DZ/zuXGOHlHco06dQTl932YW17utzdxjCqIb9 AvjA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v63-20020a638942000000b003c26d3bb7a0si14402634pgd.542.2022.05.29.19.27.49; Sun, 29 May 2022 19:28:01 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232147AbiE3Bnf (ORCPT + 99 others); Sun, 29 May 2022 21:43:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230337AbiE3Bnd (ORCPT ); Sun, 29 May 2022 21:43:33 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64664DEAB for ; Sun, 29 May 2022 18:43:30 -0700 (PDT) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LBJ7K4K7JzjX0y; Mon, 30 May 2022 09:42:21 +0800 (CST) Received: from [10.67.110.108] (10.67.110.108) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 30 May 2022 09:43:27 +0800 Message-ID: <59e8faec-05fd-805d-7de0-4b0508f8467f@huawei.com> Date: Mon, 30 May 2022 09:43:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH v2] kexec_file: Drop weak attribute from arch_kexec_apply_relocations[_add] To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Christophe Leroy CC: "Naveen N. Rao" , Li Zhengyu , Palmer Dabbelt , Stephen Rothwell , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Eric Biederman , "kernel@pengutronix.de" , Andrew Morton , "linuxppc-dev@lists.ozlabs.org" , "linux-riscv@lists.infradead.org" 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> From: "liaochang (A)" In-Reply-To: <20220529140655.bnd4fgggccrorj4t@pengutronix.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.110.108] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 在 2022/5/29 22:06, Uwe Kleine-König 写道: > Hello, > > On Sun, May 29, 2022 at 09:46:47AM +0000, Christophe Leroy wrote: >> Le 29/05/2022 à 08:56, Uwe Kleine-König a écrit : >>> Hello, >>> >>> on current linux-next ARCH=riscv allmodconfig breaks with: >>> >>> CC arch/riscv/kernel/elf_kexec.o >>> arch/riscv/kernel/elf_kexec.c:345:5: error: redefinition of ‘arch_kexec_apply_relocations_add’ >>> 345 | int arch_kexec_apply_relocations_add(struct purgatory_info *pi, >>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> In file included from arch/riscv/kernel/elf_kexec.c:16: >>> include/linux/kexec.h:236:1: note: previous definition of ‘arch_kexec_apply_relocations_add’ with type ‘int(struct purgatory_info *, Elf64_Shdr *, const Elf64_Shdr *, const Elf64_Shdr *)’ {aka ‘int(struct purgatory_info *, struct elf64_shdr *, const struct elf64_shdr *, const struct elf64_shdr *)’} >>> 236 | arch_kexec_apply_relocations_add(struct purgatory_info *pi, Elf_Shdr *section, >>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> >>> (I think) because there is a conflict between the two commits: >>> >>> 233c1e6c319c kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add] >>> 838b3e28488f RISC-V: Load purgatory in kexec_file >>> >>> And so next is broken starting from >>> 164a9037b1d33f28ba27671c16ec1c23d4a11acf which merges the riscv tree. >>> >> >> In arch/riscv/include/asm/kexec.h, do the same as s390 did in commit >> 233c1e6c319c: >> >> diff --git a/arch/s390/include/asm/kexec.h b/arch/s390/include/asm/kexec.h >> index 7f3c9ac34bd8..540dd469b088 100644 >> --- a/arch/s390/include/asm/kexec.h >> +++ b/arch/s390/include/asm/kexec.h >> @@ -83,4 +83,12 @@ struct kimage_arch { >> extern const struct kexec_file_ops s390_kexec_image_ops; >> extern const struct kexec_file_ops s390_kexec_elf_ops; >> >> +#ifdef CONFIG_KEXEC_FILE >> +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 /*_S390_KEXEC_H */ > > 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. > > Best regards > Uwe > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv -- BR, Liao, Chang