kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kbuild-all@lists.01.org, kvm@vger.kernel.org,
	Robert Hu <robert.hu@intel.com>,
	Farrah Chen <farrah.chen@intel.com>,
	Danmei Wei <danmei.wei@intel.com>
Subject: [kvm:queue 305/328] arch/x86/kvm/x86.c:4345:32: warning: cast to pointer from integer of different size
Date: Thu, 27 Jan 2022 09:52:03 +0800	[thread overview]
Message-ID: <202201270930.LTyNaecg-lkp@intel.com> (raw)

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

             reply	other threads:[~2022-01-27  1:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27  1:52 kernel test robot [this message]
2022-01-27  8:08 ` [kvm:queue 305/328] arch/x86/kvm/x86.c:4345:32: warning: cast to pointer from integer of different size Like Xu
2022-01-27  8:09   ` Paolo Bonzini
2022-01-27 11:39     ` Paolo Bonzini

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=202201270930.LTyNaecg-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=danmei.wei@intel.com \
    --cc=farrah.chen@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=robert.hu@intel.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;
as well as URLs for NNTP newsgroup(s).