linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Deepak Kumar Singh <deesin@codeaurora.org>,
	bjorn.andersson@linaro.org, clew@codeaurora.org
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
	Deepak Kumar Singh <deesin@codeaurora.org>,
	Andy Gross <agross@kernel.org>
Subject: Re: [PATCH V2 1/2] soc: qcom: smem: map only partitions used by local HOST
Date: Fri, 9 Jul 2021 07:17:58 +0800	[thread overview]
Message-ID: <202107090738.RRQ55Dl1-lkp@intel.com> (raw)
In-Reply-To: <1625763502-22806-2-git-send-email-deesin@codeaurora.org>

[-- Attachment #1: Type: text/plain, Size: 9212 bytes --]

Hi Deepak,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.13 next-20210708]
[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/smem-partition-remap-and-bound-check-changes/20210709-010025
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e9f1cbc0c4114880090c7a578117d3b9cf184ad4
config: x86_64-randconfig-s021-20210707 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/33e2ecba1aca3061ac33cb9665f417a76902abaa
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Deepak-Kumar-Singh/smem-partition-remap-and-bound-check-changes/20210709-010025
        git checkout 33e2ecba1aca3061ac33cb9665f417a76902abaa
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

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


sparse warnings: (new ones prefixed by >>)
>> drivers/soc/qcom/smem.c:370:14: 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:370:14: sparse:     expected struct smem_partition_header *phdr
   drivers/soc/qcom/smem.c:370:14: sparse:     got void [noderef] __iomem *virt_base
   drivers/soc/qcom/smem.c:421: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:421:16: sparse:     expected struct smem_header *header
   drivers/soc/qcom/smem.c:421:16: sparse:     got void [noderef] __iomem *virt_base
   drivers/soc/qcom/smem.c:506: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:506:16: sparse:     expected struct smem_header *header
   drivers/soc/qcom/smem.c:506:16: sparse:     got void [noderef] __iomem *virt_base
   drivers/soc/qcom/smem.c:519:50: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void * @@     got void [noderef] __iomem * @@
   drivers/soc/qcom/smem.c:519:50: sparse:     expected void *
   drivers/soc/qcom/smem.c:519:50: sparse:     got void [noderef] __iomem *
   drivers/soc/qcom/smem.c:534:14: 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:534:14: sparse:     expected struct smem_partition_header *phdr
   drivers/soc/qcom/smem.c:534:14: sparse:     got void [noderef] __iomem *virt_base
   drivers/soc/qcom/smem.c:647: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:647:22: sparse:     expected struct smem_partition_header *phdr
   drivers/soc/qcom/smem.c:647:22: sparse:     got void [noderef] __iomem *virt_base
   drivers/soc/qcom/smem.c:652: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:652:22: sparse:     expected struct smem_partition_header *phdr
   drivers/soc/qcom/smem.c:652:22: sparse:     got void [noderef] __iomem *virt_base
   drivers/soc/qcom/smem.c:656: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:656:24: sparse:     expected struct smem_header *header
   drivers/soc/qcom/smem.c:656:24: sparse:     got void [noderef] __iomem *virt_base
   drivers/soc/qcom/smem.c:666:30: sparse: sparse: incompatible types in comparison expression (different address spaces):
   drivers/soc/qcom/smem.c:666:30: sparse:    void *
   drivers/soc/qcom/smem.c:666:30: sparse:    void [noderef] __iomem *
   drivers/soc/qcom/smem.c:687:36: sparse: sparse: subtraction of different types can't work (different address spaces)
   drivers/soc/qcom/smem.c:696:28: sparse: sparse: subtraction of different types can't work (different address spaces)
   drivers/soc/qcom/smem.c:705:36: sparse: sparse: subtraction of different types can't work (different address spaces)
   drivers/soc/qcom/smem.c:720: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:720:16: sparse:     expected struct smem_header *header
   drivers/soc/qcom/smem.c:720:16: sparse:     got void [noderef] __iomem *virt_base
   drivers/soc/qcom/smem.c:753:57: sparse: sparse: restricted __le32 degrades to integer
   drivers/soc/qcom/smem.c:774: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:774:16: sparse:     expected struct smem_partition_header *header
   drivers/soc/qcom/smem.c:774:16: sparse:     got void [noderef] __iomem *
   drivers/soc/qcom/smem.c:971:22: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct smem_ptable *ptable @@     got void [noderef] __iomem * @@
   drivers/soc/qcom/smem.c:971:22: sparse:     expected struct smem_ptable *ptable
   drivers/soc/qcom/smem.c:971:22: sparse:     got void [noderef] __iomem *
   drivers/soc/qcom/smem.c:986: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:986:16: sparse:     expected struct smem_header *header
   drivers/soc/qcom/smem.c:986:16: sparse:     got void [noderef] __iomem *virt_base
>> drivers/soc/qcom/smem.c:987:14: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] size @@     got restricted __le32 [usertype] available @@
   drivers/soc/qcom/smem.c:987:14: sparse:     expected unsigned int [usertype] size
   drivers/soc/qcom/smem.c:987:14: sparse:     got restricted __le32 [usertype] available
   drivers/soc/qcom/smem.c:1028: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:1028:16: sparse:     expected struct smem_header *header
   drivers/soc/qcom/smem.c:1028:16: sparse:     got void [noderef] __iomem *virt_base

