lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202212021605.Iuu0Iz7l-lkp@intel.com>
Date:   Fri, 2 Dec 2022 17:01:03 +0800
From:   kernel test robot <lkp@...el.com>
To:     Shameer Kolothum <shameerali.kolothum.thodi@...wei.com>,
        kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     oe-kbuild-all@...ts.linux.dev, alex.williamson@...hat.com,
        jgg@...dia.com, yishaih@...dia.com, kevin.tian@...el.com,
        linuxarm@...wei.com, liulongfang@...wei.com,
        prime.zeng@...ilicon.com
Subject: Re: [PATCH 1/4] hisi_acc_vfio_pci: Add support for precopy IOCTL

Hi Shameer,

I love your patch! Yet something to improve:

[auto build test ERROR on awilliam-vfio/for-linus]
[also build test ERROR on linus/master v6.1-rc7 next-20221202]
[cannot apply to awilliam-vfio/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Shameer-Kolothum/hisi_acc_vfio_pci-Add-PRE_COPY-migration-feature-support/20221123-193542
base:   https://github.com/awilliam/linux-vfio.git for-linus
patch link:    https://lore.kernel.org/r/20221123113236.896-2-shameerali.kolothum.thodi%40huawei.com
patch subject: [PATCH 1/4] hisi_acc_vfio_pci: Add support for precopy IOCTL
config: arm64-allyesconfig
compiler: aarch64-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/7ac2dded048e6633c89d0e330dad983a81705eb2
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Shameer-Kolothum/hisi_acc_vfio_pci-Add-PRE_COPY-migration-feature-support/20221123-193542
        git checkout 7ac2dded048e6633c89d0e330dad983a81705eb2
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

   drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c: In function 'hisi_acc_vf_precopy_ioctl':
>> drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:777:34: error: storage size of 'info' isn't known
     777 |         struct vfio_precopy_info info;
         |                                  ^~~~
>> drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:781:20: error: 'VFIO_MIG_GET_PRECOPY_INFO' undeclared (first use in this function)
     781 |         if (cmd != VFIO_MIG_GET_PRECOPY_INFO)
         |                    ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:781:20: note: each undeclared identifier is reported only once for each function it appears in
   In file included from include/uapi/linux/posix_types.h:5,
                    from include/uapi/linux/types.h:14,
                    from include/linux/types.h:6,
                    from include/linux/kasan-checks.h:5,
                    from include/asm-generic/rwonce.h:26,
                    from arch/arm64/include/asm/rwonce.h:71,
                    from include/linux/compiler.h:246,
                    from include/linux/dev_printk.h:14,
                    from include/linux/device.h:15,
                    from drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:6:
   include/linux/stddef.h:16:33: error: invalid use of undefined type 'struct vfio_precopy_info'
      16 | #define offsetof(TYPE, MEMBER)  __builtin_offsetof(TYPE, MEMBER)
         |                                 ^~~~~~~~~~~~~~~~~~
   include/linux/stddef.h:33:10: note: in expansion of macro 'offsetof'
      33 |         (offsetof(TYPE, MEMBER) + sizeof_field(TYPE, MEMBER))
         |          ^~~~~~~~
   drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:784:17: note: in expansion of macro 'offsetofend'
     784 |         minsz = offsetofend(struct vfio_precopy_info, dirty_bytes);
         |                 ^~~~~~~~~~~
   include/linux/stddef.h:24:55: error: invalid use of undefined type 'struct vfio_precopy_info'
      24 | #define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
         |                                                       ^~
   include/linux/stddef.h:33:35: note: in expansion of macro 'sizeof_field'
      33 |         (offsetof(TYPE, MEMBER) + sizeof_field(TYPE, MEMBER))
         |                                   ^~~~~~~~~~~~
   drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:784:17: note: in expansion of macro 'offsetofend'
     784 |         minsz = offsetofend(struct vfio_precopy_info, dirty_bytes);
         |                 ^~~~~~~~~~~
   drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:792:41: error: 'VFIO_DEVICE_STATE_PRE_COPY' undeclared (first use in this function); did you mean 'VFIO_DEVICE_STATE_STOP_COPY'?
     792 |         if (hisi_acc_vdev->mig_state != VFIO_DEVICE_STATE_PRE_COPY) {
         |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
         |                                         VFIO_DEVICE_STATE_STOP_COPY
   drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:777:34: warning: unused variable 'info' [-Wunused-variable]
     777 |         struct vfio_precopy_info info;
         |                                  ^~~~


vim +777 drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c

   770	
   771	static long hisi_acc_vf_precopy_ioctl(struct file *filp,
   772					      unsigned int cmd, unsigned long arg)
   773	{
   774		struct hisi_acc_vf_migration_file *migf = filp->private_data;
   775		struct hisi_acc_vf_core_device *hisi_acc_vdev = migf->hisi_acc_vdev;
   776		loff_t *pos = &filp->f_pos;
 > 777		struct vfio_precopy_info info;
   778		unsigned long minsz;
   779		int ret;
   780	
 > 781		if (cmd != VFIO_MIG_GET_PRECOPY_INFO)
   782			return -ENOTTY;
   783	
   784		minsz = offsetofend(struct vfio_precopy_info, dirty_bytes);
   785	
   786		if (copy_from_user(&info, (void __user *)arg, minsz))
   787			return -EFAULT;
   788		if (info.argsz < minsz)
   789			return -EINVAL;
   790	
   791		mutex_lock(&hisi_acc_vdev->state_mutex);
   792		if (hisi_acc_vdev->mig_state != VFIO_DEVICE_STATE_PRE_COPY) {
   793			mutex_unlock(&hisi_acc_vdev->state_mutex);
   794			return -EINVAL;
   795		}
   796	
   797		mutex_lock(&migf->lock);
   798	
   799		if (migf->disabled) {
   800			ret = -ENODEV;
   801			goto out;
   802		}
   803	
   804		if (*pos > migf->total_length) {
   805			ret = -EINVAL;
   806			goto out;
   807		}
   808	
   809		info.dirty_bytes = 0;
   810		info.initial_bytes = migf->total_length - *pos;
   811	
   812		ret = copy_to_user((void __user *)arg, &info, minsz) ? -EFAULT : 0;
   813	out:
   814		mutex_unlock(&migf->lock);
   815		mutex_unlock(&hisi_acc_vdev->state_mutex);
   816		return ret;
   817	}
   818	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (362634 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