mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: arch/x86/kvm/../../../virt/kvm/guest_memfd.c:540:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
Date: Sun, 1 Dec 2024 17:29:50 +0800	[thread overview]
Message-ID: <202412011712.1CoGhyrO-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   bcc8eda6d34934d80b96adb8dc4ff5dfc632a53a
commit: 17573fd971f9e31ddee420eca8359ceff87e9e51 KVM: guest_memfd: extract __kvm_gmem_get_pfn()
date:   7 months ago
config: x86_64-randconfig-122-20241116 (https://download.01.org/0day-ci/archive/20241201/202412011712.1CoGhyrO-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241201/202412011712.1CoGhyrO-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412011712.1CoGhyrO-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> arch/x86/kvm/../../../virt/kvm/guest_memfd.c:540:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c:540:18: sparse:    struct file *
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c:540:18: sparse:    struct file [noderef] __rcu *
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c:121:17: sparse: sparse: context imbalance in 'kvm_gmem_invalidate_begin' - different lock contexts for basic block
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c: note: in included file (through include/linux/wait.h, include/linux/wait_bit.h, include/linux/fs.h, ...):
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c:293:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct file **f @@     got struct file [noderef] __rcu ** @@
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c:293:33: sparse:     expected struct file **f
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c:293:33: sparse:     got struct file [noderef] __rcu **
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c:293:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct file **f @@     got struct file [noderef] __rcu ** @@
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c:293:33: sparse:     expected struct file **f
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c:293:33: sparse:     got struct file [noderef] __rcu **

vim +540 arch/x86/kvm/../../../virt/kvm/guest_memfd.c

   530	
   531	static int __kvm_gmem_get_pfn(struct file *file, struct kvm_memory_slot *slot,
   532			       gfn_t gfn, kvm_pfn_t *pfn, int *max_order, bool prepare)
   533	{
   534		pgoff_t index = gfn - slot->base_gfn + slot->gmem.pgoff;
   535		struct kvm_gmem *gmem = file->private_data;
   536		struct folio *folio;
   537		struct page *page;
   538		int r;
   539	
 > 540		if (file != slot->gmem.file) {
   541			WARN_ON_ONCE(slot->gmem.file);
   542			return -EFAULT;
   543		}
   544	
   545		gmem = file->private_data;
   546		if (xa_load(&gmem->bindings, index) != slot) {
   547			WARN_ON_ONCE(xa_load(&gmem->bindings, index));
   548			return -EIO;
   549		}
   550	
   551		folio = kvm_gmem_get_folio(file_inode(file), index, prepare);
   552		if (IS_ERR(folio))
   553			return PTR_ERR(folio);
   554	
   555		if (folio_test_hwpoison(folio)) {
   556			r = -EHWPOISON;
   557			goto out_unlock;
   558		}
   559	
   560		page = folio_file_page(folio, index);
   561	
   562		*pfn = page_to_pfn(page);
   563		if (max_order)
   564			*max_order = 0;
   565	
   566		r = 0;
   567	
   568	out_unlock:
   569		folio_unlock(folio);
   570	
   571		return r;
   572	}
   573	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2024-12-01  9:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-01  9:29 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-11-17 14:05 kernel test robot

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=202412011712.1CoGhyrO-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pbonzini@redhat.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®