Re: [PATCH] vhost: replace % with & on data path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Michael,

[auto build test ERROR on: v4.4-rc3]
[also build test ERROR on: next-20151127]

url:    https://github.com/0day-ci/linux/commits/Michael-S-Tsirkin/vhost-replace-with-on-data-path/20151130-163704
config: x86_64-randconfig-s0-11301655 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   drivers/vhost/vhost.c: In function 'vhost_get_vq_desc':
   drivers/vhost/vhost.c:1345:6: warning: unused variable 'ret' [-Wunused-variable]
     int ret;
         ^
   drivers/vhost/vhost.c:1344:13: warning: unused variable 'ring_head' [-Wunused-variable]
     __virtio16 ring_head;
                ^
   drivers/vhost/vhost.c:1341:24: warning: unused variable 'found' [-Wunused-variable]
     unsigned int i, head, found = 0;
                           ^
   drivers/vhost/vhost.c:1341:18: warning: unused variable 'head' [-Wunused-variable]
     unsigned int i, head, found = 0;
                     ^
   drivers/vhost/vhost.c:1341:15: warning: unused variable 'i' [-Wunused-variable]
     unsigned int i, head, found = 0;
                  ^
   drivers/vhost/vhost.c:1340:20: warning: unused variable 'desc' [-Wunused-variable]
     struct vring_desc desc;
                       ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/asm-generic/fcntl.h:4,
                    from arch/x86/include/uapi/asm/fcntl.h:1,
                    from include/uapi/linux/fcntl.h:4,
                    from include/linux/fcntl.h:4,
                    from include/linux/eventfd.h:11,
                    from drivers/vhost/vhost.c:14:
   drivers/vhost/vhost.c: At top level:
>> include/linux/compiler.h:147:2: error: expected identifier or '(' before 'if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
     ^
   include/linux/compiler.h:145:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
