From mboxrd@z Thu Jan 1 00:00:00 1970 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 57965C433EF for ; Mon, 6 Jun 2022 07:13:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230367AbiFFHNT (ORCPT ); Mon, 6 Jun 2022 03:13:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230307AbiFFHNN (ORCPT ); Mon, 6 Jun 2022 03:13:13 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B5563A736 for ; Mon, 6 Jun 2022 00:13:11 -0700 (PDT) Received: from kwepemi500014.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LGl5k2LY8zgYp0; Mon, 6 Jun 2022 15:11:22 +0800 (CST) Received: from [10.67.111.227] (10.67.111.227) by kwepemi500014.china.huawei.com (7.221.188.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 6 Jun 2022 15:13:08 +0800 Subject: Re: [PATCH] riscv: kexec: build {kexec_relocate,crash_save_regs,machine_kexec}.c as kexec core files To: Changbin Du , Paul Walmsley , Palmer Dabbelt , Albert Ou CC: Changbin Du , Hui Wang , , References: <20220606035635.o52ja3bjpru3fqcf@M910t> From: "lizhengyu (E)" Message-ID: <56da43f4-605f-4d89-af7a-cdc7bc429f94@huawei.com> Date: Mon, 6 Jun 2022 15:13:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20220606035635.o52ja3bjpru3fqcf@M910t> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.111.227] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500014.china.huawei.com (7.221.188.232) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks, but it has a solution already. See https://lore.kernel.org/all/20220601070204.26882-1-lizhengyu3@huawei.com/ . On Mon, 06 Jun 2022 11:56:35 +0800, Changbin Du wrote: > This fixes below linking errors when building with CONFIG_KEXEC_FILE=y && > CONFIG_KEXEC=n. The {kexec_relocate,crash_save_regs,machine_kexec}.c should > be core kexec source files. > > riscv64-linux-gnu-ld: kernel/kexec_core.o: in function `kimage_free': > /home/changbin/work/linux-riscv/kernel/kexec_core.c:651: undefined reference to `machine_kexec_cleanup' > riscv64-linux-gnu-ld: kernel/kexec_core.o: in function `__crash_kexec': > /home/changbin/work/linux-riscv/kernel/kexec_core.c:981: undefined reference to `machine_crash_shutdown' > riscv64-linux-gnu-ld: /home/changbin/work/linux-riscv/kernel/kexec_core.c:982: undefined reference to `machine_kexec' > riscv64-linux-gnu-ld: kernel/kexec_core.o: in function `crash_setup_regs': > /home/changbin/work/linux-riscv/./arch/riscv/include/asm/kexec.h:35: undefined reference to `riscv_crash_save_regs' > riscv64-linux-gnu-ld: kernel/kexec_core.o: in function `kernel_kexec': > /home/changbin/work/linux-riscv/kernel/kexec_core.c:1200: undefined reference to `machine_shutdown' > riscv64-linux-gnu-ld: /home/changbin/work/linux-riscv/kernel/kexec_core.c:1204: undefined reference to `machine_kexec' > riscv64-linux-gnu-ld: kernel/kexec_file.o: in function `__do_sys_kexec_file_load': > /home/changbin/work/linux-riscv/kernel/kexec_file.c:363: undefined reference to `machine_kexec_prepare' > riscv64-linux-gnu-ld: /home/changbin/work/linux-riscv/kernel/kexec_file.c:363: undefined reference to `machine_kexec_prepare' > make: *** [Makefile:1160: vmlinux] Error 1 > > Signed-off-by: Changbin Du > --- > arch/riscv/kernel/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile > index c71d6591d539..33bb60a354cd 100644 > --- a/arch/riscv/kernel/Makefile > +++ b/arch/riscv/kernel/Makefile > @@ -78,7 +78,7 @@ obj-$(CONFIG_SMP) += cpu_ops_sbi.o > endif > obj-$(CONFIG_HOTPLUG_CPU) += cpu-hotplug.o > obj-$(CONFIG_KGDB) += kgdb.o > -obj-$(CONFIG_KEXEC) += kexec_relocate.o crash_save_regs.o machine_kexec.o > +obj-$(CONFIG_KEXEC_CORE) += kexec_relocate.o crash_save_regs.o machine_kexec.o > obj-$(CONFIG_KEXEC_FILE) += elf_kexec.o machine_kexec_file.o > obj-$(CONFIG_CRASH_DUMP) += crash_dump.o >