[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202202010807.z1MJQYQ1-lkp@intel.com>
Date: Tue, 1 Feb 2022 08:32:35 +0800
From: kernel test robot <lkp@...el.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>
Subject: arch/x86/kvm/x86.c:4342:31: sparse: sparse: incorrect type in return
expression (different address spaces)
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@...el.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
Powered by blists - more mailing lists