Re: [linux-next:master 2464/2855] arch/arm/kernel/setup.c:1028:63: error: 'SECTION_SIZE' undeclared; did you mean 'SUBSECTION_SIZE'?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The original commit is wrong.

It's wrong because not all configurations support KEXEC on ARM,
particularly those without a MMU - and as the kernel test robot has
found, a configuration with MMU=n fails to build. It makes no sense
to provide a dummy value for SECTION_SIZE to make this buildable.

Please drop this commit or revert it.

On Fri, Jan 28, 2022 at 07:38:27PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   b605fdc54c2b28c30ef06d9db99282d8a32ae4be
> commit: 35f56ebeffca44e35eda0a5c6a6ce2cf632b03f9 [2464/2855] arm: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef
> config: arm-randconfig-c002-20220124 (https://download.01.org/0day-ci/archive/20220128/202201281915.3bBKB8nP-lkp@xxxxxxxxx/config)
> compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=35f56ebeffca44e35eda0a5c6a6ce2cf632b03f9
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout 35f56ebeffca44e35eda0a5c6a6ce2cf632b03f9
>         # save the config file to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> 
> All errors (new ones prefixed by >>):
> 
>    arch/arm/kernel/setup.c: In function 'reserve_crashkernel':
> >> arch/arm/kernel/setup.c:1028:63: error: 'SECTION_SIZE' undeclared (first use in this function); did you mean 'SUBSECTION_SIZE'?
>     1028 |                 start = memblock_phys_alloc_range(crash_size, SECTION_SIZE,
>          |                                                               ^~~~~~~~~~~~
>          |                                                               SUBSECTION_SIZE
>    arch/arm/kernel/setup.c:1028:63: note: each undeclared identifier is reported only once for each function it appears in
>    In file included from arch/arm/include/asm/efi.h:12,
>                     from arch/arm/kernel/setup.c:37:
>    At top level:
>    arch/arm/include/asm/fixmap.h:39:35: warning: '__end_of_fixed_addresses' defined but not used [-Wunused-const-variable=]
>       39 | static const enum fixed_addresses __end_of_fixed_addresses =
>          |                                   ^~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> vim +1028 arch/arm/kernel/setup.c
> 
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10   989  
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10   990  /**
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10   991   * reserve_crashkernel() - reserves memory are for crash kernel
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10   992   *
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10   993   * This function reserves memory area given in "crashkernel=" kernel command
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10   994   * line parameter. The memory reserved is used by a dump capture kernel when
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10   995   * primary kernel is crashing.
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10   996   */
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10   997  static void __init reserve_crashkernel(void)
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10   998  {
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10   999  	unsigned long long crash_size, crash_base;
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1000  	unsigned long long total_mem;
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1001  	int ret;
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1002  
> 35f56ebeffca44 Jisheng Zhang   2022-01-27  1003  	if (!IS_ENABLED(CONFIG_KEXEC_CORE))
> 35f56ebeffca44 Jisheng Zhang   2022-01-27  1004  		return;
> 35f56ebeffca44 Jisheng Zhang   2022-01-27  1005  
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1006  	total_mem = get_total_mem();
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1007  	ret = parse_crashkernel(boot_command_line, total_mem,
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1008  				&crash_size, &crash_base);
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1009  	if (ret)
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1010  		return;
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1011  
> 61603016e2122b Russell King    2016-03-14  1012  	if (crash_base <= 0) {
> d0506a2395eb07 Russell King    2016-04-01  1013  		unsigned long long crash_max = idmap_to_phys((u32)~0);
> 67556d7a851c20 Russell King    2017-07-19  1014  		unsigned long long lowmem_max = __pa(high_memory - 1) + 1;
> 67556d7a851c20 Russell King    2017-07-19  1015  		if (crash_max > lowmem_max)
> 67556d7a851c20 Russell King    2017-07-19  1016  			crash_max = lowmem_max;
> a7259df7670240 Mike Rapoport   2021-09-02  1017  
> a7259df7670240 Mike Rapoport   2021-09-02  1018  		crash_base = memblock_phys_alloc_range(crash_size, CRASH_ALIGN,
> a7259df7670240 Mike Rapoport   2021-09-02  1019  						       CRASH_ALIGN, crash_max);
> 61603016e2122b Russell King    2016-03-14  1020  		if (!crash_base) {
> 61603016e2122b Russell King    2016-03-14  1021  			pr_err("crashkernel reservation failed - No suitable area found.\n");
> 61603016e2122b Russell King    2016-03-14  1022  			return;
> 61603016e2122b Russell King    2016-03-14  1023  		}
> 61603016e2122b Russell King    2016-03-14  1024  	} else {
> a7259df7670240 Mike Rapoport   2021-09-02  1025  		unsigned long long crash_max = crash_base + crash_size;
> 61603016e2122b Russell King    2016-03-14  1026  		unsigned long long start;
> 61603016e2122b Russell King    2016-03-14  1027  
> a7259df7670240 Mike Rapoport   2021-09-02 @1028  		start = memblock_phys_alloc_range(crash_size, SECTION_SIZE,
> a7259df7670240 Mike Rapoport   2021-09-02  1029  						  crash_base, crash_max);
> a7259df7670240 Mike Rapoport   2021-09-02  1030  		if (!start) {
> 61603016e2122b Russell King    2016-03-14  1031  			pr_err("crashkernel reservation failed - memory is in use.\n");
> 61603016e2122b Russell King    2016-03-14  1032  			return;
> 61603016e2122b Russell King    2016-03-14  1033  		}
> 61603016e2122b Russell King    2016-03-14  1034  	}
> 61603016e2122b Russell King    2016-03-14  1035  
> 1b0f6681fcbc0e Olof Johansson  2013-12-05  1036  	pr_info("Reserving %ldMB of memory at %ldMB for crashkernel (System RAM: %ldMB)\n",
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1037  		(unsigned long)(crash_size >> 20),
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1038  		(unsigned long)(crash_base >> 20),
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1039  		(unsigned long)(total_mem >> 20));
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1040  
> f7f0b7dc720f81 Russell King    2016-08-02  1041  	/* The crashk resource must always be located in normal mem */
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1042  	crashk_res.start = crash_base;
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1043  	crashk_res.end = crash_base + crash_size - 1;
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1044  	insert_resource(&iomem_resource, &crashk_res);
> f7f0b7dc720f81 Russell King    2016-08-02  1045  
> f7f0b7dc720f81 Russell King    2016-08-02  1046  	if (arm_has_idmap_alias()) {
> f7f0b7dc720f81 Russell King    2016-08-02  1047  		/*
> f7f0b7dc720f81 Russell King    2016-08-02  1048  		 * If we have a special RAM alias for use at boot, we
> f7f0b7dc720f81 Russell King    2016-08-02  1049  		 * need to advertise to kexec tools where the alias is.
> f7f0b7dc720f81 Russell King    2016-08-02  1050  		 */
> f7f0b7dc720f81 Russell King    2016-08-02  1051  		static struct resource crashk_boot_res = {
> f7f0b7dc720f81 Russell King    2016-08-02  1052  			.name = "Crash kernel (boot alias)",
> f7f0b7dc720f81 Russell King    2016-08-02  1053  			.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
> f7f0b7dc720f81 Russell King    2016-08-02  1054  		};
> f7f0b7dc720f81 Russell King    2016-08-02  1055  
> f7f0b7dc720f81 Russell King    2016-08-02  1056  		crashk_boot_res.start = phys_to_idmap(crash_base);
> f7f0b7dc720f81 Russell King    2016-08-02  1057  		crashk_boot_res.end = crashk_boot_res.start + crash_size - 1;
> f7f0b7dc720f81 Russell King    2016-08-02  1058  		insert_resource(&iomem_resource, &crashk_boot_res);
> f7f0b7dc720f81 Russell King    2016-08-02  1059  	}
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1060  }
> 3c57fb43c8fcbe Mika Westerberg 2010-05-10  1061  
> 
> :::::: The code at line 1028 was first introduced by commit
> :::::: a7259df7670240ee03b0cfce8a3e5d3773911e24 memblock: make memblock_find_in_range method private
> 
> :::::: TO: Mike Rapoport <rppt@xxxxxxxxxxxxx>
> :::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux