tree: https://git.kernel.org/pub/scm/linux/kernel/git/cohuck/linux.git virtio-ccw-no-legacy head: 21e2d15a834a81c2a27e6a31a15bd1b6048ab013 commit: 21e2d15a834a81c2a27e6a31a15bd1b6048ab013 [2/2] virtio/s390: make legacy support configurable config: s390-randconfig-r033-20210730 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 4f71f59bf3d9914188a11d0c41bedbb339d36ff5) 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 # install s390 cross compiling tool for clang build # apt-get install binutils-s390x-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/cohuck/linux.git/commit/?id=21e2d15a834a81c2a27e6a31a15bd1b6048ab013 git remote add cohuck https://git.kernel.org/pub/scm/linux/kernel/git/cohuck/linux.git git fetch --no-tags cohuck virtio-ccw-no-legacy git checkout 21e2d15a834a81c2a27e6a31a15bd1b6048ab013 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): In file included from drivers/s390/virtio/virtio_ccw_legacy.c:13: In file included from drivers/s390/virtio/virtio_ccw_common.h:11: In file included from include/linux/virtio.h:7: In file included from include/linux/scatterlist.h:9: In file included from arch/s390/include/asm/io.h:75: include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __raw_readb(PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/big_endian.h:36:59: note: expanded from macro '__le16_to_cpu' #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x)) ^ include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16' #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x)) ^ In file included from drivers/s390/virtio/virtio_ccw_legacy.c:13: In file included from drivers/s390/virtio/virtio_ccw_common.h:11: In file included from include/linux/virtio.h:7: In file included from include/linux/scatterlist.h:9: In file included from arch/s390/include/asm/io.h:75: include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu' #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x)) ^ include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32' #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x)) ^ In file included from drivers/s390/virtio/virtio_ccw_legacy.c:13: In file included from drivers/s390/virtio/virtio_ccw_common.h:11: In file included from include/linux/virtio.h:7: In file included from include/linux/scatterlist.h:9: In file included from arch/s390/include/asm/io.h:75: include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writeb(value, PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] readsb(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] readsw(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] readsl(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] writesb(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] writesw(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] writesl(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ >> drivers/s390/virtio/virtio_ccw_legacy.c:106:2: warning: variable 'info_block' is uninitialized when used here [-Wuninitialized] info_block->queue = queue; ^~~~~~~~~~ drivers/s390/virtio/virtio_ccw_legacy.c:72:41: note: initialize the variable 'info_block' to silence this warning struct vq_info_block_legacy *info_block; ^ = NULL 13 warnings generated. Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for VIRTIO_LEGACY Depends on VIRTIO_MENU Selected by - VIRTIO_CCW_LEGACY && S390_GUEST vim +/info_block +106 drivers/s390/virtio/virtio_ccw_legacy.c 62 63 struct virtqueue *virtio_ccw_setup_vq_legacy(struct virtio_device *vdev, 64 int i, vq_callback_t *callback, 65 const char *name, bool ctx, 66 struct ccw1 *ccw) 67 { 68 struct virtio_ccw_device *vcdev = to_vc_device(vdev); 69 int err; 70 struct virtqueue *vq = NULL; 71 struct virtio_ccw_vq_info *info; 72 struct vq_info_block_legacy *info_block; 73 u64 queue; 74 unsigned long flags; 75 76 /* Allocate queue. */ 77 info = kzalloc(sizeof(struct virtio_ccw_vq_info), GFP_KERNEL); 78 if (!info) { 79 err = -ENOMEM; 80 goto out_err; 81 } 82 info->info_block = ccw_device_dma_zalloc(vcdev->cdev, 83 sizeof(struct vq_info_block_legacy)); 84 if (!info->info_block) { 85 dev_warn(&vcdev->cdev->dev, "no info block\n"); 86 err = -ENOMEM; 87 goto out_err; 88 } 89 info->num = virtio_ccw_read_vq_conf(vcdev, ccw, i); 90 if (info->num < 0) { 91 err = info->num; 92 goto out_err; 93 } 94 vq = vring_create_virtqueue(i, info->num, KVM_VIRTIO_CCW_RING_ALIGN, 95 vdev, true, false, ctx, 96 virtio_ccw_kvm_notify, callback, name); 97 98 if (!vq) { 99 dev_warn(&vcdev->cdev->dev, "no vq\n"); 100 err = -ENOMEM; 101 goto out_err; 102 } 103 104 /* Register it with the host. */ 105 queue = virtqueue_get_desc_addr(vq); > 106 info_block->queue = queue; --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org