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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 647A6EB64DA for ; Thu, 6 Jul 2023 02:21:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C0B3B8D0002; Wed, 5 Jul 2023 22:21:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B94478D0001; Wed, 5 Jul 2023 22:21:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E6C08D0002; Wed, 5 Jul 2023 22:21:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 87CFC8D0001 for ; Wed, 5 Jul 2023 22:21:19 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 53DD6C011F for ; Thu, 6 Jul 2023 02:21:19 +0000 (UTC) X-FDA: 80979585078.26.DA1A0F9 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by imf15.hostedemail.com (Postfix) with ESMTP id F1A10A000D for ; Thu, 6 Jul 2023 02:21:15 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=KxbIsTVh; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf15.hostedemail.com: domain of lkp@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688610076; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=Goclo4dOdqhloLRPASNGAlwYgXaGTJ7qRgDxZ9Ztlv4=; b=su8U//oaklnUk1haEI5I2HsUf0WYqagXCiNCjNrit1YrSk8ef75J72HXg1xGfYdM1pI4Ro B+SYC21315zzybygBX/Hl1qkbmaOLFW67MMeqrcY3+bJSl/ni5pOd0Xm3cIwhEQby4U4Y+ ZJPXd7N4QiN8lvc/jjsgsHXysPm230U= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=KxbIsTVh; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf15.hostedemail.com: domain of lkp@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688610076; a=rsa-sha256; cv=none; b=FCkgrkxdHixuzFX2Xy5S+H7VI3x/rVHhWnO1mVEry7gHgDY7RLV/6uTHgli6Y5mc/f9g3v 2+jWUIiW9NGJwm/sRsxFugnQwUVXmHkjopGuO56mPY74PEtYEkvn9ZgYnMtDyyI4h3j8a+ 0ms/L2XKx6kisCKunn5p2nK9aua6VaE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688610076; x=1720146076; h=date:from:to:cc:subject:message-id:mime-version; bh=eSG0SPrBg+WwnwpVtVX0JLZkL1ELS5mDxAr/h8oDjL4=; b=KxbIsTVha8hEIgqLiGAYrmOy7uyRsmKPTUwxA3mOB7Eoh2mfTWFJZQSo traFC5/wzQ6ACl362p1GAomjueiG6mJs4dcCZ4VUeCwnlwta6CwnN6h3m Ol2xwV2RHKTt/QQATBMjPyjOBLXdjssdCCmUolXLWTlzJhkNby9UxKjxr cLaA5GrPhov04+Jkks2NpmK4JVZJsPmcRf5Iy2dbMBKNdxwQ+nWNYgRl7 RhZL8wLBiz758zjt1Kq4JSZD2DE0YsHedKVa4GxLekLyCvPD9D6FSk0TY 1k4ocK4c0VfzuM/0BkdCGJibjYl1t98gF7wJWgTLQ+b0rfJCOihnWEaZw w==; X-IronPort-AV: E=McAfee;i="6600,9927,10762"; a="449847470" X-IronPort-AV: E=Sophos;i="6.01,184,1684825200"; d="scan'208";a="449847470" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2023 19:21:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10762"; a="1049922998" X-IronPort-AV: E=Sophos;i="6.01,184,1684825200"; d="scan'208";a="1049922998" Received: from lkp-server01.sh.intel.com (HELO c544d7fc5005) ([10.239.97.150]) by fmsmga005.fm.intel.com with ESMTP; 05 Jul 2023 19:21:12 -0700 Received: from kbuild by c544d7fc5005 with local (Exim 4.96) (envelope-from ) id 1qHEcJ-0000z0-32; Thu, 06 Jul 2023 02:21:11 +0000 Date: Thu, 6 Jul 2023 10:20:22 +0800 From: kernel test robot To: Eric DeVolder Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Andrew Morton , Linux Memory Management List Subject: [akpm-mm:mm-nonmm-unstable 9/19] kernel/kexec.c:33:16: error: call to undeclared function 'phys_to_boot_phys'; ISO C99 and later do not support implicit function declarations Message-ID: <202307061054.nVvXg1DV-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: F1A10A000D X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: fr89wdaioddfa6qsxfw4h1tb4e3q5eki X-HE-Tag: 1688610075-446142 X-HE-Meta: U2FsdGVkX19c3rKLbE2qjwEiHqJdGMEc1zKExRb+0IDdlE8HlcaE1RbgDSF1EtC8uypjX/m+cTLAFQ2ed4p2ATWnmgeyoE6xn/oZkFV86OyLwfEfdO1ueaLkiLN6zCkuimu6hw4LI3HfjAk3OVKq4/2ZpuEpYShYR9fDjsNS0u0HUKAH5tAo1zYknNEeUa1NDopN2ZA0tn5pOEJHYWYHFsYRjfF/2Asd3ygk4n3j5xygvt5P1mj+91ABlzeIefTTHFVc5daFYmEZL1SlzQor5w3R9FRPFVXyVih+HcfafpReNoiOOlyI0kalFBPHZxoKbNlex+E7YL10Pcq4loZefQPz7kWJrHzKGJtcmVdGa8/20IdAihIBT0WOcDhSByDy3Rsqc+5yWNNPo2R2eluqJEmsDg4RYU1e0tvkvT/8GIc2l6WL6RH1fi1E6vReUYelZYsXGCNwaqE5RaVQarTOXfWgRITOx65yPmGDHtWaMNsgYhfLo1l5n6uJKMm6KipvflqDmwYtV8foAZJWcahRom1jAN1w1VARc/rAezcyYMUUPuaiwg4BlITN8MC+uSq9NfguEt9nrh8MKZF7qBxS8a1DjmB6h/7cA25cyVWNj3HcV4bEPkjzYFJJ9o2K4oPhPCBaUiU2kN/kPxQrdAaeH2XiSdXCYhcAyFuSgAg1x7NfExK79sQdI6KZTBaxmiTJpRDjskZHY7A7zz0hXEQotbFV2qRm6Puia5SMWSoACdYrulZq2rbJLbhPOhL1XotIf+pZOd5jZjH+7upQN3myMMcS242XfuSiPnrNV+B6HzDpNAly4tmWhAbUQKzTTIStka8/K/Az3vQd7xj3+0UuCKSLrY5b64CC5yMbw6+co0GMFksY0u+K7TEdgLxasH1f5DkO2NovPii1+F9kqsAEa++mnbX0hH+I/+2Rp/dMslicHZjEYIzBQxKh+/19385jzMPU0KYeiezDKCL6q76 mKhEJjE9 LRMD/M+AcY0XlYQpJr0QVP0h+bpLWv+YD9vD/jvA3TkVKVLDtG6oQnsFy8grwxxasIVThKsXwbHiYO/JdXmApN0jYfmtkzVSZkmXWEDB89HJHS8o9eEb18RApClfQLmRD0HQpn/UmP2FgHH+5CT7AUrxXcK5oyY3P4gSZB7LTm0cUCdgMUNG42SnKnc4Vmg1s9CK3aBV6IHZ6YhDnFtuk6LnkJRCzJ3Uu4qNRFfYlb4rp4NnZFNuGyINlQgO/yIV+FEiAjX52s3FAswGLJ7pJzo3LmTI6+3MFdQHkkoz3YidcbHaItw91aiFDRTu0lSw9xDVjs4rqYblaiBSt5sErtt8n135AyIf998m9nfLkni5f3/ghHvdyvS7Axuk3/VYAP/hQJRyqD1CETFIZd6uvA0EetzJWeo/ldq9tadPkJ0sDAF+C5JhI9ERReSIT8cg/ga8na5vNnJQyKwOlK0jSZomrMISQE8v2Ja6HFr0lX0ndCsvt+TL+VdMli4sPH4jiIk0lWOroiiPwoDBXIyEnfKWXUBR7Cah+7zgu X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Eric, First bad commit (maybe != root cause): tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable head: dafc95d811f426078ef86cbbbb995055280e415e commit: e92bee18ff7a05e2f59f4135d10067dcefb3e861 [9/19] arm/kexec: refactor for kernel/Kconfig.kexec config: arm-randconfig-r016-20230706 (https://download.01.org/0day-ci/archive/20230706/202307061054.nVvXg1DV-lkp@intel.com/config) compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a) reproduce: (https://download.01.org/0day-ci/archive/20230706/202307061054.nVvXg1DV-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/202307061054.nVvXg1DV-lkp@intel.com/ All error/warnings (new ones prefixed by >>): >> kernel/kexec.c:33:16: error: call to undeclared function 'phys_to_boot_phys'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 33 | if ((entry < phys_to_boot_phys(crashk_res.start)) || | ^ >> kernel/kexec.c:43:7: error: incomplete definition of type 'struct kimage' 43 | image->start = entry; | ~~~~~^ kernel/kexec_internal.h:7:8: note: forward declaration of 'struct kimage' 7 | struct kimage *do_kimage_alloc_init(void); | ^ kernel/kexec.c:44:7: error: incomplete definition of type 'struct kimage' 44 | image->nr_segments = nr_segments; | ~~~~~^ kernel/kexec_internal.h:7:8: note: forward declaration of 'struct kimage' 7 | struct kimage *do_kimage_alloc_init(void); | ^ kernel/kexec.c:45:14: error: incomplete definition of type 'struct kimage' 45 | memcpy(image->segment, segments, nr_segments * sizeof(*segments)); | ~~~~~^ kernel/kexec_internal.h:7:8: note: forward declaration of 'struct kimage' 7 | struct kimage *do_kimage_alloc_init(void); | ^ >> kernel/kexec.c:45:55: error: invalid application of 'sizeof' to an incomplete type 'struct kexec_segment' 45 | memcpy(image->segment, segments, nr_segments * sizeof(*segments)); | ^~~~~~~~~~~ include/linux/syscalls.h:20:8: note: forward declaration of 'struct kexec_segment' 20 | struct kexec_segment; | ^ kernel/kexec.c:49:8: error: incomplete definition of type 'struct kimage' 49 | image->control_page = crashk_res.start; | ~~~~~^ kernel/kexec_internal.h:7:8: note: forward declaration of 'struct kimage' 7 | struct kimage *do_kimage_alloc_init(void); | ^ kernel/kexec.c:50:8: error: incomplete definition of type 'struct kimage' 50 | image->type = KEXEC_TYPE_CRASH; | ~~~~~^ kernel/kexec_internal.h:7:8: note: forward declaration of 'struct kimage' 7 | struct kimage *do_kimage_alloc_init(void); | ^ >> kernel/kexec.c:50:17: error: use of undeclared identifier 'KEXEC_TYPE_CRASH' 50 | image->type = KEXEC_TYPE_CRASH; | ^ kernel/kexec.c:63:7: error: incomplete definition of type 'struct kimage' 63 | image->control_code_page = kimage_alloc_control_pages(image, | ~~~~~^ kernel/kexec_internal.h:7:8: note: forward declaration of 'struct kimage' 7 | struct kimage *do_kimage_alloc_init(void); | ^ >> kernel/kexec.c:63:29: error: call to undeclared function 'kimage_alloc_control_pages'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 63 | image->control_code_page = kimage_alloc_control_pages(image, | ^ >> kernel/kexec.c:64:19: error: use of undeclared identifier 'KEXEC_CONTROL_PAGE_SIZE' 64 | get_order(KEXEC_CONTROL_PAGE_SIZE)); | ^ kernel/kexec.c:65:12: error: incomplete definition of type 'struct kimage' 65 | if (!image->control_code_page) { | ~~~~~^ kernel/kexec_internal.h:7:8: note: forward declaration of 'struct kimage' 7 | struct kimage *do_kimage_alloc_init(void); | ^ kernel/kexec.c:71:8: error: incomplete definition of type 'struct kimage' 71 | image->swap_page = kimage_alloc_control_pages(image, 0); | ~~~~~^ kernel/kexec_internal.h:7:8: note: forward declaration of 'struct kimage' 7 | struct kimage *do_kimage_alloc_init(void); | ^ kernel/kexec.c:72:13: error: incomplete definition of type 'struct kimage' 72 | if (!image->swap_page) { | ~~~~~^ kernel/kexec_internal.h:7:8: note: forward declaration of 'struct kimage' 7 | struct kimage *do_kimage_alloc_init(void); | ^ kernel/kexec.c:81:30: error: incomplete definition of type 'struct kimage' 81 | kimage_free_page_list(&image->control_pages); | ~~~~~^ kernel/kexec_internal.h:7:8: note: forward declaration of 'struct kimage' 7 | struct kimage *do_kimage_alloc_init(void); | ^ >> kernel/kexec.c:103:17: error: use of undeclared identifier 'kexec_crash_image'; did you mean 'kexec_crash_loaded'? 103 | dest_image = &kexec_crash_image; | ^~~~~~~~~~~~~~~~~ | kexec_crash_loaded include/linux/kexec.h:499:19: note: 'kexec_crash_loaded' declared here 499 | static inline int kexec_crash_loaded(void) { return 0; } | ^ kernel/kexec.c:104:7: error: use of undeclared identifier 'kexec_crash_image'; did you mean 'kexec_crash_loaded'? 104 | if (kexec_crash_image) | ^~~~~~~~~~~~~~~~~ | kexec_crash_loaded include/linux/kexec.h:499:19: note: 'kexec_crash_loaded' declared here 499 | static inline int kexec_crash_loaded(void) { return 0; } | ^ >> kernel/kexec.c:105:4: error: call to undeclared function 'arch_kexec_unprotect_crashkres'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 105 | arch_kexec_unprotect_crashkres(); | ^ >> kernel/kexec.c:107:17: error: use of undeclared identifier 'kexec_image'; did you mean 'dest_image'? 107 | dest_image = &kexec_image; | ^~~~~~~~~~~ | dest_image kernel/kexec.c:90:18: note: 'dest_image' declared here 90 | struct kimage **dest_image, *image; | ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. -- >> arch/arm/kernel/machine_kexec.c:33:34: warning: declaration of 'struct kimage' will not be visible outside of this function [-Wvisibility] 33 | int machine_kexec_prepare(struct kimage *image) | ^ >> arch/arm/kernel/machine_kexec.c:39:7: error: incomplete definition of type 'struct kimage' 39 | image->arch.kernel_r2 = image->start - KEXEC_ARM_ZIMAGE_OFFSET | ~~~~~^ arch/arm/kernel/machine_kexec.c:33:34: note: forward declaration of 'struct kimage' 33 | int machine_kexec_prepare(struct kimage *image) | ^ arch/arm/kernel/machine_kexec.c:39:31: error: incomplete definition of type 'struct kimage' 39 | image->arch.kernel_r2 = image->start - KEXEC_ARM_ZIMAGE_OFFSET | ~~~~~^ arch/arm/kernel/machine_kexec.c:33:34: note: forward declaration of 'struct kimage' 33 | int machine_kexec_prepare(struct kimage *image) | ^ >> arch/arm/kernel/machine_kexec.c:39:41: error: use of undeclared identifier 'KEXEC_ARM_ZIMAGE_OFFSET' 39 | image->arch.kernel_r2 = image->start - KEXEC_ARM_ZIMAGE_OFFSET | ^ >> arch/arm/kernel/machine_kexec.c:40:12: error: use of undeclared identifier 'KEXEC_ARM_ATAGS_OFFSET' 40 | + KEXEC_ARM_ATAGS_OFFSET; | ^ arch/arm/kernel/machine_kexec.c:55:23: error: incomplete definition of type 'struct kimage' 55 | for (i = 0; i < image->nr_segments; i++) { | ~~~~~^ arch/arm/kernel/machine_kexec.c:33:34: note: forward declaration of 'struct kimage' 33 | int machine_kexec_prepare(struct kimage *image) | ^ arch/arm/kernel/machine_kexec.c:56:27: error: incomplete definition of type 'struct kimage' 56 | current_segment = &image->segment[i]; | ~~~~~^ arch/arm/kernel/machine_kexec.c:33:34: note: forward declaration of 'struct kimage' 33 | int machine_kexec_prepare(struct kimage *image) | ^ >> arch/arm/kernel/machine_kexec.c:58:63: error: incomplete definition of type 'struct kexec_segment' 58 | if (!memblock_is_region_memory(idmap_to_phys(current_segment->mem), | ~~~~~~~~~~~~~~~^ arch/arm/kernel/machine_kexec.c:35:9: note: forward declaration of 'struct kexec_segment' 35 | struct kexec_segment *current_segment; | ^ arch/arm/kernel/machine_kexec.c:59:28: error: incomplete definition of type 'struct kexec_segment' 59 | current_segment->memsz)) | ~~~~~~~~~~~~~~~^ arch/arm/kernel/machine_kexec.c:35:9: note: forward declaration of 'struct kexec_segment' 35 | struct kexec_segment *current_segment; | ^ arch/arm/kernel/machine_kexec.c:62:50: error: incomplete definition of type 'struct kexec_segment' 62 | err = get_user(header, (__be32*)current_segment->buf); | ~~~~~~~~~~~~~~~^ arch/arm/include/asm/uaccess.h:229:38: note: expanded from macro 'get_user' 229 | #define get_user(x, p) __get_user(x, p) | ^ arch/arm/include/asm/uaccess.h:258:23: note: expanded from macro '__get_user' 258 | __get_user_err((x), (ptr), __gu_err, TUSER()); \ | ^~~ arch/arm/include/asm/uaccess.h:264:44: note: expanded from macro '__get_user_err' 264 | unsigned long __gu_addr = (unsigned long)(ptr); \ | ^~~ arch/arm/kernel/machine_kexec.c:35:9: note: forward declaration of 'struct kexec_segment' 35 | struct kexec_segment *current_segment; | ^ arch/arm/kernel/machine_kexec.c:62:50: error: incomplete definition of type 'struct kexec_segment' 62 | err = get_user(header, (__be32*)current_segment->buf); | ~~~~~~~~~~~~~~~^ arch/arm/include/asm/uaccess.h:229:38: note: expanded from macro 'get_user' 229 | #define get_user(x, p) __get_user(x, p) | ^ arch/arm/include/asm/uaccess.h:258:23: note: expanded from macro '__get_user' 258 | __get_user_err((x), (ptr), __gu_err, TUSER()); \ | ^~~ arch/arm/include/asm/uaccess.h:270:19: note: expanded from macro '__get_user_err' 270 | switch (sizeof(*(ptr))) { \ | ^~~ arch/arm/kernel/machine_kexec.c:35:9: note: forward declaration of 'struct kexec_segment' 35 | struct kexec_segment *current_segment; | ^ arch/arm/kernel/machine_kexec.c:62:50: error: incomplete definition of type 'struct kexec_segment' 62 | err = get_user(header, (__be32*)current_segment->buf); | ~~~~~~~~~~~~~~~^ arch/arm/include/asm/uaccess.h:229:38: note: expanded from macro 'get_user' 229 | #define get_user(x, p) __get_user(x, p) | ^ arch/arm/include/asm/uaccess.h:258:23: note: expanded from macro '__get_user' 258 | __get_user_err((x), (ptr), __gu_err, TUSER()); \ | ^~~ arch/arm/include/asm/uaccess.h:277:22: note: expanded from macro '__get_user_err' 277 | (x) = (__typeof__(*(ptr)))__gu_val; \ | ^~~ arch/arm/kernel/machine_kexec.c:35:9: note: forward declaration of 'struct kexec_segment' 35 | struct kexec_segment *current_segment; | ^ arch/arm/kernel/machine_kexec.c:67:9: error: incomplete definition of type 'struct kimage' 67 | image->arch.kernel_r2 = current_segment->mem; | ~~~~~^ arch/arm/kernel/machine_kexec.c:33:34: note: forward declaration of 'struct kimage' 33 | int machine_kexec_prepare(struct kimage *image) | ^ arch/arm/kernel/machine_kexec.c:67:43: error: incomplete definition of type 'struct kexec_segment' 67 | image->arch.kernel_r2 = current_segment->mem; | ~~~~~~~~~~~~~~~^ arch/arm/kernel/machine_kexec.c:35:9: note: forward declaration of 'struct kexec_segment' 35 | struct kexec_segment *current_segment; | ^ >> arch/arm/kernel/machine_kexec.c:33:5: warning: no previous prototype for function 'machine_kexec_prepare' [-Wmissing-prototypes] 33 | int machine_kexec_prepare(struct kimage *image) | ^ arch/arm/kernel/machine_kexec.c:33:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 33 | int machine_kexec_prepare(struct kimage *image) | ^ | static arch/arm/kernel/machine_kexec.c:72:35: warning: declaration of 'struct kimage' will not be visible outside of this function [-Wvisibility] 72 | void machine_kexec_cleanup(struct kimage *image) | ^ >> arch/arm/kernel/machine_kexec.c:72:6: warning: no previous prototype for function 'machine_kexec_cleanup' [-Wmissing-prototypes] 72 | void machine_kexec_cleanup(struct kimage *image) | ^ arch/arm/kernel/machine_kexec.c:72:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 72 | void machine_kexec_cleanup(struct kimage *image) | ^ | static >> arch/arm/kernel/machine_kexec.c:82:2: error: call to undeclared function 'crash_setup_regs'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 82 | crash_setup_regs(®s, get_irq_regs()); | ^ >> arch/arm/kernel/machine_kexec.c:85:2: error: call to undeclared function 'crash_save_cpu'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 85 | crash_save_cpu(®s, smp_processor_id()); | ^ arch/arm/kernel/machine_kexec.c:146:2: error: call to undeclared function 'crash_save_cpu'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 146 | crash_save_cpu(regs, smp_processor_id()); | ^ arch/arm/kernel/machine_kexec.c:152:27: warning: declaration of 'struct kimage' will not be visible outside of this function [-Wvisibility] 152 | void machine_kexec(struct kimage *image) | ^ arch/arm/kernel/machine_kexec.c:167:19: error: incomplete definition of type 'struct kimage' 167 | page_list = image->head & PAGE_MASK; | ~~~~~^ arch/arm/kernel/machine_kexec.c:152:27: note: forward declaration of 'struct kimage' 152 | void machine_kexec(struct kimage *image) | ^ arch/arm/kernel/machine_kexec.c:169:41: error: incomplete definition of type 'struct kimage' 169 | reboot_code_buffer = page_address(image->control_code_page); | ~~~~~^ include/linux/mm.h:2144:48: note: expanded from macro 'page_address' 2144 | #define page_address(page) lowmem_page_address(page) | ^~~~ arch/arm/kernel/machine_kexec.c:152:27: note: forward declaration of 'struct kimage' 152 | void machine_kexec(struct kimage *image) | ^ arch/arm/kernel/machine_kexec.c:177:35: error: incomplete definition of type 'struct kimage' 177 | data->kexec_start_address = image->start; | ~~~~~^ arch/arm/kernel/machine_kexec.c:152:27: note: forward declaration of 'struct kimage' 152 | void machine_kexec(struct kimage *image) | ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 5 warnings and 20 errors generated. -- >> arch/arm/kernel/setup.c:1034:49: error: use of undeclared identifier 'SECTION_SIZE' 1034 | start = memblock_phys_alloc_range(crash_size, SECTION_SIZE, | ^ 1 error generated. Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for KEXEC Depends on [n]: ARCH_SUPPORTS_KEXEC [=n] Selected by [y]: - CRASH_DUMP [=y] && ARCH_SUPPORTS_CRASH_DUMP [=y] vim +/phys_to_boot_phys +33 kernel/kexec.c a43cac0d9dc207 Dave Young 2015-09-09 21 255aedd90e3e80 Vivek Goyal 2014-08-08 22 static int kimage_alloc_init(struct kimage **rimage, unsigned long entry, 72414d3f1d22fc Maneesh Soni 2005-06-25 23 unsigned long nr_segments, 5d700a0fd71ded Arnd Bergmann 2021-09-08 24 struct kexec_segment *segments, 255aedd90e3e80 Vivek Goyal 2014-08-08 25 unsigned long flags) dc009d92435f99 Eric W. Biederman 2005-06-25 26 { 255aedd90e3e80 Vivek Goyal 2014-08-08 27 int ret; dc009d92435f99 Eric W. Biederman 2005-06-25 28 struct kimage *image; 255aedd90e3e80 Vivek Goyal 2014-08-08 29 bool kexec_on_panic = flags & KEXEC_ON_CRASH; 255aedd90e3e80 Vivek Goyal 2014-08-08 30 255aedd90e3e80 Vivek Goyal 2014-08-08 31 if (kexec_on_panic) { 255aedd90e3e80 Vivek Goyal 2014-08-08 32 /* Verify we have a valid entry point */ 43546d8669d62d Russell King 2016-08-02 @33 if ((entry < phys_to_boot_phys(crashk_res.start)) || 43546d8669d62d Russell King 2016-08-02 34 (entry > phys_to_boot_phys(crashk_res.end))) 255aedd90e3e80 Vivek Goyal 2014-08-08 35 return -EADDRNOTAVAIL; 255aedd90e3e80 Vivek Goyal 2014-08-08 36 } dc009d92435f99 Eric W. Biederman 2005-06-25 37 dc009d92435f99 Eric W. Biederman 2005-06-25 38 /* Allocate and initialize a controlling structure */ dabe78628dd886 Vivek Goyal 2014-08-08 39 image = do_kimage_alloc_init(); dabe78628dd886 Vivek Goyal 2014-08-08 40 if (!image) dabe78628dd886 Vivek Goyal 2014-08-08 41 return -ENOMEM; dabe78628dd886 Vivek Goyal 2014-08-08 42 dabe78628dd886 Vivek Goyal 2014-08-08 @43 image->start = entry; 5d700a0fd71ded Arnd Bergmann 2021-09-08 44 image->nr_segments = nr_segments; 5d700a0fd71ded Arnd Bergmann 2021-09-08 @45 memcpy(image->segment, segments, nr_segments * sizeof(*segments)); dabe78628dd886 Vivek Goyal 2014-08-08 46 255aedd90e3e80 Vivek Goyal 2014-08-08 47 if (kexec_on_panic) { cdf4b3fa03bab1 Xunlei Pang 2016-01-20 48 /* Enable special crash kernel control page alloc policy. */ 255aedd90e3e80 Vivek Goyal 2014-08-08 49 image->control_page = crashk_res.start; 255aedd90e3e80 Vivek Goyal 2014-08-08 @50 image->type = KEXEC_TYPE_CRASH; 255aedd90e3e80 Vivek Goyal 2014-08-08 51 } 255aedd90e3e80 Vivek Goyal 2014-08-08 52 cdf4b3fa03bab1 Xunlei Pang 2016-01-20 53 ret = sanity_check_segment_list(image); cdf4b3fa03bab1 Xunlei Pang 2016-01-20 54 if (ret) cdf4b3fa03bab1 Xunlei Pang 2016-01-20 55 goto out_free_image; cdf4b3fa03bab1 Xunlei Pang 2016-01-20 56 dc009d92435f99 Eric W. Biederman 2005-06-25 57 /* dc009d92435f99 Eric W. Biederman 2005-06-25 58 * Find a location for the control code buffer, and add it dc009d92435f99 Eric W. Biederman 2005-06-25 59 * the vector of segments so that it's pages will also be dc009d92435f99 Eric W. Biederman 2005-06-25 60 * counted as destination pages. dc009d92435f99 Eric W. Biederman 2005-06-25 61 */ 255aedd90e3e80 Vivek Goyal 2014-08-08 62 ret = -ENOMEM; dc009d92435f99 Eric W. Biederman 2005-06-25 @63 image->control_code_page = kimage_alloc_control_pages(image, 163f6876f5c3ff Huang Ying 2008-08-15 @64 get_order(KEXEC_CONTROL_PAGE_SIZE)); dc009d92435f99 Eric W. Biederman 2005-06-25 65 if (!image->control_code_page) { e1bebcf41ed0aa Fabian Frederick 2014-06-06 66 pr_err("Could not allocate control_code_buffer\n"); 2965faa5e03d1e Dave Young 2015-09-09 67 goto out_free_image; dc009d92435f99 Eric W. Biederman 2005-06-25 68 } dd5f726076cc76 Vivek Goyal 2014-08-08 69 2965faa5e03d1e Dave Young 2015-09-09 70 if (!kexec_on_panic) { 2965faa5e03d1e Dave Young 2015-09-09 71 image->swap_page = kimage_alloc_control_pages(image, 0); 2965faa5e03d1e Dave Young 2015-09-09 72 if (!image->swap_page) { 2965faa5e03d1e Dave Young 2015-09-09 73 pr_err("Could not allocate swap buffer\n"); 2965faa5e03d1e Dave Young 2015-09-09 74 goto out_free_control_pages; dc009d92435f99 Eric W. Biederman 2005-06-25 75 } dc009d92435f99 Eric W. Biederman 2005-06-25 76 } 72414d3f1d22fc Maneesh Soni 2005-06-25 77 2965faa5e03d1e Dave Young 2015-09-09 78 *rimage = image; 2965faa5e03d1e Dave Young 2015-09-09 79 return 0; 2965faa5e03d1e Dave Young 2015-09-09 80 out_free_control_pages: 2965faa5e03d1e Dave Young 2015-09-09 81 kimage_free_page_list(&image->control_pages); 2965faa5e03d1e Dave Young 2015-09-09 82 out_free_image: 2965faa5e03d1e Dave Young 2015-09-09 83 kfree(image); 2965faa5e03d1e Dave Young 2015-09-09 84 return ret; dc009d92435f99 Eric W. Biederman 2005-06-25 85 } dc009d92435f99 Eric W. Biederman 2005-06-25 86 0eea08678ebe9f Minfei Huang 2016-05-23 87 static int do_kexec_load(unsigned long entry, unsigned long nr_segments, 5d700a0fd71ded Arnd Bergmann 2021-09-08 88 struct kexec_segment *segments, unsigned long flags) 0eea08678ebe9f Minfei Huang 2016-05-23 89 { 0eea08678ebe9f Minfei Huang 2016-05-23 90 struct kimage **dest_image, *image; 0eea08678ebe9f Minfei Huang 2016-05-23 91 unsigned long i; 0eea08678ebe9f Minfei Huang 2016-05-23 92 int ret; 0eea08678ebe9f Minfei Huang 2016-05-23 93 4b692e86161935 Arnd Bergmann 2021-09-08 94 /* 4b692e86161935 Arnd Bergmann 2021-09-08 95 * Because we write directly to the reserved memory region when loading 05c6257433b721 Valentin Schneider 2022-06-30 96 * crash kernels we need a serialization here to prevent multiple crash 05c6257433b721 Valentin Schneider 2022-06-30 97 * kernels from attempting to load simultaneously. 4b692e86161935 Arnd Bergmann 2021-09-08 98 */ 05c6257433b721 Valentin Schneider 2022-06-30 99 if (!kexec_trylock()) 4b692e86161935 Arnd Bergmann 2021-09-08 100 return -EBUSY; 4b692e86161935 Arnd Bergmann 2021-09-08 101 0eea08678ebe9f Minfei Huang 2016-05-23 102 if (flags & KEXEC_ON_CRASH) { 0eea08678ebe9f Minfei Huang 2016-05-23 @103 dest_image = &kexec_crash_image; 0eea08678ebe9f Minfei Huang 2016-05-23 104 if (kexec_crash_image) 0eea08678ebe9f Minfei Huang 2016-05-23 @105 arch_kexec_unprotect_crashkres(); 0eea08678ebe9f Minfei Huang 2016-05-23 106 } else { 0eea08678ebe9f Minfei Huang 2016-05-23 @107 dest_image = &kexec_image; 0eea08678ebe9f Minfei Huang 2016-05-23 108 } 0eea08678ebe9f Minfei Huang 2016-05-23 109 0eea08678ebe9f Minfei Huang 2016-05-23 110 if (nr_segments == 0) { 0eea08678ebe9f Minfei Huang 2016-05-23 111 /* Uninstall image */ 0eea08678ebe9f Minfei Huang 2016-05-23 112 kimage_free(xchg(dest_image, NULL)); 4b692e86161935 Arnd Bergmann 2021-09-08 113 ret = 0; 4b692e86161935 Arnd Bergmann 2021-09-08 114 goto out_unlock; 0eea08678ebe9f Minfei Huang 2016-05-23 115 } 0eea08678ebe9f Minfei Huang 2016-05-23 116 if (flags & KEXEC_ON_CRASH) { 0eea08678ebe9f Minfei Huang 2016-05-23 117 /* 0eea08678ebe9f Minfei Huang 2016-05-23 118 * Loading another kernel to switch to if this one 0eea08678ebe9f Minfei Huang 2016-05-23 119 * crashes. Free any current crash dump kernel before 0eea08678ebe9f Minfei Huang 2016-05-23 120 * we corrupt it. 0eea08678ebe9f Minfei Huang 2016-05-23 121 */ 0eea08678ebe9f Minfei Huang 2016-05-23 122 kimage_free(xchg(&kexec_crash_image, NULL)); 0eea08678ebe9f Minfei Huang 2016-05-23 123 } 0eea08678ebe9f Minfei Huang 2016-05-23 124 0eea08678ebe9f Minfei Huang 2016-05-23 125 ret = kimage_alloc_init(&image, entry, nr_segments, segments, flags); 0eea08678ebe9f Minfei Huang 2016-05-23 126 if (ret) 4b692e86161935 Arnd Bergmann 2021-09-08 127 goto out_unlock; 0eea08678ebe9f Minfei Huang 2016-05-23 128 0eea08678ebe9f Minfei Huang 2016-05-23 129 if (flags & KEXEC_PRESERVE_CONTEXT) 0eea08678ebe9f Minfei Huang 2016-05-23 130 image->preserve_context = 1; 0eea08678ebe9f Minfei Huang 2016-05-23 131 0eea08678ebe9f Minfei Huang 2016-05-23 132 ret = machine_kexec_prepare(image); 0eea08678ebe9f Minfei Huang 2016-05-23 133 if (ret) 0eea08678ebe9f Minfei Huang 2016-05-23 134 goto out; 0eea08678ebe9f Minfei Huang 2016-05-23 135 1229384f5b856d Xunlei Pang 2017-07-12 136 /* 1229384f5b856d Xunlei Pang 2017-07-12 137 * Some architecture(like S390) may touch the crash memory before 1229384f5b856d Xunlei Pang 2017-07-12 138 * machine_kexec_prepare(), we must copy vmcoreinfo data after it. 1229384f5b856d Xunlei Pang 2017-07-12 139 */ 1229384f5b856d Xunlei Pang 2017-07-12 140 ret = kimage_crash_copy_vmcoreinfo(image); 1229384f5b856d Xunlei Pang 2017-07-12 141 if (ret) 1229384f5b856d Xunlei Pang 2017-07-12 142 goto out; 1229384f5b856d Xunlei Pang 2017-07-12 143 0eea08678ebe9f Minfei Huang 2016-05-23 144 for (i = 0; i < nr_segments; i++) { 0eea08678ebe9f Minfei Huang 2016-05-23 145 ret = kimage_load_segment(image, &image->segment[i]); 0eea08678ebe9f Minfei Huang 2016-05-23 146 if (ret) 0eea08678ebe9f Minfei Huang 2016-05-23 147 goto out; 0eea08678ebe9f Minfei Huang 2016-05-23 148 } 0eea08678ebe9f Minfei Huang 2016-05-23 149 0eea08678ebe9f Minfei Huang 2016-05-23 150 kimage_terminate(image); 0eea08678ebe9f Minfei Huang 2016-05-23 151 de68e4daea9084 Pavel Tatashin 2019-12-04 152 ret = machine_kexec_post_load(image); de68e4daea9084 Pavel Tatashin 2019-12-04 153 if (ret) de68e4daea9084 Pavel Tatashin 2019-12-04 154 goto out; de68e4daea9084 Pavel Tatashin 2019-12-04 155 0eea08678ebe9f Minfei Huang 2016-05-23 156 /* Install the new kernel and uninstall the old */ 0eea08678ebe9f Minfei Huang 2016-05-23 157 image = xchg(dest_image, image); 0eea08678ebe9f Minfei Huang 2016-05-23 158 0eea08678ebe9f Minfei Huang 2016-05-23 159 out: 0eea08678ebe9f Minfei Huang 2016-05-23 160 if ((flags & KEXEC_ON_CRASH) && kexec_crash_image) 0eea08678ebe9f Minfei Huang 2016-05-23 161 arch_kexec_protect_crashkres(); 0eea08678ebe9f Minfei Huang 2016-05-23 162 0eea08678ebe9f Minfei Huang 2016-05-23 163 kimage_free(image); 4b692e86161935 Arnd Bergmann 2021-09-08 164 out_unlock: 05c6257433b721 Valentin Schneider 2022-06-30 165 kexec_unlock(); 0eea08678ebe9f Minfei Huang 2016-05-23 166 return ret; 0eea08678ebe9f Minfei Huang 2016-05-23 167 } 0eea08678ebe9f Minfei Huang 2016-05-23 168 :::::: The code at line 33 was first introduced by commit :::::: 43546d8669d62d75fa69ca9a45d2f586665f56bd kexec: allow architectures to override boot mapping :::::: TO: Russell King :::::: CC: Linus Torvalds -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki