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 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 6A4F1C6FA8F for ; Wed, 30 Aug 2023 11:39:43 +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-Transfer-Encoding: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-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=m5fUrHIzO4twC7rD0tN/p1seHZN16RsCJXpPKp6oTbs=; b=os1M6GScYtxTRJ eTOESl04WWf7J84MWct54MWlO6PiAKwcWff9uMvpJS5BKT6WJVMuvrQL7Re0//GkgNQoiTaITfmlR zK8o6IXut9kA5+LroLJtOly+ZCZCq8TjLPwCPacOU/42UXF5gvZ1n9eRQYxJIJaMMx5WpTDUgrrlo EcdHUX2nc/CpzC4D2t+BwRRCnjPARX8sATc9SISG4PowrtevRQ3ZyBhstUw6+36B8OWN0W22NAa2S 2LKR72R2PZAOrcsIbiTPq3DTR2zcCrhY6dus+b0INVpnQDPM425zhDnajpASpM697mIZEH0js9Okz NbU7geMond/H90UP9gGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qbJXa-00DPc6-2r; Wed, 30 Aug 2023 11:39:18 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qbJXX-00DPaz-10 for linux-arm-kernel@lists.infradead.org; Wed, 30 Aug 2023 11:39:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693395552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cTX1jjRNGO8OcMeJufjnK0bfy5r6OmV10OVkYSeEhKk=; b=W6EznoGKMxoP/45cVfbaPGnEDtE7e/MKLIdTTb9DN6t5Kvel4ZzF7uBjQ0uGlgCreTWHIj RwPYRDg93xJK6g7qLW6/oIEupJ0HzK+EbdVZqoEWMkqkR8Tyi863DVmYETB0s1zlE2z+u4 FAUBeVNsjlwRTETzda0R/JrJcEBiQRs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-655-vpS9i7EZNOObdnNWiyPNYA-1; Wed, 30 Aug 2023 07:39:10 -0400 X-MC-Unique: vpS9i7EZNOObdnNWiyPNYA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BF2A885CBE2; Wed, 30 Aug 2023 11:39:09 +0000 (UTC) Received: from localhost (unknown [10.72.113.118]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E6F7CC15BAE; Wed, 30 Aug 2023 11:39:08 +0000 (UTC) Date: Wed, 30 Aug 2023 19:39:05 +0800 From: Baoquan He To: kernel test robot Cc: linux-kernel@vger.kernel.org, oe-kbuild-all@lists.linux.dev, akpm@linux-foundation.org, catalin.marinas@arm.com, thunder.leizhen@huawei.com, dyoung@redhat.com, prudo@redhat.com, samuel.holland@sifive.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org Subject: Re: [PATCH v2 6/8] x86: kdump: use generic interface to simplify crashkernel reservation code Message-ID: References: <20230829121610.138107-7-bhe@redhat.com> <202308300910.e0i4piJT-lkp@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <202308300910.e0i4piJT-lkp@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230830_043915_443792_FB8FAC59 X-CRM114-Status: GOOD ( 30.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 08/30/23 at 09:49am, kernel test robot wrote: > Hi Baoquan, > > kernel test robot noticed the following build errors: > > [auto build test ERROR on arm64/for-next/core] > [also build test ERROR on tip/x86/core powerpc/next powerpc/fixes v6.5] > [cannot apply to linus/master next-20230829] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Baoquan-He/crash_core-c-remove-unnecessary-parameter-of-function/20230829-201942 > base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core > patch link: https://lore.kernel.org/r/20230829121610.138107-7-bhe%40redhat.com > patch subject: [PATCH v2 6/8] x86: kdump: use generic interface to simplify crashkernel reservation code > config: x86_64-randconfig-r022-20230830 (https://download.01.org/0day-ci/archive/20230830/202308300910.e0i4piJT-lkp@intel.com/config) > compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230830/202308300910.e0i4piJT-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot > | Closes: https://lore.kernel.org/oe-kbuild-all/202308300910.e0i4piJT-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > ld: vmlinux.o: in function `reserve_crashkernel_low': > kernel/crash_core.c:369: undefined reference to `crashk_low_res' > ld: kernel/crash_core.c:369: undefined reference to `crashk_low_res' > ld: kernel/crash_core.c:370: undefined reference to `crashk_low_res' > ld: kernel/crash_core.c:369: undefined reference to `crashk_low_res' > ld: kernel/crash_core.c:370: undefined reference to `crashk_low_res' > ld: vmlinux.o:kernel/crash_core.c:371: more undefined references to `crashk_low_res' follow > ld: vmlinux.o: in function `reserve_crashkernel_generic': > >> kernel/crash_core.c:453: undefined reference to `crashk_res' > >> ld: kernel/crash_core.c:453: undefined reference to `crashk_res' > ld: kernel/crash_core.c:454: undefined reference to `crashk_res' > >> ld: kernel/crash_core.c:453: undefined reference to `crashk_res' > ld: kernel/crash_core.c:454: undefined reference to `crashk_res' > ld: vmlinux.o:kernel/crash_core.c:454: more undefined references to `crashk_res' follow Thanks for reporting. This one has the same root cause as the i386-randconfig building. It's because crashk_res|crashk_low_res are defined in kernel/kexec_core.c, but referenced in generic reservation code in crash_core.c, while in this lkp's randconfig, CONFIG_KEXEC_CORE is unset, CONFIG_CRASH_CORE=on. Then undefined reference to `crashk_res' and `crashk_low_res' are reported. Below patch can fix it. I will post v3 to contain this. >From 5a5bda3b5b1e370b789489d87516c8f1fb966c46 Mon Sep 17 00:00:00 2001 From: Baoquan He Date: Tue, 29 Aug 2023 22:38:15 -0400 Subject: [PATCH] crash_core: move crashk_res and crashk_low_res definition into crash_core.c Content-type: text/plain Both crashk_res and crashk_low_res are used to mark the reserved crashkernel regions in iomem_resource tree. And later the generic crashkernel resrvation which references them will be added into crash_core.c. So move crashk_res and crashk_low_res definition into crash_core.c to avoid compiling error when CONFIG_CRASH_CORE=on while CONFIG_KEXEC_CORE is unset. Signed-off-by: Baoquan He --- include/linux/crash_core.h | 5 +++++ include/linux/kexec.h | 4 ---- kernel/crash_core.c | 16 ++++++++++++++++ kernel/kexec_core.c | 17 ----------------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h index d64006c4bd43..daa87b8730d3 100644 --- a/include/linux/crash_core.h +++ b/include/linux/crash_core.h @@ -9,6 +9,11 @@ #include #endif +/* Location of a reserved region to hold the crash kernel. + */ +extern struct resource crashk_res; +extern struct resource crashk_low_res; + #define CRASH_CORE_NOTE_NAME "CORE" #define CRASH_CORE_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4) #define CRASH_CORE_NOTE_NAME_BYTES ALIGN(sizeof(CRASH_CORE_NOTE_NAME), 4) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 22b5cd24f581..e762b0435c39 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -22,10 +22,6 @@ #include #include -/* Location of a reserved region to hold the crash kernel. - */ -extern struct resource crashk_res; -extern struct resource crashk_low_res; extern note_buf_t __percpu *crash_notes; #ifdef CONFIG_KEXEC_CORE diff --git a/kernel/crash_core.c b/kernel/crash_core.c index 61a8ea3b23a2..d76e7280c651 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -28,6 +28,22 @@ u32 *vmcoreinfo_note; /* trusted vmcoreinfo, e.g. we can make a copy in the crash memory */ static unsigned char *vmcoreinfo_data_safecopy; +/* Location of the reserved area for the crash kernel */ +struct resource crashk_res = { + .name = "Crash kernel", + .start = 0, + .end = 0, + .flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM, + .desc = IORES_DESC_CRASH_KERNEL +}; +struct resource crashk_low_res = { + .name = "Crash kernel", + .start = 0, + .end = 0, + .flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM, + .desc = IORES_DESC_CRASH_KERNEL +}; + /* * parsing the "crashkernel" commandline * diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index e2f2574d8b74..03ee65546df6 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -55,23 +55,6 @@ note_buf_t __percpu *crash_notes; /* Flag to indicate we are going to kexec a new kernel */ bool kexec_in_progress = false; - -/* Location of the reserved area for the crash kernel */ -struct resource crashk_res = { - .name = "Crash kernel", - .start = 0, - .end = 0, - .flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM, - .desc = IORES_DESC_CRASH_KERNEL -}; -struct resource crashk_low_res = { - .name = "Crash kernel", - .start = 0, - .end = 0, - .flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM, - .desc = IORES_DESC_CRASH_KERNEL -}; - int kexec_should_crash(struct task_struct *p) { /* -- 2.41.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel