linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* arch/x86/kvm/x86.c:4342:31: sparse: sparse: incorrect type in return expression (different address spaces)
@ 2022-02-01  0:32 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-02-01  0:32 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: kbuild-all, linux-kernel, Paolo Bonzini

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   26291c54e111ff6ba87a164d85d4a4e134b7315c
commit: 56f289a8d23addfa4408a08f07f42fcfe2a7bd69 KVM: x86: Add a helper to retrieve userspace address from kvm_device_attr
date:   4 days ago
config: x86_64-rhel-8.3-kselftests (https://download.01.org/0day-ci/archive/20220201/202202010807.z1MJQYQ1-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=56f289a8d23addfa4408a08f07f42fcfe2a7bd69
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 56f289a8d23addfa4408a08f07f42fcfe2a7bd69
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash

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 >>)
   arch/x86/kvm/x86.c:235:47: sparse: sparse: array of flexible structures
   arch/x86/kvm/x86.c: note: in included file:
   include/linux/kvm_host.h:1761:54: sparse: sparse: array of flexible structures
   arch/x86/kvm/x86.c:261:49: sparse: sparse: array of flexible structures
   include/linux/kvm_host.h:1763:56: sparse: sparse: array of flexible structures
   arch/x86/kvm/x86.c:2833:9: sparse: sparse: context imbalance in '__kvm_start_pvclock_update' - wrong count at exit
   arch/x86/kvm/x86.c:2844:13: sparse: sparse: context imbalance in 'kvm_end_pvclock_update' - unexpected unlock
>> arch/x86/kvm/x86.c:4342:31: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] __user * @@     got void * @@
   arch/x86/kvm/x86.c:4342:31: sparse:     expected void [noderef] __user *
   arch/x86/kvm/x86.c:4342:31: sparse:     got void *
>> arch/x86/kvm/x86.c:4342:31: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] __user * @@     got void * @@
   arch/x86/kvm/x86.c:4342:31: sparse:     expected void [noderef] __user *
   arch/x86/kvm/x86.c:4342:31: sparse:     got void *
   arch/x86/kvm/x86.c: note: in included file (through include/linux/notifier.h, arch/x86/include/asm/uprobes.h, include/linux/uprobes.h, ...):
   include/linux/srcu.h:188:9: sparse: sparse: context imbalance in 'vcpu_enter_guest' - unexpected unlock

vim +4342 arch/x86/kvm/x86.c

  4336	
  4337	static inline void __user *kvm_get_attr_addr(struct kvm_device_attr *attr)
  4338	{
  4339		void __user *uaddr = (void __user*)(unsigned long)attr->addr;
  4340	
  4341		if ((u64)(unsigned long)uaddr != attr->addr)
> 4342			return ERR_PTR(-EFAULT);
  4343		return uaddr;
  4344	}
  4345	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-01  0:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-01  0:32 arch/x86/kvm/x86.c:4342:31: sparse: sparse: incorrect type in return expression (different address spaces) kernel test robot

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).