Re: [PATCH 1/4] KVM: stats: Make sure no missing or mismatched binary stats definition
by kernel test robot
Hi Jing,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on 39be2e28180a2e87af5fbb8d83643812e1a3b371]
url: https://github.com/0day-ci/linux/commits/Jing-Zhang/Remove-duplicated-sta...
base: 39be2e28180a2e87af5fbb8d83643812e1a3b371
config: s390-randconfig-r022-20210615 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
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://github.com/0day-ci/linux/commit/2145147a4e85c8196c004804d103c1a3d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jing-Zhang/Remove-duplicated-stats-definitions-for-debugfs/20210616-151523
git checkout 2145147a4e85c8196c004804d103c1a3d7adeffe
# 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 <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from arch/s390/kvm/kvm-s390.c:23:
In file included from include/linux/kvm_host.h:35:
In file included from include/linux/kvm_para.h:5:
In file included from include/uapi/linux/kvm_para.h:37:
In file included from arch/s390/include/asm/kvm_para.h:25:
In file included from arch/s390/include/asm/diag.h:12:
In file included from include/linux/if_ether.h:19:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
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 arch/s390/kvm/kvm-s390.c:23:
In file included from include/linux/kvm_host.h:35:
In file included from include/linux/kvm_para.h:5:
In file included from include/uapi/linux/kvm_para.h:37:
In file included from arch/s390/include/asm/kvm_para.h:25:
In file included from arch/s390/include/asm/diag.h:12:
In file included from include/linux/if_ether.h:19:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
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 arch/s390/kvm/kvm-s390.c:23:
In file included from include/linux/kvm_host.h:35:
In file included from include/linux/kvm_para.h:5:
In file included from include/uapi/linux/kvm_para.h:37:
In file included from arch/s390/include/asm/kvm_para.h:25:
In file included from arch/s390/include/asm/diag.h:12:
In file included from include/linux/if_ether.h:19:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
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);
~~~~~~~~~~ ^
>> arch/s390/kvm/kvm-s390.c:63:2: error: implicit declaration of function 'STATS_DESC_COUNTR' [-Werror,-Wimplicit-function-declaration]
STATS_DESC_COUNTR(VM, inject_io),
^
>> arch/s390/kvm/kvm-s390.c:63:20: error: use of undeclared identifier 'VM'
STATS_DESC_COUNTR(VM, inject_io),
^
>> arch/s390/kvm/kvm-s390.c:63:24: error: use of undeclared identifier 'inject_io'
STATS_DESC_COUNTR(VM, inject_io),
^
arch/s390/kvm/kvm-s390.c:64:20: error: use of undeclared identifier 'VM'
STATS_DESC_COUNTR(VM, inject_float_mchk),
^
>> arch/s390/kvm/kvm-s390.c:64:24: error: use of undeclared identifier 'inject_float_mchk'
STATS_DESC_COUNTR(VM, inject_float_mchk),
^
arch/s390/kvm/kvm-s390.c:65:20: error: use of undeclared identifier 'VM'
STATS_DESC_COUNTR(VM, inject_pfault_done),
^
>> arch/s390/kvm/kvm-s390.c:65:24: error: use of undeclared identifier 'inject_pfault_done'
STATS_DESC_COUNTR(VM, inject_pfault_done),
^
arch/s390/kvm/kvm-s390.c:66:20: error: use of undeclared identifier 'VM'
STATS_DESC_COUNTR(VM, inject_service_signal),
^
>> arch/s390/kvm/kvm-s390.c:66:24: error: use of undeclared identifier 'inject_service_signal'
STATS_DESC_COUNTR(VM, inject_service_signal),
^
arch/s390/kvm/kvm-s390.c:67:20: error: use of undeclared identifier 'VM'
STATS_DESC_COUNTR(VM, inject_virtio)
^
>> arch/s390/kvm/kvm-s390.c:67:24: error: use of undeclared identifier 'inject_virtio'
STATS_DESC_COUNTR(VM, inject_virtio)
^
>> arch/s390/kvm/kvm-s390.c:69:15: error: invalid application of 'sizeof' to an incomplete type 'struct _kvm_stats_desc []'
static_assert(ARRAY_SIZE(kvm_vm_stats_desc) ==
~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:42:32: note: expanded from macro 'ARRAY_SIZE'
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
^
include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
#define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
#define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
^~~~
arch/s390/kvm/kvm-s390.c:75:12: error: invalid application of 'sizeof' to an incomplete type 'struct _kvm_stats_desc []'
.count = ARRAY_SIZE(kvm_vm_stats_desc),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:42:32: note: expanded from macro 'ARRAY_SIZE'
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
^~~~~
arch/s390/kvm/kvm-s390.c:78:10: error: invalid application of 'sizeof' to an incomplete type 'struct _kvm_stats_desc []'
sizeof(kvm_vm_stats_desc),
^~~~~~~~~~~~~~~~~~~
12 warnings and 14 errors generated.
vim +/STATS_DESC_COUNTR +63 arch/s390/kvm/kvm-s390.c
55
56 #define MEM_OP_MAX_SIZE 65536 /* Maximum transfer size for KVM_S390_MEM_OP */
57 #define LOCAL_IRQS 32
58 #define VCPU_IRQS_MAX_BUF (sizeof(struct kvm_s390_irq) * \
59 (KVM_MAX_VCPUS + LOCAL_IRQS))
60
61 struct _kvm_stats_desc kvm_vm_stats_desc[] = {
62 KVM_GENERIC_VM_STATS(),
> 63 STATS_DESC_COUNTR(VM, inject_io),
> 64 STATS_DESC_COUNTR(VM, inject_float_mchk),
> 65 STATS_DESC_COUNTR(VM, inject_pfault_done),
> 66 STATS_DESC_COUNTR(VM, inject_service_signal),
> 67 STATS_DESC_COUNTR(VM, inject_virtio)
68 };
> 69 static_assert(ARRAY_SIZE(kvm_vm_stats_desc) ==
70 sizeof(struct kvm_vm_stat) / sizeof(u64));
71
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
Re: [PATCH nf 1/2] netfilter: nft_exthdr: check for IPv6 packet before further processing
by kernel test robot
Hi Pablo,
I love your patch! Yet something to improve:
[auto build test ERROR on nf/master]
url: https://github.com/0day-ci/linux/commits/Pablo-Neira-Ayuso/netfilter-nft_...
base: https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git master
config: i386-randconfig-s001-20210615 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://github.com/0day-ci/linux/commit/3e2206f7e73972c0cb8a3b6b8a8e0b636...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Pablo-Neira-Ayuso/netfilter-nft_exthdr-check-for-IPv6-packet-before-further-processing/20210616-144640
git checkout 3e2206f7e73972c0cb8a3b6b8a8e0b636a959c96
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
net/netfilter/nft_exthdr.c: In function 'nft_exthdr_ipv6_eval':
>> net/netfilter/nft_exthdr.c:45:6: error: 'skb' undeclared (first use in this function)
45 | if (skb->protocol != htons(ETH_P_IPV6))
| ^~~
net/netfilter/nft_exthdr.c:45:6: note: each undeclared identifier is reported only once for each function it appears in
vim +/skb +45 net/netfilter/nft_exthdr.c
35
36 static void nft_exthdr_ipv6_eval(const struct nft_expr *expr,
37 struct nft_regs *regs,
38 const struct nft_pktinfo *pkt)
39 {
40 struct nft_exthdr *priv = nft_expr_priv(expr);
41 u32 *dest = ®s->data[priv->dreg];
42 unsigned int offset = 0;
43 int err;
44
> 45 if (skb->protocol != htons(ETH_P_IPV6))
46 goto err;
47
48 err = ipv6_find_hdr(pkt->skb, &offset, priv->type, NULL, NULL);
49 if (priv->flags & NFT_EXTHDR_F_PRESENT) {
50 nft_reg_store8(dest, err >= 0);
51 return;
52 } else if (err < 0) {
53 goto err;
54 }
55 offset += priv->offset;
56
57 dest[priv->len / NFT_REG32_SIZE] = 0;
58 if (skb_copy_bits(pkt->skb, offset, dest, priv->len) < 0)
59 goto err;
60 return;
61 err:
62 regs->verdict.code = NFT_BREAK;
63 }
64
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
Re: [Intel-gfx] [PATCH 4/5] dma-buf: Stop using SLAB_TYPESAFE_BY_RCU in selftests
by kernel test robot
Hi Jason,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master v5.13-rc6 next-20210615]
[cannot apply to drm/drm-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]
url: https://github.com/0day-ci/linux/commits/Jason-Ekstrand/dma-fence-i915-St...
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: sparc-randconfig-s032-20210615 (attached as .config)
compiler: sparc-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://github.com/0day-ci/linux/commit/c889567ea79d1ce55ff8868bae789bbb3...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jason-Ekstrand/dma-fence-i915-Stop-allowing-SLAB_TYPESAFE_BY_RCU-for-dma_fence/20210616-154432
git checkout c889567ea79d1ce55ff8868bae789bbb3223503d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=sparc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/dma-buf/st-dma-fence.c:457:57: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct dma_fence *fence @@ got struct dma_fence [noderef] __rcu * @@
drivers/dma-buf/st-dma-fence.c:457:57: sparse: expected struct dma_fence *fence
drivers/dma-buf/st-dma-fence.c:457:57: sparse: got struct dma_fence [noderef] __rcu *
vim +457 drivers/dma-buf/st-dma-fence.c
434
435 static int thread_signal_callback(void *arg)
436 {
437 const struct race_thread *t = arg;
438 unsigned long pass = 0;
439 unsigned long miss = 0;
440 int err = 0;
441
442 while (!err && !kthread_should_stop()) {
443 struct dma_fence *f1, *f2;
444 struct simple_cb cb;
445
446 f1 = mock_fence();
447 if (!f1) {
448 err = -ENOMEM;
449 break;
450 }
451
452 rcu_assign_pointer(t->fences[t->id], f1);
453 smp_wmb();
454
455 rcu_read_lock();
456 do {
> 457 f2 = dma_fence_get_rcu(t->fences[!t->id]);
458 } while (!f2 && !kthread_should_stop());
459 rcu_read_unlock();
460
461 if (t->before)
462 dma_fence_signal(f1);
463
464 smp_store_mb(cb.seen, false);
465 if (!f2 ||
466 dma_fence_add_callback(f2, &cb.cb, simple_callback)) {
467 miss++;
468 cb.seen = true;
469 }
470
471 if (!t->before)
472 dma_fence_signal(f1);
473
474 if (!cb.seen) {
475 dma_fence_wait(f2, false);
476 __wait_for_callbacks(f2);
477 }
478
479 if (!READ_ONCE(cb.seen)) {
480 pr_err("Callback not seen on thread %d, pass %lu (%lu misses), signaling %s add_callback; fence signaled? %s\n",
481 t->id, pass, miss,
482 t->before ? "before" : "after",
483 dma_fence_is_signaled(f2) ? "yes" : "no");
484 err = -EINVAL;
485 }
486
487 dma_fence_put(f2);
488
489 rcu_assign_pointer(t->fences[t->id], NULL);
490 smp_wmb();
491
492 dma_fence_put(f1);
493
494 pass++;
495 }
496
497 pr_info("%s[%d] completed %lu passes, %lu misses\n",
498 __func__, t->id, pass, miss);
499 return err;
500 }
501
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
Re: [RFC v1 3/6] vhost/vsock: add support for vhost dgram.
by kernel test robot
Hi Jiang,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on tip/perf/core linus/master v5.13-rc6]
[cannot apply to next-20210615]
[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/Jiang-Wang/virtio-vsock-introduc...
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: arm64-randconfig-s031-20210615 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://github.com/0day-ci/linux/commit/0d43b802cb4112ba50c616916364ada91...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jiang-Wang/virtio-vsock-introduce-SOCK_DGRAM-support/20210616-120056
git checkout 0d43b802cb4112ba50c616916364ada91c24a7bb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/vhost/vsock.c:150:29: sparse: sparse: restricted __le16 degrades to integer
drivers/vhost/vsock.c:345:21: sparse: sparse: restricted __le16 degrades to integer
drivers/vhost/vsock.c:349:28: sparse: sparse: restricted __le16 degrades to integer
drivers/vhost/vsock.c:364:21: sparse: sparse: restricted __le16 degrades to integer
vim +150 drivers/vhost/vsock.c
96
97 static void
98 vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
99 struct vhost_virtqueue *vq)
100 {
101 struct vhost_virtqueue *tx_vq;
102 int pkts = 0, total_len = 0;
103 bool added = false;
104 bool restart_tx = false;
105 spinlock_t *lock;
106 struct list_head *send_pkt_list;
107
108 if (vq == &vsock->vqs[VSOCK_VQ_RX]) {
109 tx_vq = &vsock->vqs[VSOCK_VQ_TX];
110 lock = &vsock->send_pkt_list_lock;
111 send_pkt_list = &vsock->send_pkt_list;
112 } else {
113 tx_vq = &vsock->vqs[VSOCK_VQ_DGRAM_TX];
114 lock = &vsock->dgram_send_pkt_list_lock;
115 send_pkt_list = &vsock->dgram_send_pkt_list;
116 }
117
118 mutex_lock(&vq->mutex);
119
120 if (!vhost_vq_get_backend(vq))
121 goto out;
122
123 if (!vq_meta_prefetch(vq))
124 goto out;
125
126 /* Avoid further vmexits, we're already processing the virtqueue */
127 vhost_disable_notify(&vsock->dev, vq);
128
129 do {
130 struct virtio_vsock_pkt *pkt;
131 struct iov_iter iov_iter;
132 unsigned out, in;
133 size_t nbytes;
134 size_t iov_len, payload_len;
135 int head;
136 bool is_dgram = false;
137
138 spin_lock_bh(lock);
139 if (list_empty(send_pkt_list)) {
140 spin_unlock_bh(lock);
141 vhost_enable_notify(&vsock->dev, vq);
142 break;
143 }
144
145 pkt = list_first_entry(send_pkt_list,
146 struct virtio_vsock_pkt, list);
147 list_del_init(&pkt->list);
148 spin_unlock_bh(lock);
149
> 150 if (pkt->hdr.type == VIRTIO_VSOCK_TYPE_DGRAM)
151 is_dgram = true;
152
153 head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov),
154 &out, &in, NULL, NULL);
155 if (head < 0) {
156 spin_lock_bh(lock);
157 list_add(&pkt->list, send_pkt_list);
158 spin_unlock_bh(lock);
159 break;
160 }
161
162 if (head == vq->num) {
163 if (is_dgram) {
164 virtio_transport_free_pkt(pkt);
165 vq_err(vq, "Dgram virtqueue is full!");
166 spin_lock_bh(lock);
167 vsock->dgram_used--;
168 spin_unlock_bh(lock);
169 break;
170 }
171 spin_lock_bh(lock);
172 list_add(&pkt->list, send_pkt_list);
173 spin_unlock_bh(lock);
174
175 /* We cannot finish yet if more buffers snuck in while
176 * re-enabling notify.
177 */
178 if (unlikely(vhost_enable_notify(&vsock->dev, vq))) {
179 vhost_disable_notify(&vsock->dev, vq);
180 continue;
181 }
182 break;
183 }
184
185 if (out) {
186 virtio_transport_free_pkt(pkt);
187 vq_err(vq, "Expected 0 output buffers, got %u\n", out);
188 if (is_dgram) {
189 spin_lock_bh(lock);
190 vsock->dgram_used--;
191 spin_unlock_bh(lock);
192 }
193
194 break;
195 }
196
197 iov_len = iov_length(&vq->iov[out], in);
198 if (iov_len < sizeof(pkt->hdr)) {
199 virtio_transport_free_pkt(pkt);
200 vq_err(vq, "Buffer len [%zu] too small\n", iov_len);
201 if (is_dgram) {
202 spin_lock_bh(lock);
203 vsock->dgram_used--;
204 spin_unlock_bh(lock);
205 }
206 break;
207 }
208
209 if (iov_len < pkt->len - pkt->off &&
210 vq == &vsock->vqs[VSOCK_VQ_DGRAM_RX]) {
211 virtio_transport_free_pkt(pkt);
212 vq_err(vq, "Buffer len [%zu] too small for dgram\n", iov_len);
213 break;
214 }
215
216 iov_iter_init(&iov_iter, READ, &vq->iov[out], in, iov_len);
217 payload_len = pkt->len - pkt->off;
218
219 /* If the packet is greater than the space available in the
220 * buffer, we split it using multiple buffers.
221 */
222 if (payload_len > iov_len - sizeof(pkt->hdr))
223 payload_len = iov_len - sizeof(pkt->hdr);
224
225 /* Set the correct length in the header */
226 pkt->hdr.len = cpu_to_le32(payload_len);
227
228 nbytes = copy_to_iter(&pkt->hdr, sizeof(pkt->hdr), &iov_iter);
229 if (nbytes != sizeof(pkt->hdr)) {
230 virtio_transport_free_pkt(pkt);
231 vq_err(vq, "Faulted on copying pkt hdr\n");
232 if (is_dgram) {
233 spin_lock_bh(lock);
234 vsock->dgram_used--;
235 spin_unlock_bh(lock);
236 }
237 break;
238 }
239
240 nbytes = copy_to_iter(pkt->buf + pkt->off, payload_len,
241 &iov_iter);
242 if (nbytes != payload_len) {
243 virtio_transport_free_pkt(pkt);
244 vq_err(vq, "Faulted on copying pkt buf\n");
245 break;
246 }
247
248 /* Deliver to monitoring devices all packets that we
249 * will transmit.
250 */
251 virtio_transport_deliver_tap_pkt(pkt);
252
253 vhost_add_used(vq, head, sizeof(pkt->hdr) + payload_len);
254 added = true;
255
256 pkt->off += payload_len;
257 total_len += payload_len;
258
259 /* If we didn't send all the payload we can requeue the packet
260 * to send it with the next available buffer.
261 */
262 if ((pkt->off < pkt->len)
263 && (vq == &vsock->vqs[VSOCK_VQ_RX])) {
264 /* We are queueing the same virtio_vsock_pkt to handle
265 * the remaining bytes, and we want to deliver it
266 * to monitoring devices in the next iteration.
267 */
268 pkt->tap_delivered = false;
269
270 spin_lock_bh(lock);
271 list_add(&pkt->list, send_pkt_list);
272 spin_unlock_bh(lock);
273 } else {
274 if (pkt->reply) {
275 int val;
276
277 val = atomic_dec_return(&vsock->queued_replies);
278
279 /* Do we have resources to resume tx
280 * processing?
281 */
282 if (val + 1 == tx_vq->num)
283 restart_tx = true;
284 }
285
286 virtio_transport_free_pkt(pkt);
287 if (is_dgram) {
288 spin_lock_bh(lock);
289 vsock->dgram_used--;
290 spin_unlock_bh(lock);
291 }
292 }
293 } while(likely(!vhost_exceeds_weight(vq, ++pkts, total_len)));
294 if (added)
295 vhost_signal(&vsock->dev, vq);
296
297 out:
298 mutex_unlock(&vq->mutex);
299
300 if (restart_tx)
301 vhost_poll_queue(&tx_vq->poll);
302 }
303
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[luto:x86/membarrier 4/8] kernel/kthread.c:1328:2: error: implicit declaration of function 'membarrier_finish_switch_mm'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git x86/membarrier
head: 07a8b963002cb955b7516e61bad19514a3acaa82
commit: f184d013a255a523116b692db4996c5db2569e86 [4/8] membarrier: Make the post-switch-mm barrier explicit
config: ia64-randconfig-r015-20210615 (attached as .config)
compiler: ia64-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://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?id...
git remote add luto https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git
git fetch --no-tags luto x86/membarrier
git checkout f184d013a255a523116b692db4996c5db2569e86
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
kernel/kthread.c: In function 'kthread_use_mm':
>> kernel/kthread.c:1328:2: error: implicit declaration of function 'membarrier_finish_switch_mm' [-Werror=implicit-function-declaration]
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from <command-line>:
>> kernel/kthread.c:1328:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro '__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:21: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
>> kernel/kthread.c:1328:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro '__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:21: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
>> kernel/kthread.c:1328:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro '__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:21: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
>> kernel/kthread.c:1328:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro '__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:21: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
>> kernel/kthread.c:1328:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro '__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
>> kernel/kthread.c:1328:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/linux/compiler_types.h:279:13: note: in definition of macro '__unqual_scalar_typeof'
279 | _Generic((x), \
| ^
include/asm-generic/rwonce.h:50:2: note: in expansion of macro '__READ_ONCE'
50 | __READ_ONCE(x); \
| ^~~~~~~~~~~
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
In file included from ./arch/ia64/include/generated/asm/rwonce.h:1,
from include/linux/compiler.h:248,
from include/asm-generic/bug.h:5,
from arch/ia64/include/asm/bug.h:17,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/mm.h:9,
from kernel/kthread.c:11:
>> kernel/kthread.c:1328:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/asm-generic/rwonce.h:44:72: note: in definition of macro '__READ_ONCE'
44 | #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
| ^
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
cc1: some warnings being treated as errors
--
kernel/sched/core.c:2850:6: warning: no previous prototype for 'sched_set_stop_task' [-Wmissing-prototypes]
2850 | void sched_set_stop_task(int cpu, struct task_struct *stop)
| ^~~~~~~~~~~~~~~~~~~
kernel/sched/core.c: In function 'context_switch':
>> kernel/sched/core.c:4312:3: error: implicit declaration of function 'membarrier_finish_switch_mm'; did you mean 'membarrier_switch_mm'? [-Werror=implicit-function-declaration]
4312 | membarrier_finish_switch_mm(rq->membarrier_state);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| membarrier_switch_mm
>> kernel/sched/core.c:4312:33: error: 'struct rq' has no member named 'membarrier_state'
4312 | membarrier_finish_switch_mm(rq->membarrier_state);
| ^~
cc1: some warnings being treated as errors
vim +/membarrier_finish_switch_mm +1328 kernel/kthread.c
1304
1305 /**
1306 * kthread_use_mm - make the calling kthread operate on an address space
1307 * @mm: address space to operate on
1308 */
1309 void kthread_use_mm(struct mm_struct *mm)
1310 {
1311 struct mm_struct *active_mm;
1312 struct task_struct *tsk = current;
1313
1314 WARN_ON_ONCE(!(tsk->flags & PF_KTHREAD));
1315 WARN_ON_ONCE(tsk->mm);
1316
1317 task_lock(tsk);
1318 /* Hold off tlb flush IPIs while switching mm's */
1319 local_irq_disable();
1320 active_mm = tsk->active_mm;
1321 if (active_mm != mm) {
1322 mmgrab(mm);
1323 tsk->active_mm = mm;
1324 }
1325 tsk->mm = mm;
1326 membarrier_update_current_mm(mm);
1327 switch_mm_irqs_off(active_mm, mm, tsk);
> 1328 membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
1329 local_irq_enable();
1330 task_unlock(tsk);
1331 #ifdef finish_arch_post_lock_switch
1332 finish_arch_post_lock_switch();
1333 #endif
1334
1335 if (active_mm != mm)
1336 mmdrop(active_mm);
1337
1338 to_kthread(tsk)->oldfs = force_uaccess_begin();
1339 }
1340 EXPORT_SYMBOL_GPL(kthread_use_mm);
1341
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
Re: [RFC v1 2/6] virtio/vsock: add support for virtio datagram
by kernel test robot
Hi Jiang,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on tip/perf/core linus/master v5.13-rc6]
[cannot apply to next-20210615]
[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/Jiang-Wang/virtio-vsock-introduc...
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: x86_64-randconfig-a015-20210615 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/b156a0ad587c43dbfc98397f01b34fad1...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jiang-Wang/virtio-vsock-introduce-SOCK_DGRAM-support/20210616-120056
git checkout b156a0ad587c43dbfc98397f01b34fad15054bf0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
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 >>):
>> net/vmw_vsock/virtio_transport_common.c:416:6: warning: variable 'free_space' set but not used [-Wunused-but-set-variable]
u32 free_space;
^
1 warning generated.
vim +/free_space +416 net/vmw_vsock/virtio_transport_common.c
408
409 static ssize_t
410 virtio_transport_dgram_do_dequeue(struct vsock_sock *vsk,
411 struct msghdr *msg, size_t len)
412 {
413 struct virtio_vsock_sock *vvs = vsk->trans;
414 struct virtio_vsock_pkt *pkt;
415 size_t total = 0;
> 416 u32 free_space;
417 int err = -EFAULT;
418
419 spin_lock_bh(&vvs->rx_lock);
420 if (total < len && !list_empty(&vvs->rx_queue)) {
421 pkt = list_first_entry(&vvs->rx_queue,
422 struct virtio_vsock_pkt, list);
423
424 total = len;
425 if (total > pkt->len - pkt->off)
426 total = pkt->len - pkt->off;
427 else if (total < pkt->len - pkt->off)
428 msg->msg_flags |= MSG_TRUNC;
429
430 /* sk_lock is held by caller so no one else can dequeue.
431 * Unlock rx_lock since memcpy_to_msg() may sleep.
432 */
433 spin_unlock_bh(&vvs->rx_lock);
434
435 err = memcpy_to_msg(msg, pkt->buf + pkt->off, total);
436 if (err)
437 return err;
438
439 spin_lock_bh(&vvs->rx_lock);
440
441 virtio_transport_dec_rx_pkt(vvs, pkt);
442 list_del(&pkt->list);
443 virtio_transport_free_pkt(pkt);
444 }
445
446 free_space = vvs->buf_alloc - (vvs->fwd_cnt - vvs->last_fwd_cnt);
447
448 spin_unlock_bh(&vvs->rx_lock);
449
450 if (total > 0 && msg->msg_name) {
451 /* Provide the address of the sender. */
452 DECLARE_SOCKADDR(struct sockaddr_vm *, vm_addr, msg->msg_name);
453
454 vsock_addr_init(vm_addr, le64_to_cpu(pkt->hdr.src_cid),
455 le32_to_cpu(pkt->hdr.src_port));
456 msg->msg_namelen = sizeof(*vm_addr);
457 }
458 return total;
459 }
460
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months