vim +370 drivers/soc/qcom/smem.c

   359	
   360	static int qcom_smem_alloc_private(struct qcom_smem *smem,
   361					   struct smem_partition *part,
   362					   unsigned item,
   363					   size_t size)
   364	{
   365		struct smem_private_entry *hdr, *end;
   366		struct smem_partition_header *phdr;
   367		size_t alloc_size;
   368		void *cached;
   369	
 > 370		phdr = part->virt_base;
   371	
   372		hdr = phdr_to_first_uncached_entry(phdr);
   373		end = phdr_to_last_uncached_entry(phdr);
   374		cached = phdr_to_last_cached_entry(phdr);
   375	
   376		while (hdr < end) {
   377			if (hdr->canary != SMEM_PRIVATE_CANARY)
   378				goto bad_canary;
   379			if (le16_to_cpu(hdr->item) == item)
   380				return -EEXIST;
   381	
   382			hdr = uncached_entry_next(hdr);
   383		}
   384	
   385		/* Check that we don't grow into the cached region */
   386		alloc_size = sizeof(*hdr) + ALIGN(size, 8);
   387		if ((void *)hdr + alloc_size > cached) {
   388			dev_err(smem->dev, "Out of memory\n");
   389			return -ENOSPC;
   390		}
   391	
   392		hdr->canary = SMEM_PRIVATE_CANARY;
   393		hdr->item = cpu_to_le16(item);
   394		hdr->size = cpu_to_le32(ALIGN(size, 8));
   395		hdr->padding_data = cpu_to_le16(le32_to_cpu(hdr->size) - size);
   396		hdr->padding_hdr = 0;
   397	
   398		/*
   399		 * Ensure the header is written before we advance the free offset, so
   400		 * that remote processors that does not take the remote spinlock still
   401		 * gets a consistent view of the linked list.
   402		 */
   403		wmb();
   404		le32_add_cpu(&phdr->offset_free_uncached, alloc_size);
   405	
   406		return 0;
   407	bad_canary:
   408		dev_err(smem->dev, "Found invalid canary in hosts %hu:%hu partition\n",
   409			le16_to_cpu(phdr->host0), le16_to_cpu(phdr->host1));
   410	
   411		return -EINVAL;
   412	}
   413	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38793 bytes --]

  reply	other threads:[~2021-07-08 23:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 16:58 [PATCH V2 0/2] smem partition remap and bound check changes Deepak Kumar Singh
2021-07-08 16:58 ` [PATCH V2 1/2] soc: qcom: smem: map only partitions used by local HOST Deepak Kumar Singh
2021-07-08 23:17   ` kernel test robot [this message]
2021-07-08 16:58 ` [PATCH V2 2/2] soc: qcom: smem: validate fields of shared structures Deepak Kumar Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202107090738.RRQ55Dl1-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=clew@codeaurora.org \
    --cc=deesin@codeaurora.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --subject='Re: [PATCH V2 1/2] soc: qcom: smem: map only partitions used by local HOST' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).