Hi Yan,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on vfio/next]
[also build test ERROR on jkirsher-next-queue/dev-queue linus/master v5.7-rc6
next-20200515]
[cannot apply to linux/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see
https://stackoverflow.com/a/37406982]
url:
https://github.com/0day-ci/linux/commits/Yan-Zhao/Introduce-vendor-ops-in...
base:
https://github.com/awilliam/linux-vfio.git next
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/net/ethernet/intel/i40e/i40e_vf_migration.c: In function
'i40e_vf_set_device_state':
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:132:22:
error: dereferencing pointer to incomplete type 'struct
vfio_device_migration_info'
if (state == mig_ctl->device_state)
^~
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:136:7: error:
'VFIO_DEVICE_STATE_RUNNING' undeclared (first use in this function); did you mean
'VFIO_EEH_PE_STATE_UNAVAIL'?
case VFIO_DEVICE_STATE_RUNNING:
^~~~~~~~~~~~~~~~~~~~~~~~~
VFIO_EEH_PE_STATE_UNAVAIL
drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:136:7: note: each undeclared
identifier is reported only once for each function it appears in
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:138:7: error:
'VFIO_DEVICE_STATE_SAVING' undeclared (first use in this function); did you mean
'VFIO_DEVICE_STATE_RUNNING'?
case VFIO_DEVICE_STATE_SAVING |
VFIO_DEVICE_STATE_RUNNING:
^~~~~~~~~~~~~~~~~~~~~~~~
VFIO_DEVICE_STATE_RUNNING
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:144:7: error:
'VFIO_DEVICE_STATE_STOP' undeclared (first use in this function); did you mean
'VFIO_DEVICE_STATE_SAVING'?
case VFIO_DEVICE_STATE_STOP:
^~~~~~~~~~~~~~~~~~~~~~
VFIO_DEVICE_STATE_SAVING
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:149:7: error:
'VFIO_DEVICE_STATE_RESUMING' undeclared (first use in this function); did you mean
'VFIO_DEVICE_STATE_SAVING'?
case VFIO_DEVICE_STATE_RESUMING:
^~~~~~~~~~~~~~~~~~~~~~~~~~
VFIO_DEVICE_STATE_SAVING
In file included from <command-line>:0:0:
drivers/net/ethernet/intel/i40e/i40e_vf_migration.c: In function
'i40e_vf_region_migration_rw':
> include/linux/compiler_types.h:129:35: error: invalid use of
undefined type 'struct vfio_device_migration_info'
#define
__compiler_offsetof(a, b) __builtin_offsetof(a, b)
^
include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:166:23: note:
in expansion of macro 'offsetof'
#define VDM_OFFSET(x) offsetof(struct
vfio_device_migration_info, x)
^~~~~~~~
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:172:7: note:
in expansion of macro 'VDM_OFFSET'
case VDM_OFFSET(device_state):
^~~~~~~~~~
> include/linux/compiler_types.h:129:35: error: invalid use of
undefined type 'struct vfio_device_migration_info'
#define
__compiler_offsetof(a, b) __builtin_offsetof(a, b)
^
include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:166:23: note:
in expansion of macro 'offsetof'
#define VDM_OFFSET(x) offsetof(struct
vfio_device_migration_info, x)
^~~~~~~~
drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:195:7: note: in expansion of macro
'VDM_OFFSET'
case VDM_OFFSET(reserved):
^~~~~~~~~~
> include/linux/compiler_types.h:129:35: error: invalid use of
undefined type 'struct vfio_device_migration_info'
#define
__compiler_offsetof(a, b) __builtin_offsetof(a, b)
^
include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:166:23: note:
in expansion of macro 'offsetof'
#define VDM_OFFSET(x) offsetof(struct
vfio_device_migration_info, x)
^~~~~~~~
drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:199:7: note: in expansion of macro
'VDM_OFFSET'
case VDM_OFFSET(pending_bytes):
^~~~~~~~~~
> include/linux/compiler_types.h:129:35: error: invalid use of
undefined type 'struct vfio_device_migration_info'
#define
__compiler_offsetof(a, b) __builtin_offsetof(a, b)
^
include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:166:23: note:
in expansion of macro 'offsetof'
#define VDM_OFFSET(x) offsetof(struct
vfio_device_migration_info, x)
^~~~~~~~
drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:216:7: note: in expansion of macro
'VDM_OFFSET'
case VDM_OFFSET(data_offset):
^~~~~~~~~~
> include/linux/compiler_types.h:129:35: error: invalid use of
undefined type 'struct vfio_device_migration_info'
#define
__compiler_offsetof(a, b) __builtin_offsetof(a, b)
^
include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:166:23: note:
in expansion of macro 'offsetof'
#define VDM_OFFSET(x) offsetof(struct
vfio_device_migration_info, x)
^~~~~~~~
drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:225:7: note: in expansion of macro
'VDM_OFFSET'
case VDM_OFFSET(data_size):
^~~~~~~~~~
drivers/net/ethernet/intel/i40e/i40e_vf_migration.c: In function 'i40e_vf_open':
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:385:12:
error: 'VFIO_REGION_TYPE_MIGRATION' undeclared (first use in this function); did
you mean 'VFIO_REGION_TYPE_GFX'?
VFIO_REGION_TYPE_MIGRATION,
^~~~~~~~~~~~~~~~~~~~~~~~~~
VFIO_REGION_TYPE_GFX
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:386:12:
error: 'VFIO_REGION_SUBTYPE_MIGRATION' undeclared (first use in this function);
did you mean 'VFIO_REGION_TYPE_MIGRATION'?
VFIO_REGION_SUBTYPE_MIGRATION,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VFIO_REGION_TYPE_MIGRATION
In file included from drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:16:0:
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.h:20:37: error:
invalid application of 'sizeof' to incomplete type 'struct
vfio_device_migration_info'
#define MIGRATION_REGION_SZ (sizeof(struct
vfio_device_migration_info))
^
> drivers/net/ethernet/intel/i40e/i40e_vf_migration.c:388:12: note:
in expansion of macro 'MIGRATION_REGION_SZ'
MIGRATION_REGION_SZ,
^~~~~~~~~~~~~~~~~~~
vim +132 drivers/net/ethernet/intel/i40e/i40e_vf_migration.c
125
126 static size_t i40e_vf_set_device_state(struct i40e_vf_migration *i40e_vf_dev,
127 u32 state)
128 {
129 int ret = 0;
130 struct vfio_device_migration_info *mig_ctl = i40e_vf_dev->mig_ctl;
131
132 if (state == mig_ctl->device_state)
133 return 0;
134
135 switch (state) {
136 case VFIO_DEVICE_STATE_RUNNING:
137 break;
138 case VFIO_DEVICE_STATE_SAVING | VFIO_DEVICE_STATE_RUNNING:
139 ret = i40e_vf_prepare_dirty_track(i40e_vf_dev);
140 break;
141 case VFIO_DEVICE_STATE_SAVING:
142 // do the last round of dirty page scanning
143 break;
144 case VFIO_DEVICE_STATE_STOP:
145 // release dirty
page tracking resources
146 if (mig_ctl->device_state == VFIO_DEVICE_STATE_SAVING)
147 i40e_vf_stop_dirty_track(i40e_vf_dev);
148 break;
149 case VFIO_DEVICE_STATE_RESUMING:
150 break;
151 default:
152 ret = -EFAULT;
153 }
154
155 if (!ret)
156 mig_ctl->device_state = state;
157
158 return ret;
159 }
160
161 static
162 ssize_t i40e_vf_region_migration_rw(struct i40e_vf_migration *i40e_vf_dev,
163 char __user *buf, size_t count,
164 loff_t *ppos, bool iswrite)
165 {
166 #define VDM_OFFSET(x) offsetof(struct vfio_device_migration_info,
x)
167 struct vfio_device_migration_info *mig_ctl = i40e_vf_dev->mig_ctl;
168 u64 pos = *ppos & VFIO_PCI_OFFSET_MASK;
169 int ret = 0;
170
171 switch (pos) {
172 case VDM_OFFSET(device_state):
173 if (count !=
sizeof(mig_ctl->device_state)) {
174 ret = -EINVAL;
175 break;
176 }
177
178 if (iswrite) {
179 u32 device_state;
180
181 if (copy_from_user(&device_state, buf, count)) {
182 ret = -EFAULT;
183 break;
184 }
185
186 ret = i40e_vf_set_device_state(i40e_vf_dev,
187 device_state) ?
188 ret : count;
189 } else {
190 ret = copy_to_user(buf, &mig_ctl->device_state,
191 count) ? -EFAULT : count;
192 }
193 break;
194
195 case VDM_OFFSET(reserved):
196 ret = -EFAULT;
197 break;
198
199 case VDM_OFFSET(pending_bytes):
200 {
201 if (count != sizeof(mig_ctl->pending_bytes)) {
202 ret = -EINVAL;
203 break;
204 }
205
206 if (iswrite)
207 ret = -EFAULT;
208 else
209 ret = copy_to_user(buf,
210 &mig_ctl->pending_bytes,
211 count) ? -EFAULT : count;
212
213 break;
214 }
215
216 case VDM_OFFSET(data_offset):
217 {
218 /* as we don't support device internal dirty data
219 * and our pending_bytes is always 0,
220 * return error here.
221 */
222 ret = -EFAULT;
223 break;
224 }
225 case VDM_OFFSET(data_size):
226 if (count != sizeof(mig_ctl->data_size)) {
227 ret = -EINVAL;
228 break;
229 }
230
231 if (iswrite)
232 ret = copy_from_user(&mig_ctl->data_size, buf, count) ?
233 -EFAULT : count;
234 else
235 ret = copy_to_user(buf, &mig_ctl->data_size, count) ?
236 -EFAULT : count;
237 break;
238
239 default:
240 ret = -EFAULT;
241 break;
242 }
243 return ret;
244 }
245
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org