All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm:queue 305/328] arch/x86/kvm/x86.c:4345:32: warning: cast to pointer from integer of different size
@ 2022-01-27  1:52 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2022-01-27  1:52 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kbuild-all, kvm, Robert Hu, Farrah Chen, Danmei Wei

tree:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
head:   b029c138e8f090f5cb9ba77ef20509f903ef0004
commit: db9556a4eb6b43313cee57abcbbbad01f2708baa [305/328] KVM: x86: add system attribute to retrieve full set of supported xsave states
config: i386-randconfig-a003 (https://download.01.org/0day-ci/archive/20220127/202201270930.LTyNaecg-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/virt/kvm/kvm.git/commit/?id=db9556a4eb6b43313cee57abcbbbad01f2708baa
        git remote add kvm https://git.kernel.org/pub/scm/virt/kvm/kvm.git
        git fetch --no-tags kvm queue
        git checkout db9556a4eb6b43313cee57abcbbbad01f2708baa
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/uaccess.h:11,
                    from include/linux/sched/task.h:11,
                    from include/linux/sched/signal.h:9,
                    from include/linux/rcuwait.h:6,
                    from include/linux/percpu-rwsem.h:7,
                    from include/linux/fs.h:33,
                    from include/linux/huge_mm.h:8,
                    from include/linux/mm.h:717,
                    from include/linux/kvm_host.h:16,
                    from arch/x86/kvm/x86.c:19:
   arch/x86/kvm/x86.c: In function 'kvm_x86_dev_get_attr':
>> arch/x86/kvm/x86.c:4345:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    4345 |   if (put_user(supported_xcr0, (u64 __user *)attr->addr))
         |                                ^
   arch/x86/include/asm/uaccess.h:221:24: note: in definition of macro 'do_put_user_call'
     221 |  register __typeof__(*(ptr)) __val_pu asm("%"_ASM_AX);  \
         |                        ^~~
   arch/x86/kvm/x86.c:4345:7: note: in expansion of macro 'put_user'
    4345 |   if (put_user(supported_xcr0, (u64 __user *)attr->addr))
         |       ^~~~~~~~
>> arch/x86/kvm/x86.c:4345:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    4345 |   if (put_user(supported_xcr0, (u64 __user *)attr->addr))
         |                                ^
   arch/x86/include/asm/uaccess.h:223:14: note: in definition of macro 'do_put_user_call'
     223 |  __ptr_pu = (ptr);      \
         |              ^~~
   arch/x86/kvm/x86.c:4345:7: note: in expansion of macro 'put_user'
    4345 |   if (put_user(supported_xcr0, (u64 __user *)attr->addr))
         |       ^~~~~~~~
>> arch/x86/kvm/x86.c:4345:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    4345 |   if (put_user(supported_xcr0, (u64 __user *)attr->addr))
         |                                ^
   arch/x86/include/asm/uaccess.h:230:31: note: in definition of macro 'do_put_user_call'
     230 |          [size] "i" (sizeof(*(ptr)))   \
         |                               ^~~
   arch/x86/kvm/x86.c:4345:7: note: in expansion of macro 'put_user'
    4345 |   if (put_user(supported_xcr0, (u64 __user *)attr->addr))
         |       ^~~~~~~~


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

  4337	
  4338	static int kvm_x86_dev_get_attr(struct kvm_device_attr *attr)
  4339	{
  4340		if (attr->group)
  4341			return -ENXIO;
  4342	
  4343		switch (attr->attr) {
  4344		case KVM_X86_XCOMP_GUEST_SUPP:
> 4345			if (put_user(supported_xcr0, (u64 __user *)attr->addr))
  4346				return -EFAULT;
  4347			return 0;
  4348		default:
  4349			return -ENXIO;
  4350			break;
  4351		}
  4352	}
  4353	

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-01-27 11:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-27  1:52 [kvm:queue 305/328] arch/x86/kvm/x86.c:4345:32: warning: cast to pointer from integer of different size kernel test robot
2022-01-27  1:52 ` kernel test robot
2022-01-27  8:08 ` Like Xu
2022-01-27  8:08   ` Like Xu
2022-01-27  8:09   ` Paolo Bonzini
2022-01-27  8:09     ` Paolo Bonzini
2022-01-27 11:39     ` Paolo Bonzini
2022-01-27 11:39       ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.