Hi Stefano,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linus/master]
[also build test WARNING on v5.10-rc3 next-20201113]
[cannot apply to vhost/linux-next linux/master]
[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]
url:
https://github.com/0day-ci/linux/commits/Stefano-Garzarella/vdpa-generali...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
585e5b17b92dead8a3aca4e3c9876fbca5f7e0ba
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.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/0day-ci/linux/commit/65adaf3b3bcf9692c072ae2f93c1d7844...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Stefano-Garzarella/vdpa-generalize-vdpa-simulator-and-add-block-device/20201113-215247
git checkout 65adaf3b3bcf9692c072ae2f93c1d784426a224d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/device.h:15,
from include/linux/genhd.h:35,
from include/linux/blkdev.h:8,
from drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:10:
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c: In function 'vdpasim_blk_handle_req':
> drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:68:5: warning: format
'%lx' expects argument of type 'long unsigned int', but argument 4 has
type 'size_t' {aka 'unsigned int'} [-Wformat=]
68 |
"reading over the capacity - offset: 0x%llx len: 0x%lx\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:67:4: note: in expansion of macro
'dev_err'
67 | dev_err(&vdpasim->vdpa.dev,
| ^~~~~~~
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:68:58: note: format string is defined here
68 | "reading over the capacity - offset: 0x%llx len: 0x%lx\n",
| ~~^
| |
| long unsigned int
| %x
In file included from include/linux/device.h:15,
from include/linux/genhd.h:35,
from include/linux/blkdev.h:8,
from drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:10:
> drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:79:5: warning: format
'%ld' expects argument of type 'long int', but argument 3 has type
'ssize_t' {aka 'int'} [-Wformat=]
79 |
"vringh_iov_push_iotlb() error: %ld offset: 0x%llx len: 0x%lx\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:78:4: note: in expansion of macro
'dev_err'
78 | dev_err(&vdpasim->vdpa.dev,
| ^~~~~~~
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:79:39: note: format string is defined here
79 | "vringh_iov_push_iotlb() error: %ld offset: 0x%llx len:
0x%lx\n",
| ~~^
| |
| long int
| %d
In file included from include/linux/device.h:15,
from include/linux/genhd.h:35,
from include/linux/blkdev.h:8,
from drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:10:
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:79:5: warning: format '%lx' expects
argument of type 'long unsigned int', but argument 5 has type 'size_t'
{aka 'unsigned int'} [-Wformat=]
79 | "vringh_iov_push_iotlb() error: %ld offset: 0x%llx len:
0x%lx\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:78:4: note: in expansion of macro
'dev_err'
78 | dev_err(&vdpasim->vdpa.dev,
| ^~~~~~~
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:79:65: note: format string is defined here
79 | "vringh_iov_push_iotlb() error: %ld offset: 0x%llx len:
0x%lx\n",
| ~~^
| |
| long unsigned
int
| %x
In file included from include/linux/device.h:15,
from include/linux/genhd.h:35,
from include/linux/blkdev.h:8,
from drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:10:
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:91:5: warning: format '%lx' expects
argument of type 'long unsigned int', but argument 4 has type 'size_t'
{aka 'unsigned int'} [-Wformat=]
91 | "writing over the capacity - offset: 0x%llx len: 0x%lx\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:90:4: note: in expansion of macro
'dev_err'
90 | dev_err(&vdpasim->vdpa.dev,
| ^~~~~~~
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:91:58: note: format string is defined here
91 | "writing over the capacity - offset: 0x%llx len: 0x%lx\n",
| ~~^
| |
| long unsigned int
| %x
In file included from include/linux/device.h:15,
from include/linux/genhd.h:35,
from include/linux/blkdev.h:8,
from drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:10:
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:102:5: warning: format '%ld' expects
argument of type 'long int', but argument 3 has type 'ssize_t' {aka
'int'} [-Wformat=]
102 | "vringh_iov_pull_iotlb() error: %ld offset: 0x%llx len:
0x%lx\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:101:4: note: in expansion of macro
'dev_err'
101 | dev_err(&vdpasim->vdpa.dev,
| ^~~~~~~
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:102:39: note: format string is defined here
102 | "vringh_iov_pull_iotlb() error: %ld offset: 0x%llx len:
0x%lx\n",
| ~~^
| |
| long int
| %d
In file included from include/linux/device.h:15,
from include/linux/genhd.h:35,
from include/linux/blkdev.h:8,
from drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:10:
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:102:5: warning: format '%lx' expects
argument of type 'long unsigned int', but argument 5 has type 'size_t'
{aka 'unsigned int'} [-Wformat=]
102 | "vringh_iov_pull_iotlb() error: %ld offset: 0x%llx len:
0x%lx\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:101:4: note: in expansion of macro
'dev_err'
101 | dev_err(&vdpasim->vdpa.dev,
| ^~~~~~~
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:102:65: note: format string is defined here
102 | "vringh_iov_pull_iotlb() error: %ld offset: 0x%llx len:
0x%lx\n",
| ~~^
| |
| long unsigned
int
| %x
In file included from include/linux/device.h:15,
from include/linux/genhd.h:35,
from include/linux/blkdev.h:8,
from drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:10:
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:117:5: warning: format '%ld' expects
argument of type 'long int', but argument 3 has type 'ssize_t' {aka
'int'} [-Wformat=]
117 | "vringh_iov_push_iotlb() error: %ld\n", bytes);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
vim +68 drivers/vdpa/vdpa_sim/vdpa_sim_blk.c
27
28 static int vdpasim_blk_handle_req(struct vdpasim *vdpasim,
29 struct vdpasim_virtqueue *vq)
30 {
31 size_t wrote = 0, to_read = 0, to_write = 0;
32 struct virtio_blk_outhdr hdr;
33 uint8_t status;
34 uint32_t type;
35 ssize_t bytes;
36 loff_t offset;
37 int i, ret;
38
39 vringh_kiov_cleanup(&vq->riov);
40 vringh_kiov_cleanup(&vq->wiov);
41
42 ret = vringh_getdesc_iotlb(&vq->vring, &vq->riov, &vq->wiov,
43 &vq->head, GFP_ATOMIC);
44 if (ret != 1)
45 return ret;
46
47 for (i = 0; i < vq->wiov.used; i++)
48 to_write += vq->wiov.iov[i].iov_len;
49 to_write -= 1; /* last byte is the status */
50
51 for (i = 0; i < vq->riov.used; i++)
52 to_read += vq->riov.iov[i].iov_len;
53
54 bytes = vringh_iov_pull_iotlb(&vq->vring, &vq->riov, &hdr,
sizeof(hdr));
55 if (bytes != sizeof(hdr))
56 return 0;
57
58 to_read -= bytes;
59
60 type = le32_to_cpu(hdr.type);
61 offset = le64_to_cpu(hdr.sector) << SECTOR_SHIFT;
62 status = VIRTIO_BLK_S_OK;
63
64 switch (type) {
65 case VIRTIO_BLK_T_IN:
66 if (offset + to_write > VDPASIM_BLK_CAPACITY << SECTOR_SHIFT) {
67 dev_err(&vdpasim->vdpa.dev,
68 "reading over the capacity - offset: 0x%llx len:
0x%lx\n",
69 offset, to_write);
70 status = VIRTIO_BLK_S_IOERR;
71 break;
72 }
73
74 bytes = vringh_iov_push_iotlb(&vq->vring, &vq->wiov,
75 vdpasim->buffer + offset,
76 to_write);
77 if (bytes < 0) {
78 dev_err(&vdpasim->vdpa.dev,
79 "vringh_iov_push_iotlb() error: %ld offset: 0x%llx len:
0x%lx\n",
80 bytes, offset, to_write);
81 status = VIRTIO_BLK_S_IOERR;
82 break;
83 }
84
85 wrote += bytes;
86 break;
87
88 case VIRTIO_BLK_T_OUT:
89 if (offset + to_read > VDPASIM_BLK_CAPACITY << SECTOR_SHIFT) {
90 dev_err(&vdpasim->vdpa.dev,
91 "writing over the capacity - offset: 0x%llx len: 0x%lx\n",
92 offset, to_read);
93 status = VIRTIO_BLK_S_IOERR;
94 break;
95 }
96
97 bytes = vringh_iov_pull_iotlb(&vq->vring, &vq->riov,
98 vdpasim->buffer + offset,
99 to_read);
100 if (bytes < 0) {
101 dev_err(&vdpasim->vdpa.dev,
102 "vringh_iov_pull_iotlb() error: %ld offset: 0x%llx len: 0x%lx\n",
103 bytes, offset, to_read);
104 status = VIRTIO_BLK_S_IOERR;
105 break;
106 }
107 break;
108
109 case VIRTIO_BLK_T_GET_ID: {
110 char id[VIRTIO_BLK_ID_BYTES] = "vdpa_blk_sim";
111
112 bytes = vringh_iov_push_iotlb(&vq->vring,
113 &vq->wiov, id,
114 VIRTIO_BLK_ID_BYTES);
115 if (bytes < 0) {
116 dev_err(&vdpasim->vdpa.dev,
117 "vringh_iov_push_iotlb() error: %ld\n", bytes);
118 status = VIRTIO_BLK_S_IOERR;
119 break;
120 }
121
122 wrote += bytes;
123 break;
124 }
125
126 default:
127 dev_warn(&vdpasim->vdpa.dev,
128 "Unsupported request type %d\n", type);
129 status = VIRTIO_BLK_S_IOERR;
130 break;
131 }
132
133 /* if VIRTIO_BLK_T_IN or VIRTIO_BLK_T_GET_ID fail, we need to skip
134 * the remaining bytes to put the status in the last byte
135 */
136 if (to_write - wrote > 0) {
137 vringh_iov_push_iotlb(&vq->vring, &vq->wiov, NULL,
138 to_write - wrote);
139 }
140
141 /* last byte is the status */
142 bytes = vringh_iov_push_iotlb(&vq->vring, &vq->wiov, &status,
1);
143 if (bytes != 1)
144 return 0;
145
146 wrote += bytes;
147
148 /* Make sure data is wrote before advancing index */
149 smp_wmb();
150
151 vringh_complete_iotlb(&vq->vring, vq->head, wrote);
152
153 return ret;
154 }
155
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org