>> drivers/vhost/vhost.c:1373:2: note: in expansion of macro 'if'
     if (unlikely(__get_user(ring_head,
     ^
   arch/x86/include/asm/uaccess.h:414:2: error: expected identifier or '(' before ')' token
    })
     ^
   include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                               ^
>> drivers/vhost/vhost.c:1373:2: note: in expansion of macro 'if'
     if (unlikely(__get_user(ring_head,
     ^
   drivers/vhost/vhost.c:1373:6: note: in expansion of macro 'unlikely'
     if (unlikely(__get_user(ring_head,
         ^
   arch/x86/include/asm/uaccess.h:479:2: note: in expansion of macro '__get_user_nocheck'
     __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
     ^
   drivers/vhost/vhost.c:1373:15: note: in expansion of macro '__get_user'
     if (unlikely(__get_user(ring_head,
                  ^
   arch/x86/include/asm/uaccess.h:414:2: error: expected identifier or '(' before ')' token
    })
     ^
   include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                               ^
>> drivers/vhost/vhost.c:1373:2: note: in expansion of macro 'if'
     if (unlikely(__get_user(ring_head,
     ^
   drivers/vhost/vhost.c:1373:6: note: in expansion of macro 'unlikely'
     if (unlikely(__get_user(ring_head,
         ^
   arch/x86/include/asm/uaccess.h:479:2: note: in expansion of macro '__get_user_nocheck'
     __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
     ^
   drivers/vhost/vhost.c:1373:15: note: in expansion of macro '__get_user'
     if (unlikely(__get_user(ring_head,
                  ^
   include/linux/compiler.h:126:4: error: expected identifier or '(' before ')' token
      })
       ^
   include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                               ^
>> drivers/vhost/vhost.c:1373:2: note: in expansion of macro 'if'
     if (unlikely(__get_user(ring_head,
     ^
   include/linux/compiler.h:137:58: note: in expansion of macro '__branch_check__'
    #  define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
                                                             ^
   drivers/vhost/vhost.c:1373:6: note: in expansion of macro 'unlikely'
     if (unlikely(__get_user(ring_head,
         ^
   arch/x86/include/asm/uaccess.h:414:2: error: expected identifier or '(' before ')' token
    })
     ^
   include/linux/compiler.h:147:40: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                                           ^
>> drivers/vhost/vhost.c:1373:2: note: in expansion of macro 'if'
     if (unlikely(__get_user(ring_head,
     ^
   drivers/vhost/vhost.c:1373:6: note: in expansion of macro 'unlikely'
     if (unlikely(__get_user(ring_head,
         ^
   arch/x86/include/asm/uaccess.h:479:2: note: in expansion of macro '__get_user_nocheck'
     __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
     ^
   drivers/vhost/vhost.c:1373:15: note: in expansion of macro '__get_user'
     if (unlikely(__get_user(ring_head,
                  ^
   arch/x86/include/asm/uaccess.h:414:2: error: expected identifier or '(' before ')' token
    })
     ^
   include/linux/compiler.h:147:40: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                                           ^
>> drivers/vhost/vhost.c:1373:2: note: in expansion of macro 'if'
     if (unlikely(__get_user(ring_head,
     ^
   drivers/vhost/vhost.c:1373:6: note: in expansion of macro 'unlikely'
     if (unlikely(__get_user(ring_head,
         ^
   arch/x86/include/asm/uaccess.h:479:2: note: in expansion of macro '__get_user_nocheck'
     __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
     ^
   drivers/vhost/vhost.c:1373:15: note: in expansion of macro '__get_user'
     if (unlikely(__get_user(ring_head,
                  ^
   include/linux/compiler.h:126:4: error: expected identifier or '(' before ')' token
      })
       ^
   include/linux/compiler.h:147:40: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                                           ^
>> drivers/vhost/vhost.c:1373:2: note: in expansion of macro 'if'
     if (unlikely(__get_user(ring_head,
     ^
   include/linux/compiler.h:137:58: note: in expansion of macro '__branch_check__'
    #  define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
                                                             ^
   drivers/vhost/vhost.c:1373:6: note: in expansion of macro 'unlikely'
     if (unlikely(__get_user(ring_head,
         ^
   include/linux/compiler.h:161:3: error: expected identifier or '(' before ')' token
     }))
      ^
   include/linux/compiler.h:145:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
>> drivers/vhost/vhost.c:1373:2: note: in expansion of macro 'if'
     if (unlikely(__get_user(ring_head,
     ^
   drivers/vhost/vhost.c:1381:2: warning: data definition has no type or storage class
     head = vhost16_to_cpu(vq, ring_head);
     ^
   drivers/vhost/vhost.c:1381:2: error: type defaults to 'int' in declaration of 'head' [-Werror=implicit-int]
   drivers/vhost/vhost.c:1381:24: error: 'vq' undeclared here (not in a function)
     head = vhost16_to_cpu(vq, ring_head);
                           ^
   drivers/vhost/vhost.c:1381:28: error: 'ring_head' undeclared here (not in a function)
     head = vhost16_to_cpu(vq, ring_head);
                               ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/asm-generic/fcntl.h:4,
                    from arch/x86/include/uapi/asm/fcntl.h:1,
                    from include/uapi/linux/fcntl.h:4,
                    from include/linux/fcntl.h:4,
                    from include/linux/eventfd.h:11,
                    from drivers/vhost/vhost.c:14:
>> include/linux/compiler.h:147:2: error: expected identifier or '(' before 'if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
     ^
   include/linux/compiler.h:145:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   drivers/vhost/vhost.c:1384:2: note: in expansion of macro 'if'
     if (unlikely(head >= vq->num)) {
     ^
   include/linux/compiler.h:126:4: error: expected identifier or '(' before ')' token
      })
       ^
   include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                               ^
   drivers/vhost/vhost.c:1384:2: note: in expansion of macro 'if'
     if (unlikely(head >= vq->num)) {
     ^
   include/linux/compiler.h:137:58: note: in expansion of macro '__branch_check__'
    #  define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
                                                             ^
   drivers/vhost/vhost.c:1384:6: note: in expansion of macro 'unlikely'
     if (unlikely(head >= vq->num)) {
         ^
   include/linux/compiler.h:126:4: error: expected identifier or '(' before ')' token
      })
       ^
   include/linux/compiler.h:147:40: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                                           ^
   drivers/vhost/vhost.c:1384:2: note: in expansion of macro 'if'
     if (unlikely(head >= vq->num)) {
     ^
   include/linux/compiler.h:137:58: note: in expansion of macro '__branch_check__'
    #  define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
                                                             ^
   drivers/vhost/vhost.c:1384:6: note: in expansion of macro 'unlikely'
     if (unlikely(head >= vq->num)) {
         ^
   include/linux/compiler.h:161:3: error: expected identifier or '(' before ')' token
     }))
      ^
   include/linux/compiler.h:145:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   drivers/vhost/vhost.c:1384:2: note: in expansion of macro 'if'
     if (unlikely(head >= vq->num)) {
     ^
   drivers/vhost/vhost.c:1391:2: warning: data definition has no type or storage class
     *out_num = *in_num = 0;
     ^
   drivers/vhost/vhost.c:1391:3: error: type defaults to 'int' in declaration of 'out_num' [-Werror=implicit-int]
     *out_num = *in_num = 0;
      ^
   drivers/vhost/vhost.c:1391:14: error: 'in_num' undeclared here (not in a function)
     *out_num = *in_num = 0;
                 ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/asm-generic/fcntl.h:4,
                    from arch/x86/include/uapi/asm/fcntl.h:1,
                    from include/uapi/linux/fcntl.h:4,
                    from include/linux/fcntl.h:4,
                    from include/linux/eventfd.h:11,
                    from drivers/vhost/vhost.c:14:
>> include/linux/compiler.h:147:2: error: expected identifier or '(' before 'if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
     ^
   include/linux/compiler.h:145:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   drivers/vhost/vhost.c:1392:2: note: in expansion of macro 'if'
     if (unlikely(log))
     ^
   include/linux/compiler.h:126:4: error: expected identifier or '(' before ')' token
      })
       ^
   include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                               ^
   drivers/vhost/vhost.c:1392:2: note: in expansion of macro 'if'
     if (unlikely(log))
     ^
   include/linux/compiler.h:137:58: note: in expansion of macro '__branch_check__'
    #  define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
                                                             ^
   drivers/vhost/vhost.c:1392:6: note: in expansion of macro 'unlikely'
     if (unlikely(log))
         ^
   include/linux/compiler.h:126:4: error: expected identifier or '(' before ')' token
      })
       ^
   include/linux/compiler.h:147:40: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                                           ^
   drivers/vhost/vhost.c:1392:2: note: in expansion of macro 'if'
     if (unlikely(log))
     ^
   include/linux/compiler.h:137:58: note: in expansion of macro '__branch_check__'
    #  define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
                                                             ^
   drivers/vhost/vhost.c:1392:6: note: in expansion of macro 'unlikely'
     if (unlikely(log))
         ^
   include/linux/compiler.h:161:3: error: expected identifier or '(' before ')' token
     }))
      ^
   include/linux/compiler.h:145:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   drivers/vhost/vhost.c:1392:2: note: in expansion of macro 'if'
     if (unlikely(log))
     ^
   drivers/vhost/vhost.c:1395:2: warning: data definition has no type or storage class
     i = head;
     ^
   drivers/vhost/vhost.c:1395:2: error: type defaults to 'int' in declaration of 'i' [-Werror=implicit-int]
   drivers/vhost/vhost.c:1395:6: error: initializer element is not constant
     i = head;
         ^
   drivers/vhost/vhost.c:1396:2: error: expected identifier or '(' before 'do'
     do {
     ^
   drivers/vhost/vhost.c:1454:4: error: expected identifier or '(' before 'while'
     } while ((i = next_desc(vq, &desc)) != -1);
       ^
   drivers/vhost/vhost.c:1457:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
     vq->last_avail_idx++;
       ^
   In file included from arch/x86/include/asm/bug.h:35:0,
                    from include/linux/bug.h:4,
                    from include/linux/thread_info.h:11,
                    from arch/x86/include/asm/preempt.h:6,
                    from include/linux/preempt.h:59,
                    from include/linux/spinlock.h:50,
                    from include/linux/wait.h:8,
                    from include/linux/eventfd.h:12,
                    from drivers/vhost/vhost.c:14:
   include/asm-generic/bug.h:55:27: error: expected identifier or '(' before 'do'
    #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                              ^
   drivers/vhost/vhost.c:1461:2: note: in expansion of macro 'BUG_ON'
     BUG_ON(!(vq->used_flags & VRING_USED_F_NO_NOTIFY));
     ^
   include/asm-generic/bug.h:55:66: error: expected identifier or '(' before 'while'
    #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                                                     ^
   drivers/vhost/vhost.c:1461:2: note: in expansion of macro 'BUG_ON'
     BUG_ON(!(vq->used_flags & VRING_USED_F_NO_NOTIFY));
     ^
   drivers/vhost/vhost.c:1462:2: error: expected identifier or '(' before 'return'
     return head;
     ^
   drivers/vhost/vhost.c:1463:1: error: expected identifier or '(' before '}' token
    }
    ^
   drivers/vhost/vhost.c:1235:12: warning: 'get_indirect' defined but not used [-Wunused-function]
    static int get_indirect(struct vhost_virtqueue *vq,
               ^
   drivers/vhost/vhost.c: In function 'vhost_get_vq_desc':
   drivers/vhost/vhost.c:1369:2: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
   cc1: some warnings being treated as errors

vim +/if +1373 drivers/vhost/vhost.c

3a4d5c94 Michael S. Tsirkin 2010-01-14  1357  		vq_err(vq, "Guest moved used index from %u to %u",
3a4d5c94 Michael S. Tsirkin 2010-01-14  1358  		       last_avail_idx, vq->avail_idx);
d5675bd2 Michael S. Tsirkin 2010-06-24  1359  		return -EFAULT;
3a4d5c94 Michael S. Tsirkin 2010-01-14  1360  	}
3a4d5c94 Michael S. Tsirkin 2010-01-14  1361  
3a4d5c94 Michael S. Tsirkin 2010-01-14  1362  	/* If there's nothing new since last we looked, return invalid. */
3a4d5c94 Michael S. Tsirkin 2010-01-14  1363  	if (vq->avail_idx == last_avail_idx)
3a4d5c94 Michael S. Tsirkin 2010-01-14  1364  		return vq->num;
3a4d5c94 Michael S. Tsirkin 2010-01-14  1365  
3a4d5c94 Michael S. Tsirkin 2010-01-14  1366  	/* Only get avail ring entries after they have been exposed by guest. */
5659338c Michael S. Tsirkin 2010-02-01  1367  	smp_rmb();
3a4d5c94 Michael S. Tsirkin 2010-01-14  1368  
07a08023 Michael S. Tsirkin 2015-11-30  1369  	}
07a08023 Michael S. Tsirkin 2015-11-30  1370  
3a4d5c94 Michael S. Tsirkin 2010-01-14  1371  	/* Grab the next descriptor number they're advertising, and increment
3a4d5c94 Michael S. Tsirkin 2010-01-14  1372  	 * the index we've seen. */
3b1bbe89 Michael S. Tsirkin 2014-10-24 @1373  	if (unlikely(__get_user(ring_head,
07a08023 Michael S. Tsirkin 2015-11-30  1374  				&vq->avail->ring[last_avail_idx & (vq->num - 1)]))) {
3a4d5c94 Michael S. Tsirkin 2010-01-14  1375  		vq_err(vq, "Failed to read head: idx %d address %p\n",
3a4d5c94 Michael S. Tsirkin 2010-01-14  1376  		       last_avail_idx,
3a4d5c94 Michael S. Tsirkin 2010-01-14  1377  		       &vq->avail->ring[last_avail_idx % vq->num]);
d5675bd2 Michael S. Tsirkin 2010-06-24  1378  		return -EFAULT;
3a4d5c94 Michael S. Tsirkin 2010-01-14  1379  	}
3a4d5c94 Michael S. Tsirkin 2010-01-14  1380  
3b1bbe89 Michael S. Tsirkin 2014-10-24  1381  	head = vhost16_to_cpu(vq, ring_head);

:::::: The code at line 1373 was first introduced by commit
:::::: 3b1bbe89351a8003857aeb5cbef3595f5d0ee609 vhost: virtio 1.0 endian-ness support

:::::: TO: Michael S. Tsirkin <mst@xxxxxxxxxx>
:::::: CC: Michael S. Tsirkin <mst@xxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: Binary data

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux