[PATCH] arm64: kexec: add support for kexec with spin-table

kernel test robot lkp at intel.com
Wed Jul 14 15:29:02 PDT 2021


Hi Henry,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on v5.14-rc1 next-20210714]
[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]

url:    https://github.com/0day-ci/linux/commits/Henry-Willard/arm64-kexec-add-support-for-kexec-with-spin-table/20210715-014204
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: arm64-randconfig-s031-20210714 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/3dd4112e1b67732182a5e12891867db4e139980c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Henry-Willard/arm64-kexec-add-support-for-kexec-with-spin-table/20210715-014204
        git checkout 3dd4112e1b67732182a5e12891867db4e139980c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/kernel/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>


sparse warnings: (new ones prefixed by >>)
>> arch/arm64/kernel/smp_spin_table.c:179:28: sparse: sparse: cast removes address space '__iomem' of expression

vim +/__iomem +179 arch/arm64/kernel/smp_spin_table.c

   132	
   133	
   134	/*
   135	 * There is a four instruction loop set aside in protected
   136	 * memory by u-boot where secondary CPUs wait for the kernel to
   137	 * start.
   138	 *
   139	 * 0:       wfe
   140	 *          ldr    x0, spin_table_cpu_release_addr
   141	 *          cbz    x0, 0b
   142	 *          br     x0
   143	 * spin_table_cpu_release_addr:
   144	 *          .quad  0
   145	 *
   146	 * The address of spin_table_cpu_release_addr is passed in the
   147	 * "release-address" property in the device table.
   148	 * smp_spin_table_cpu_prepare() stores the real address of
   149	 * secondary_holding_pen() where the secondary CPUs loop
   150	 * until they are released one at a time by smp_spin_table_cpu_boot().
   151	 * We reuse the spin-table loop by clearing spin_table_cpu_release_addr,
   152	 * and branching to the beginning of the loop via cpu_soft_restart(),
   153	 * which turns off the MMU and caching.
   154	 */
   155	static void smp_spin_table_cpu_die(unsigned int cpu)
   156	{
   157		__le64 __iomem *release_addr;
   158		unsigned int *spin_table_inst;
   159		unsigned long spin_table_start;
   160	
   161		if (!cpu_release_addr[cpu])
   162			goto spin;
   163	
   164		spin_table_start = (cpu_release_addr[cpu] - sizeof(spin_table_loop));
   165	
   166		/*
   167		 * The cpu-release-addr may or may not be inside the linear mapping.
   168		 * As ioremap_cache will either give us a new mapping or reuse the
   169		 * existing linear mapping, we can use it to cover both cases. In
   170		 * either case the memory will be MT_NORMAL.
   171		 */
   172		release_addr = ioremap_cache(spin_table_start,
   173					sizeof(*release_addr) +
   174					sizeof(spin_table_loop));
   175	
   176		if (!release_addr)
   177			goto spin;
   178	
 > 179		spin_table_inst = (unsigned int *)release_addr;
   180		if (spin_table_inst[0] != spin_table_loop[0] ||
   181			spin_table_inst[1] != spin_table_loop[1] ||
   182			spin_table_inst[2] != spin_table_loop[2] ||
   183			spin_table_inst[3] != spin_table_loop[3])
   184			goto spin;
   185	
   186		/*
   187		 * Clear the release address, so that we can use it again
   188		 */
   189		writeq_relaxed(0, release_addr + 2);
   190		dcache_clean_inval_poc((__force unsigned long)(release_addr + 2),
   191				(__force unsigned long)(release_addr + 2) +
   192					    sizeof(*release_addr));
   193	
   194		iounmap(release_addr);
   195	
   196		local_daif_mask();
   197		cpu_soft_restart(spin_table_start, 0, 0, 0);
   198	
   199		BUG();  /* Should never get here */
   200	
   201	spin:
   202		cpu_park_loop();
   203	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 32250 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210715/b8ae27e9/attachment-0001.gz>


More information about the linux-arm-kernel mailing list