arch/powerpc/platforms/powernv/opal-fadump.c:72:58: sparse: expected restricted __be64 src
From: kernel test robot
Date: Sat Aug 08 2020 - 10:50:16 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 449dc8c97089a6e09fb2dac4d92b1b7ac0eb7c1e
commit: 51bba8edef90cf579dba16de912d3ef809fe1d77 powerpc/fadump: support copying multiple kernel boot memory regions
date: 11 months ago
config: powerpc64-randconfig-s032-20200808 (attached as .config)
compiler: powerpc64-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.2-118-ge1578773-dirty
git checkout 51bba8edef90cf579dba16de912d3ef809fe1d77
# 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__' ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
sparse warnings: (new ones prefixed by >>)
arch/powerpc/platforms/powernv/opal-fadump.c:35:41: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] boot_mem_dest_addr @@ got restricted __be64 const [usertype] dest @@
arch/powerpc/platforms/powernv/opal-fadump.c:35:41: sparse: expected unsigned long long [usertype] boot_mem_dest_addr
arch/powerpc/platforms/powernv/opal-fadump.c:35:41: sparse: got restricted __be64 const [usertype] dest
arch/powerpc/platforms/powernv/opal-fadump.c:72:58: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be64 [usertype] src @@ got unsigned long long [assigned] [usertype] src_addr @@
>> arch/powerpc/platforms/powernv/opal-fadump.c:72:58: sparse: expected restricted __be64 [usertype] src
arch/powerpc/platforms/powernv/opal-fadump.c:72:58: sparse: got unsigned long long [assigned] [usertype] src_addr
arch/powerpc/platforms/powernv/opal-fadump.c:73:58: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be64 [usertype] dest @@ got unsigned long long [assigned] [usertype] dest_addr @@
arch/powerpc/platforms/powernv/opal-fadump.c:73:58: sparse: expected restricted __be64 [usertype] dest
arch/powerpc/platforms/powernv/opal-fadump.c:73:58: sparse: got unsigned long long [assigned] [usertype] dest_addr
arch/powerpc/platforms/powernv/opal-fadump.c:74:58: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be64 [usertype] size @@ got int [assigned] cur_size @@
arch/powerpc/platforms/powernv/opal-fadump.c:74:58: sparse: expected restricted __be64 [usertype] size
arch/powerpc/platforms/powernv/opal-fadump.c:74:58: sparse: got int [assigned] cur_size
arch/powerpc/platforms/powernv/opal-fadump.c:86:53: sparse: sparse: restricted __be64 degrades to integer
arch/powerpc/platforms/powernv/opal-fadump.c:138:56: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned long long [usertype] src @@ got restricted __be64 [usertype] src @@
arch/powerpc/platforms/powernv/opal-fadump.c:138:56: sparse: expected unsigned long long [usertype] src
arch/powerpc/platforms/powernv/opal-fadump.c:138:56: sparse: got restricted __be64 [usertype] src
arch/powerpc/platforms/powernv/opal-fadump.c:139:56: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned long long [usertype] dest @@ got restricted __be64 [usertype] dest @@
arch/powerpc/platforms/powernv/opal-fadump.c:139:56: sparse: expected unsigned long long [usertype] dest
arch/powerpc/platforms/powernv/opal-fadump.c:139:56: sparse: got restricted __be64 [usertype] dest
arch/powerpc/platforms/powernv/opal-fadump.c:140:56: sparse: sparse: incorrect type in argument 4 (different base types) @@ expected unsigned long long [usertype] size @@ got restricted __be64 [usertype] size @@
arch/powerpc/platforms/powernv/opal-fadump.c:140:56: sparse: expected unsigned long long [usertype] size
arch/powerpc/platforms/powernv/opal-fadump.c:140:56: sparse: got restricted __be64 [usertype] size
vim +72 arch/powerpc/platforms/powernv/opal-fadump.c
50
51 static u64 opal_fadump_init_mem_struct(struct fw_dump *fadump_conf)
52 {
53 int max_copy_size, cur_size, size;
54 u64 src_addr, dest_addr;
55
56 opal_fdm = __va(fadump_conf->kernel_metadata);
57 opal_fadump_init_metadata(opal_fdm);
58
59 /*
60 * Firmware supports 32-bit field for size. Align it to PAGE_SIZE
61 * and request firmware to copy multiple kernel boot memory regions.
62 */
63 max_copy_size = _ALIGN_DOWN(U32_MAX, PAGE_SIZE);
64
65 /* Boot memory regions */
66 src_addr = 0;
67 dest_addr = fadump_conf->reserve_dump_area_start;
68 size = fadump_conf->boot_memory_size;
69 while (size) {
70 cur_size = size > max_copy_size ? max_copy_size : size;
71
> 72 opal_fdm->rgn[opal_fdm->region_cnt].src = src_addr;
73 opal_fdm->rgn[opal_fdm->region_cnt].dest = dest_addr;
74 opal_fdm->rgn[opal_fdm->region_cnt].size = cur_size;
75
76 opal_fdm->region_cnt++;
77 dest_addr += cur_size;
78 src_addr += cur_size;
79 size -= cur_size;
80 }
81
82 /*
83 * Kernel metadata is passed to f/w and retrieved in capture kerenl.
84 * So, use it to save fadump header address instead of calculating it.
85 */
86 opal_fdm->fadumphdr_addr = (opal_fdm->rgn[0].dest +
87 fadump_conf->boot_memory_size);
88
89 opal_fadump_update_config(fadump_conf, opal_fdm);
90
91 return dest_addr;
92 }
93
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip