[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202202152150.EZ8yJDzm-lkp@intel.com>
Date: Tue, 15 Feb 2022 21:16:16 +0800
From: kernel test robot <lkp@...el.com>
To: Deepak Kumar Singh <quic_deesin@...cinc.com>,
bjorn.andersson@...aro.org, quic_clew@...cinc.com,
mathieu.poirier@...aro.org
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
linux-arm-msm@...r.kernel.org, linux-remoteproc@...r.kernel.org,
Deepak Kumar Singh <quic_deesin@...cinc.com>,
Andy Gross <agross@...nel.org>
Subject: Re: [PATCH V4 2/2] soc: qcom: smem: validate fields of shared
structures
Hi Deepak,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.17-rc4 next-20220215]
[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/Deepak-Kumar-Singh/soc-qcom-smem-map-only-partitions-used-by-local-HOST/20220214-224750
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 754e0b0e35608ed5206d6a67a791563c631cec07
config: openrisc-randconfig-s031-20220214 (https://download.01.org/0day-ci/archive/20220215/202202152150.EZ8yJDzm-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 11.2.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.4-dirty
# https://github.com/0day-ci/linux/commit/cfc33be784b2bfdafba0ae278dfbf92bdd9111da
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Deepak-Kumar-Singh/soc-qcom-smem-map-only-partitions-used-by-local-HOST/20220214-224750
git checkout cfc33be784b2bfdafba0ae278dfbf92bdd9111da
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=openrisc SHELL=/bin/bash drivers/soc/qcom/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
drivers/soc/qcom/smem.c:430:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct smem_header *header @@ got void [noderef] __iomem *virt_base @@
drivers/soc/qcom/smem.c:430:16: sparse: expected struct smem_header *header
drivers/soc/qcom/smem.c:430:16: sparse: got void [noderef] __iomem *virt_base
drivers/soc/qcom/smem.c:517:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct smem_header *header @@ got void [noderef] __iomem *virt_base @@
drivers/soc/qcom/smem.c:517:16: sparse: expected struct smem_header *header
drivers/soc/qcom/smem.c:517:16: sparse: got void [noderef] __iomem *virt_base
drivers/soc/qcom/smem.c:534:50: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void * @@ got void [noderef] __iomem * @@
drivers/soc/qcom/smem.c:534:50: sparse: expected void *
drivers/soc/qcom/smem.c:534:50: sparse: got void [noderef] __iomem *
>> drivers/soc/qcom/smem.c:695:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct smem_partition_header *phdr @@ got void [noderef] __iomem *virt_base @@
drivers/soc/qcom/smem.c:695:22: sparse: expected struct smem_partition_header *phdr
drivers/soc/qcom/smem.c:695:22: sparse: got void [noderef] __iomem *virt_base
>> drivers/soc/qcom/smem.c:699:27: sparse: sparse: cast to restricted __le32
>> drivers/soc/qcom/smem.c:699:27: sparse: sparse: cast to restricted __le32
>> drivers/soc/qcom/smem.c:699:27: sparse: sparse: cast to restricted __le32
>> drivers/soc/qcom/smem.c:699:27: sparse: sparse: cast to restricted __le32
>> drivers/soc/qcom/smem.c:699:27: sparse: sparse: cast to restricted __le32
>> drivers/soc/qcom/smem.c:699:27: sparse: sparse: cast to restricted __le32
drivers/soc/qcom/smem.c:703:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct smem_partition_header *phdr @@ got void [noderef] __iomem *virt_base @@
drivers/soc/qcom/smem.c:703:22: sparse: expected struct smem_partition_header *phdr
drivers/soc/qcom/smem.c:703:22: sparse: got void [noderef] __iomem *virt_base
drivers/soc/qcom/smem.c:707:27: sparse: sparse: cast to restricted __le32
drivers/soc/qcom/smem.c:707:27: sparse: sparse: cast to restricted __le32
drivers/soc/qcom/smem.c:707:27: sparse: sparse: cast to restricted __le32
drivers/soc/qcom/smem.c:707:27: sparse: sparse: cast to restricted __le32
drivers/soc/qcom/smem.c:707:27: sparse: sparse: cast to restricted __le32
drivers/soc/qcom/smem.c:707:27: sparse: sparse: cast to restricted __le32
drivers/soc/qcom/smem.c:710:24: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct smem_header *header @@ got void [noderef] __iomem *virt_base @@
drivers/soc/qcom/smem.c:710:24: sparse: expected struct smem_header *header
drivers/soc/qcom/smem.c:710:24: sparse: got void [noderef] __iomem *virt_base
drivers/soc/qcom/smem.c:723:30: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/soc/qcom/smem.c:723:30: sparse: void *
drivers/soc/qcom/smem.c:723:30: sparse: void [noderef] __iomem *
drivers/soc/qcom/smem.c:744:36: sparse: sparse: subtraction of different types can't work (different address spaces)
drivers/soc/qcom/smem.c:753:28: sparse: sparse: subtraction of different types can't work (different address spaces)
drivers/soc/qcom/smem.c:762:36: sparse: sparse: subtraction of different types can't work (different address spaces)
drivers/soc/qcom/smem.c:777:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct smem_header *header @@ got void [noderef] __iomem *virt_base @@
drivers/soc/qcom/smem.c:777:16: sparse: expected struct smem_header *header
drivers/soc/qcom/smem.c:777:16: sparse: got void [noderef] __iomem *virt_base
drivers/soc/qcom/smem.c:810:57: sparse: sparse: restricted __le32 degrades to integer
drivers/soc/qcom/smem.c:831:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct smem_partition_header *header @@ got void [noderef] __iomem * @@
drivers/soc/qcom/smem.c:831:16: sparse: expected struct smem_partition_header *header
drivers/soc/qcom/smem.c:831:16: sparse: got void [noderef] __iomem *
drivers/soc/qcom/smem.c:982:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct smem_ptable *ptable @@ got void [noderef] __iomem * @@
drivers/soc/qcom/smem.c:982:22: sparse: expected struct smem_ptable *ptable
drivers/soc/qcom/smem.c:982:22: sparse: got void [noderef] __iomem *
drivers/soc/qcom/smem.c:1091:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct smem_header *header @@ got void [noderef] __iomem *virt_base @@
drivers/soc/qcom/smem.c:1091:16: sparse: expected struct smem_header *header
drivers/soc/qcom/smem.c:1091:16: sparse: got void [noderef] __iomem *virt_base
>> drivers/soc/qcom/smem.c:1112:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@
drivers/soc/qcom/smem.c:1112:31: sparse: expected void const volatile [noderef] __iomem *addr
drivers/soc/qcom/smem.c:1112:31: sparse: got restricted __le32 *
drivers/soc/qcom/smem.c:1112:67: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@
drivers/soc/qcom/smem.c:1112:67: sparse: expected void const volatile [noderef] __iomem *addr
drivers/soc/qcom/smem.c:1112:67: sparse: got restricted __le32 *
drivers/soc/qcom/smem.c: note: in included file (through arch/openrisc/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
vim +695 drivers/soc/qcom/smem.c
4b638df4c9d556 Bjorn Andersson 2015-06-26 675
4b638df4c9d556 Bjorn Andersson 2015-06-26 676 /**
4b638df4c9d556 Bjorn Andersson 2015-06-26 677 * qcom_smem_get_free_space() - retrieve amount of free space in a partition
4b638df4c9d556 Bjorn Andersson 2015-06-26 678 * @host: the remote processor identifying a partition, or -1
4b638df4c9d556 Bjorn Andersson 2015-06-26 679 *
4b638df4c9d556 Bjorn Andersson 2015-06-26 680 * To be used by smem clients as a quick way to determine if any new
4b638df4c9d556 Bjorn Andersson 2015-06-26 681 * allocations has been made.
4b638df4c9d556 Bjorn Andersson 2015-06-26 682 */
4b638df4c9d556 Bjorn Andersson 2015-06-26 683 int qcom_smem_get_free_space(unsigned host)
4b638df4c9d556 Bjorn Andersson 2015-06-26 684 {
70716a4ee6c89c Deepak Kumar Singh 2022-02-14 685 struct smem_partition *part;
4b638df4c9d556 Bjorn Andersson 2015-06-26 686 struct smem_partition_header *phdr;
4b638df4c9d556 Bjorn Andersson 2015-06-26 687 struct smem_header *header;
4b638df4c9d556 Bjorn Andersson 2015-06-26 688 unsigned ret;
4b638df4c9d556 Bjorn Andersson 2015-06-26 689
4b638df4c9d556 Bjorn Andersson 2015-06-26 690 if (!__smem)
4b638df4c9d556 Bjorn Andersson 2015-06-26 691 return -EPROBE_DEFER;
4b638df4c9d556 Bjorn Andersson 2015-06-26 692
70716a4ee6c89c Deepak Kumar Singh 2022-02-14 693 if (host < SMEM_HOST_COUNT && __smem->partitions[host].virt_base) {
70716a4ee6c89c Deepak Kumar Singh 2022-02-14 694 part = &__smem->partitions[host];
70716a4ee6c89c Deepak Kumar Singh 2022-02-14 @695 phdr = part->virt_base;
9806884d8cd552 Stephen Boyd 2015-09-02 696 ret = le32_to_cpu(phdr->offset_free_cached) -
9806884d8cd552 Stephen Boyd 2015-09-02 697 le32_to_cpu(phdr->offset_free_uncached);
cfc33be784b2bf Deepak Kumar Singh 2022-02-14 698
cfc33be784b2bf Deepak Kumar Singh 2022-02-14 @699 if (ret > le32_to_cpu(part->size))
cfc33be784b2bf Deepak Kumar Singh 2022-02-14 700 return -EINVAL;
70716a4ee6c89c Deepak Kumar Singh 2022-02-14 701 } else if (__smem->global_partition.virt_base) {
70716a4ee6c89c Deepak Kumar Singh 2022-02-14 702 part = &__smem->global_partition;
70716a4ee6c89c Deepak Kumar Singh 2022-02-14 703 phdr = part->virt_base;
d52e404874369f Chris Lew 2017-10-11 704 ret = le32_to_cpu(phdr->offset_free_cached) -
d52e404874369f Chris Lew 2017-10-11 705 le32_to_cpu(phdr->offset_free_uncached);
cfc33be784b2bf Deepak Kumar Singh 2022-02-14 706
cfc33be784b2bf Deepak Kumar Singh 2022-02-14 707 if (ret > le32_to_cpu(part->size))
cfc33be784b2bf Deepak Kumar Singh 2022-02-14 708 return -EINVAL;
4b638df4c9d556 Bjorn Andersson 2015-06-26 709 } else {
4b638df4c9d556 Bjorn Andersson 2015-06-26 710 header = __smem->regions[0].virt_base;
9806884d8cd552 Stephen Boyd 2015-09-02 711 ret = le32_to_cpu(header->available);
cfc33be784b2bf Deepak Kumar Singh 2022-02-14 712
cfc33be784b2bf Deepak Kumar Singh 2022-02-14 713 if (ret > __smem->regions[0].size)
cfc33be784b2bf Deepak Kumar Singh 2022-02-14 714 return -EINVAL;
4b638df4c9d556 Bjorn Andersson 2015-06-26 715 }
4b638df4c9d556 Bjorn Andersson 2015-06-26 716
4b638df4c9d556 Bjorn Andersson 2015-06-26 717 return ret;
4b638df4c9d556 Bjorn Andersson 2015-06-26 718 }
4b638df4c9d556 Bjorn Andersson 2015-06-26 719 EXPORT_SYMBOL(qcom_smem_get_free_space);
4b638df4c9d556 Bjorn Andersson 2015-06-26 720
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Powered by blists - more mailing lists