[linux-next:master 6887/8703] net/qrtr/qrtr.c:857:20-24: ERROR: invalid reference to the index variable of the iterator on line 848 (fwd)
by Julia Lawall
Hello,
Please check whether the break on line 851 is guaranteed to be taken. If
not, on line 857, node may point to an invalid object.
julia
---------- Forwarded message ----------
Date: Tue, 19 May 2020 08:08:44 +0800
From: kbuild test robot <lkp(a)intel.com>
To: kbuild(a)lists.01.org
Cc: lkp(a)intel.com, Julia Lawall <julia.lawall(a)lip6.fr>
Subject: [linux-next:master 6887/8703] net/qrtr/qrtr.c:857:20-24: ERROR: invalid
reference to the index variable of the iterator on line 848
CC: kbuild-all(a)lists.01.org
TO: Manivannan Sadhasivam <manivannan.sadhasivam(a)linaro.org>
CC: Bjorn Andersson <bjorn.andersson(a)linaro.org>
Hi Manivannan,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: e098d7762d602be640c53565ceca342f81e55ad2
commit: e42671084361302141a09284fde9bbc14fdd16bf [6887/8703] net: qrtr: Do not depend on ARCH_QCOM
config: nds32-randconfig-c003-20200519 (attached as .config)
:::::: branch date: 7 days ago
:::::: commit date: 11 days ago
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
coccinelle warnings: (new ones prefixed by >>)
>> net/qrtr/qrtr.c:857:20-24: ERROR: invalid reference to the index variable of the iterator on line 848
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout e42671084361302141a09284fde9bbc14fdd16bf
vim +857 net/qrtr/qrtr.c
bdabad3e363d825 Courtney Cavin 2016-05-06 839
bdabad3e363d825 Courtney Cavin 2016-05-06 840 /* Queue packet for broadcast. */
e7044482c8ac508 Bjorn Andersson 2017-10-10 841 static int qrtr_bcast_enqueue(struct qrtr_node *node, struct sk_buff *skb,
e7044482c8ac508 Bjorn Andersson 2017-10-10 842 int type, struct sockaddr_qrtr *from,
e7044482c8ac508 Bjorn Andersson 2017-10-10 843 struct sockaddr_qrtr *to)
bdabad3e363d825 Courtney Cavin 2016-05-06 844 {
bdabad3e363d825 Courtney Cavin 2016-05-06 845 struct sk_buff *skbn;
bdabad3e363d825 Courtney Cavin 2016-05-06 846
bdabad3e363d825 Courtney Cavin 2016-05-06 847 mutex_lock(&qrtr_node_lock);
bdabad3e363d825 Courtney Cavin 2016-05-06 @848 list_for_each_entry(node, &qrtr_all_nodes, item) {
bdabad3e363d825 Courtney Cavin 2016-05-06 849 skbn = skb_clone(skb, GFP_KERNEL);
bdabad3e363d825 Courtney Cavin 2016-05-06 850 if (!skbn)
bdabad3e363d825 Courtney Cavin 2016-05-06 851 break;
bdabad3e363d825 Courtney Cavin 2016-05-06 852 skb_set_owner_w(skbn, skb->sk);
e7044482c8ac508 Bjorn Andersson 2017-10-10 853 qrtr_node_enqueue(node, skbn, type, from, to);
bdabad3e363d825 Courtney Cavin 2016-05-06 854 }
bdabad3e363d825 Courtney Cavin 2016-05-06 855 mutex_unlock(&qrtr_node_lock);
bdabad3e363d825 Courtney Cavin 2016-05-06 856
e7044482c8ac508 Bjorn Andersson 2017-10-10 @857 qrtr_local_enqueue(node, skb, type, from, to);
bdabad3e363d825 Courtney Cavin 2016-05-06 858
bdabad3e363d825 Courtney Cavin 2016-05-06 859 return 0;
bdabad3e363d825 Courtney Cavin 2016-05-06 860 }
bdabad3e363d825 Courtney Cavin 2016-05-06 861
:::::: The code at line 857 was first introduced by commit
:::::: e7044482c8ac5081f4775063995647787d5082a4 net: qrtr: Pass source and destination to enqueue functions
:::::: TO: Bjorn Andersson <bjorn.andersson(a)linaro.org>
:::::: CC: David S. Miller <davem(a)davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [PATCH 4/4] thermal: core: genetlink support for events/cmd/sampling
by kbuild test robot
Hi Daniel,
I love your patch! Perhaps something to improve:
[auto build test WARNING on next-20200514]
[cannot apply to linus/master v5.7-rc5 v5.7-rc4 v5.7-rc3 v5.7-rc6]
[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/Daniel-Lezcano/thermal-core-Add-...
base: c9529331c7a22b8eb7eb03e1e0e221d0f58b43de
config: x86_64-rhel-7.6-kselftests (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=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/thermal/thermal_netlink.c:69:5: warning: no previous prototype for 'thermal_genl_sampling_temp' [-Wmissing-prototypes]
int thermal_genl_sampling_temp(int id, int temp)
^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/thermal/thermal_netlink.c:509:5: warning: no previous prototype for 'thermal_genl_cmd_dumpit' [-Wmissing-prototypes]
int thermal_genl_cmd_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/thermal/thermal_netlink.c:535:5: warning: no previous prototype for 'thermal_genl_cmd_doit' [-Wmissing-prototypes]
int thermal_genl_cmd_doit(struct sk_buff *skb, struct genl_info *info)
^~~~~~~~~~~~~~~~~~~~~
vim +/thermal_genl_sampling_temp +69 drivers/thermal/thermal_netlink.c
68
> 69 int thermal_genl_sampling_temp(int id, int temp)
70 {
71 struct sk_buff *skb;
72 void *hdr;
73
74 skb = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
75 if (!skb)
76 return -ENOMEM;
77
78 hdr = genlmsg_put(skb, 0, 0, &thermal_gnl_family, 0,
79 THERMAL_GENL_SAMPLING_TEMP);
80 if (!hdr)
81 return -EMSGSIZE;
82
83 if (nla_put_u32(skb, THERMAL_GENL_ATTR_TZ_ID, id))
84 goto out_cancel;
85
86 if (nla_put_u32(skb, THERMAL_GENL_ATTR_TZ_TEMP, temp))
87 goto out_cancel;
88
89 genlmsg_end(skb, hdr);
90
91 genlmsg_multicast(&thermal_gnl_family, skb, 0, 0, GFP_KERNEL);
92
93 return 0;
94 out_cancel:
95 genlmsg_cancel(skb, hdr);
96 nlmsg_free(skb);
97
98 return -EMSGSIZE;
99 }
100
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[kees:for-next/pstore 8/35] fs//pstore/inode.c:288:16: warning: no previous prototype for 'psinfo_lock_root'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/pstore
head: dcaa1e76b774398d32576838c1352ed57a6d6674
commit: 6bcaa233a90ba3be98a6093cf346ac51eb05258f [8/35] pstore: Add locking around superblock changes
config: alpha-randconfig-r024-20200519 (attached as .config)
compiler: alpha-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
git checkout 6bcaa233a90ba3be98a6093cf346ac51eb05258f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> fs//pstore/inode.c:288:16: warning: no previous prototype for 'psinfo_lock_root' [-Wmissing-prototypes]
288 | struct dentry *psinfo_lock_root(void)
| ^~~~~~~~~~~~~~~~
vim +/psinfo_lock_root +288 fs//pstore/inode.c
287
> 288 struct dentry *psinfo_lock_root(void)
289 {
290 struct dentry *root;
291
292 mutex_lock(&pstore_sb_lock);
293 /*
294 * Having no backend is fine -- no records appear.
295 * Not being mounted is fine -- nothing to do.
296 */
297 if (!psinfo || !pstore_sb) {
298 mutex_unlock(&pstore_sb_lock);
299 return NULL;
300 }
301
302 root = pstore_sb->s_root;
303 inode_lock(d_inode(root));
304 mutex_unlock(&pstore_sb_lock);
305
306 return root;
307 }
308
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [RFC v2 PATCH 5/8] qaic: Implement data path
by kbuild test robot
Hi Jeffrey,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on soc/for-next linus/master v5.7-rc6 next-20200518]
[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/Jeffrey-Hugo/Qualcomm-Cloud-AI-1...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 57c76221d5af648c8355a55c09b050c5d8d38189
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/swait.h:5,
from include/linux/completion.h:12,
from drivers/misc/qaic/qaic_data.c:5:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/xtensa/include/asm/page.h:193:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
193 | ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/xtensa/include/asm/page.h:201:32: note: in expansion of macro 'pfn_valid'
201 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
| ^~~~~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from ./arch/xtensa/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/preempt.h:5,
from ./arch/xtensa/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/swait.h:7,
from include/linux/completion.h:12,
from drivers/misc/qaic/qaic_data.c:5:
include/linux/dma-mapping.h: In function 'dma_map_resource':
arch/xtensa/include/asm/page.h:193:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
193 | ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
| ^~
include/asm-generic/bug.h:139:27: note: in definition of macro 'WARN_ON_ONCE'
139 | int __ret_warn_once = !!(condition); | ^~~~~~~~~
include/linux/dma-mapping.h:352:19: note: in expansion of macro 'pfn_valid'
352 | if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
| ^~~~~~~~~
In file included from include/linux/shm.h:6,
from include/linux/sched.h:16,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from drivers/misc/qaic/qaic_data.c:6:
drivers/misc/qaic/qaic_data.c: In function 'reserve_pages':
arch/xtensa/include/asm/page.h:193:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
193 | ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
| ^~
>> drivers/misc/qaic/qaic_data.c:103:8: note: in expansion of macro 'pfn_valid'
103 | if (!pfn_valid(pfn))
| ^~~~~~~~~
vim +/pfn_valid +103 drivers/misc/qaic/qaic_data.c
94
95 static int reserve_pages(unsigned long start_pfn, unsigned long nr_pages,
96 bool reserve)
97 {
98 unsigned long pfn;
99 unsigned long end_pfn = start_pfn + nr_pages;
100 struct page *page;
101
102 for (pfn = start_pfn; pfn < end_pfn; pfn++) {
> 103 if (!pfn_valid(pfn))
104 return -EINVAL;
105 page = pfn_to_page(pfn);
106 if (reserve)
107 SetPageReserved(page);
108 else
109 ClearPageReserved(page);
110 }
111 return 0;
112 }
113
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[peterz-queue:sched/core 4/9] arch/x86/kernel/smpboot.c:2083: undefined reference to `__udivdi3'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/core
head: 073d35d51f30267ccb43479be42d382f9b03fd9a
commit: df24fd8a5838c3e24dc7a41b37c5812cce80dd43 [4/9] x86, sched: Prevent divisions by zero in frequency invariant accounting
config: i386-randconfig-a011-20200515 (attached as .config)
compiler: gcc-4.9 (Ubuntu 4.9.3-13ubuntu2) 4.9.3
reproduce:
git checkout df24fd8a5838c3e24dc7a41b37c5812cce80dd43
# 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 errors (new ones prefixed by >>, old ones prefixed by <<):
ld: arch/x86/kernel/smpboot.o: in function `arch_scale_freq_tick':
>> arch/x86/kernel/smpboot.c:2083: undefined reference to `__udivdi3'
vim +2083 arch/x86/kernel/smpboot.c
2061
2062 void arch_scale_freq_tick(void)
2063 {
2064 u64 freq_scale = SCHED_CAPACITY_SCALE;
2065 u64 aperf, mperf;
2066 u64 acnt, mcnt;
2067
2068 if (!arch_scale_freq_invariant())
2069 return;
2070
2071 rdmsrl(MSR_IA32_APERF, aperf);
2072 rdmsrl(MSR_IA32_MPERF, mperf);
2073
2074 acnt = aperf - this_cpu_read(arch_prev_aperf);
2075 mcnt = mperf - this_cpu_read(arch_prev_mperf);
2076
2077 this_cpu_write(arch_prev_aperf, aperf);
2078 this_cpu_write(arch_prev_mperf, mperf);
2079
2080 if (check_shl_overflow(acnt, 2*SCHED_CAPACITY_SHIFT, &acnt))
2081 goto error;
2082
> 2083 if (check_mul_overflow(mcnt, arch_max_freq_ratio, &mcnt) || !mcnt)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [RFC v2 PATCH 4/8] qaic: Implement control path
by kbuild test robot
Hi Jeffrey,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on soc/for-next linus/master v5.7-rc6 next-20200518]
[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/Jeffrey-Hugo/Qualcomm-Cloud-AI-1...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 57c76221d5af648c8355a55c09b050c5d8d38189
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
drivers/misc/qaic/qaic_drv.c: In function 'qaic_ioctl':
>> drivers/misc/qaic/qaic_drv.c:150:2: error: case label does not reduce to an integer constant
150 | case QAIC_IOCTL_MANAGE:
| ^~~~
drivers/misc/qaic/qaic_drv.c: At top level:
drivers/misc/qaic/qaic_drv.c:220:6: warning: no previous prototype for 'qaic_dev_reset_clean_local_state' [-Wmissing-prototypes]
220 | void qaic_dev_reset_clean_local_state(struct qaic_device *qdev)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +150 drivers/misc/qaic/qaic_drv.c
127
128 static long qaic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
129 {
130 struct qaic_user *usr = filp->private_data;
131 struct qaic_device *qdev = usr->qdev;
132 int qdev_rcu_id;
133 int usr_rcu_id;
134 int ret;
135
136 usr_rcu_id = srcu_read_lock(&usr->qdev_lock);
137 if (!qdev) {
138 srcu_read_unlock(&usr->qdev_lock, usr_rcu_id);
139 return -ENODEV;
140 }
141
142 qdev_rcu_id = srcu_read_lock(&qdev->dev_lock);
143 if (qdev->in_reset) {
144 srcu_read_unlock(&qdev->dev_lock, qdev_rcu_id);
145 srcu_read_unlock(&usr->qdev_lock, usr_rcu_id);
146 return -ENODEV;
147 }
148
149 switch (cmd) {
> 150 case QAIC_IOCTL_MANAGE:
151 ret = qaic_manage_ioctl(qdev, usr, arg);
152 break;
153 default:
154 ret = -ENOTTY;
155 }
156
157 srcu_read_unlock(&qdev->dev_lock, qdev_rcu_id);
158 srcu_read_unlock(&usr->qdev_lock, usr_rcu_id);
159 return ret;
160 }
161
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
drivers/vhost/vhost.c:1603:13: sparse: sparse: incorrect type in initializer (different address spaces)
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 642b151f45dd54809ea00ecd3976a56c1ec9b53d
commit: 20c384f1ea1a0bc7320bc445c72dd02d2970d594 vhost: refine vhost and vringh kconfig
date: 7 weeks ago
config: m68k-randconfig-s001-20200519 (attached as .config)
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-193-gb8fad4bc-dirty
git checkout 20c384f1ea1a0bc7320bc445c72dd02d2970d594
# save the attached .config to linux build tree
make C=1 ARCH=m68k CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/vhost/vhost.c:1603:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got unsigned int [noderef] [usertypvoid const *__gu_ptr @@
>> drivers/vhost/vhost.c:1603:13: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:1603:13: sparse: got unsigned int [noderef] [usertype] <asn:1> *idxp
>> drivers/vhost/vhost.c:1800:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got int [noderevoid const *__gu_ptr @@
drivers/vhost/vhost.c:1800:21: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:1800:21: sparse: got int [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] <asn:1> * @@ got n:1> * @@
drivers/vhost/vhost.c:753:17: sparse: expected void [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: got void *
drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] <asn:1> * @@ got n:1> * @@
drivers/vhost/vhost.c:753:17: sparse: expected void [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: got void *
drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] <asn:1> * @@ got n:1> * @@
drivers/vhost/vhost.c:753:17: sparse: expected void [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: got void *
drivers/vhost/vhost.c:937:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *addr @@ got restricted __virtio16 [noderef] <asvoid *addr @@
drivers/vhost/vhost.c:937:16: sparse: expected void *addr
drivers/vhost/vhost.c:937:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] <asn:1> *addr @@ got n:1> *addr @@
drivers/vhost/vhost.c:900:42: sparse: expected void [noderef] <asn:1> *addr
drivers/vhost/vhost.c:900:42: sparse: got void *addr
drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] <asn:1> * @@ got n:1> * @@
drivers/vhost/vhost.c:753:17: sparse: expected void [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: got void *
drivers/vhost/vhost.c:922:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *addr @@ got restricted __virtio16 [noderef] [usertype] <asvoid *addr @@
drivers/vhost/vhost.c:922:16: sparse: expected void *addr
drivers/vhost/vhost.c:922:16: sparse: got restricted __virtio16 [noderef] [usertype] <asn:1> *
drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] <asn:1> *addr @@ got n:1> *addr @@
drivers/vhost/vhost.c:900:42: sparse: expected void [noderef] <asn:1> *addr
drivers/vhost/vhost.c:900:42: sparse: got void *addr
drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] <asn:1> * @@ got n:1> * @@
drivers/vhost/vhost.c:753:17: sparse: expected void [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: got void *
>> drivers/vhost/vhost.c:1014:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderevoid const *__gu_ptr @@
drivers/vhost/vhost.c:1014:16: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:1014:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
drivers/vhost/vhost.c:1014:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *addr @@ got restricted __virtio16 [noderef] <asvoid *addr @@
drivers/vhost/vhost.c:1014:16: sparse: expected void *addr
drivers/vhost/vhost.c:1014:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
>> drivers/vhost/vhost.c:1014:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderevoid const *__gu_ptr @@
drivers/vhost/vhost.c:1014:16: sparse: expected void const *__gu_ptr
>> drivers/vhost/vhost.c:1014:16: sparse: got restricted __virtio16 [noderef] <asn:1> *from
drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] <asn:1> *addr @@ got n:1> *addr @@
drivers/vhost/vhost.c:900:42: sparse: expected void [noderef] <asn:1> *addr
drivers/vhost/vhost.c:900:42: sparse: got void *addr
drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] <asn:1> * @@ got n:1> * @@
drivers/vhost/vhost.c:753:17: sparse: expected void [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: got void *
drivers/vhost/vhost.c:989:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderevoid const *__gu_ptr @@
drivers/vhost/vhost.c:989:16: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:989:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
drivers/vhost/vhost.c:989:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *addr @@ got restricted __virtio16 [noderef] <asvoid *addr @@
drivers/vhost/vhost.c:989:16: sparse: expected void *addr
drivers/vhost/vhost.c:989:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
drivers/vhost/vhost.c:989:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderevoid const *__gu_ptr @@
drivers/vhost/vhost.c:989:16: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:989:16: sparse: got restricted __virtio16 [noderef] <asn:1> *from
drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] <asn:1> *addr @@ got n:1> *addr @@
drivers/vhost/vhost.c:900:42: sparse: expected void [noderef] <asn:1> *addr
drivers/vhost/vhost.c:900:42: sparse: got void *addr
drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] <asn:1> * @@ got n:1> * @@
drivers/vhost/vhost.c:753:17: sparse: expected void [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: got void *
drivers/vhost/vhost.c:995:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderevoid const *__gu_ptr @@
drivers/vhost/vhost.c:995:16: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:995:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
drivers/vhost/vhost.c:995:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *addr @@ got restricted __virtio16 [noderef] <asvoid *addr @@
drivers/vhost/vhost.c:995:16: sparse: expected void *addr
drivers/vhost/vhost.c:995:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
drivers/vhost/vhost.c:995:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderevoid const *__gu_ptr @@
drivers/vhost/vhost.c:995:16: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:995:16: sparse: got restricted __virtio16 [noderef] <asn:1> *from
drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] <asn:1> *addr @@ got n:1> *addr @@
drivers/vhost/vhost.c:900:42: sparse: expected void [noderef] <asn:1> *addr
drivers/vhost/vhost.c:900:42: sparse: got void *addr
drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] <asn:1> * @@ got n:1> * @@
drivers/vhost/vhost.c:753:17: sparse: expected void [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: got void *
drivers/vhost/vhost.c:944:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *addr @@ got restricted __virtio16 [noderef] <asvoid *addr @@
drivers/vhost/vhost.c:944:16: sparse: expected void *addr
drivers/vhost/vhost.c:944:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] <asn:1> *addr @@ got n:1> *addr @@
drivers/vhost/vhost.c:900:42: sparse: expected void [noderef] <asn:1> *addr
drivers/vhost/vhost.c:900:42: sparse: got void *addr
drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] <asn:1> * @@ got n:1> * @@
drivers/vhost/vhost.c:753:17: sparse: expected void [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: got void *
drivers/vhost/vhost.c:1002:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderevoid const *__gu_ptr @@
drivers/vhost/vhost.c:1002:16: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:1002:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
drivers/vhost/vhost.c:1002:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *addr @@ got restricted __virtio16 [noderef] <asvoid *addr @@
drivers/vhost/vhost.c:1002:16: sparse: expected void *addr
drivers/vhost/vhost.c:1002:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
drivers/vhost/vhost.c:1002:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderevoid const *__gu_ptr @@
drivers/vhost/vhost.c:1002:16: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:1002:16: sparse: got restricted __virtio16 [noderef] <asn:1> *from
drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] <asn:1> *addr @@ got n:1> *addr @@
drivers/vhost/vhost.c:900:42: sparse: expected void [noderef] <asn:1> *addr
drivers/vhost/vhost.c:900:42: sparse: got void *addr
drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] <asn:1> * @@ got n:1> * @@
drivers/vhost/vhost.c:753:17: sparse: expected void [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: got void *
>> drivers/vhost/vhost.c:1008:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderef] [usertypvoid const *__gu_ptr @@
drivers/vhost/vhost.c:1008:16: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:1008:16: sparse: got restricted __virtio16 [noderef] [usertype] <asn:1> *
drivers/vhost/vhost.c:1008:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *addr @@ got restricted __virtio16 [noderef] [usertype] <asvoid *addr @@
drivers/vhost/vhost.c:1008:16: sparse: expected void *addr
drivers/vhost/vhost.c:1008:16: sparse: got restricted __virtio16 [noderef] [usertype] <asn:1> *
>> drivers/vhost/vhost.c:1008:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderef] [usertypvoid const *__gu_ptr @@
drivers/vhost/vhost.c:1008:16: sparse: expected void const *__gu_ptr
>> drivers/vhost/vhost.c:1008:16: sparse: got restricted __virtio16 [noderef] [usertype] <asn:1> *from
drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] <asn:1> *addr @@ got n:1> *addr @@
drivers/vhost/vhost.c:900:42: sparse: expected void [noderef] <asn:1> *addr
drivers/vhost/vhost.c:900:42: sparse: got void *addr
drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] <asn:1> * @@ got n:1> * @@
drivers/vhost/vhost.c:753:17: sparse: expected void [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: got void *
drivers/vhost/vhost.c:989:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderevoid const *__gu_ptr @@
drivers/vhost/vhost.c:989:16: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:989:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
drivers/vhost/vhost.c:989:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *addr @@ got restricted __virtio16 [noderef] <asvoid *addr @@
drivers/vhost/vhost.c:989:16: sparse: expected void *addr
drivers/vhost/vhost.c:989:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
drivers/vhost/vhost.c:989:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderevoid const *__gu_ptr @@
drivers/vhost/vhost.c:989:16: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:989:16: sparse: got restricted __virtio16 [noderef] <asn:1> *from
drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] <asn:1> *addr @@ got n:1> *addr @@
drivers/vhost/vhost.c:900:42: sparse: expected void [noderef] <asn:1> *addr
drivers/vhost/vhost.c:900:42: sparse: got void *addr
drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] <asn:1> * @@ got n:1> * @@
drivers/vhost/vhost.c:753:17: sparse: expected void [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: got void *
drivers/vhost/vhost.c:989:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderevoid const *__gu_ptr @@
drivers/vhost/vhost.c:989:16: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:989:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
drivers/vhost/vhost.c:989:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *addr @@ got restricted __virtio16 [noderef] <asvoid *addr @@
drivers/vhost/vhost.c:989:16: sparse: expected void *addr
drivers/vhost/vhost.c:989:16: sparse: got restricted __virtio16 [noderef] <asn:1> *
drivers/vhost/vhost.c:989:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got restricted __virtio16 [noderevoid const *__gu_ptr @@
drivers/vhost/vhost.c:989:16: sparse: expected void const *__gu_ptr
drivers/vhost/vhost.c:989:16: sparse: got restricted __virtio16 [noderef] <asn:1> *from
drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] <asn:1> *addr @@ got n:1> *addr @@
drivers/vhost/vhost.c:900:42: sparse: expected void [noderef] <asn:1> *addr
drivers/vhost/vhost.c:900:42: sparse: got void *addr
drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] <asn:1> * @@ got n:1> * @@
drivers/vhost/vhost.c:753:17: sparse: expected void [noderef] <asn:1> *
drivers/vhost/vhost.c:753:17: sparse: got void *
--
drivers/vhost/scsi.c:1218:30: sparse: sparse: restricted __virtio32 degrades to integer
drivers/vhost/scsi.c:1218:30: sparse: sparse: restricted __virtio32 degrades to integer
>> drivers/vhost/scsi.c:1697:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__gu_ptr @@ got unsigned int [noderef] [usertypvoid const *__gu_ptr @@
>> drivers/vhost/scsi.c:1697:21: sparse: expected void const *__gu_ptr
drivers/vhost/scsi.c:1697:21: sparse: got unsigned int [noderef] [usertype] <asn:1> *eventsp
vim +1603 drivers/vhost/vhost.c
feebcaeac79ad86 Jason Wang 2019-05-24 1566
feebcaeac79ad86 Jason Wang 2019-05-24 1567 static long vhost_vring_set_num_addr(struct vhost_dev *d,
feebcaeac79ad86 Jason Wang 2019-05-24 1568 struct vhost_virtqueue *vq,
feebcaeac79ad86 Jason Wang 2019-05-24 1569 unsigned int ioctl,
feebcaeac79ad86 Jason Wang 2019-05-24 1570 void __user *argp)
feebcaeac79ad86 Jason Wang 2019-05-24 1571 {
feebcaeac79ad86 Jason Wang 2019-05-24 1572 long r;
feebcaeac79ad86 Jason Wang 2019-05-24 1573
feebcaeac79ad86 Jason Wang 2019-05-24 1574 mutex_lock(&vq->mutex);
feebcaeac79ad86 Jason Wang 2019-05-24 1575
feebcaeac79ad86 Jason Wang 2019-05-24 1576 switch (ioctl) {
feebcaeac79ad86 Jason Wang 2019-05-24 1577 case VHOST_SET_VRING_NUM:
feebcaeac79ad86 Jason Wang 2019-05-24 1578 r = vhost_vring_set_num(d, vq, argp);
feebcaeac79ad86 Jason Wang 2019-05-24 1579 break;
feebcaeac79ad86 Jason Wang 2019-05-24 1580 case VHOST_SET_VRING_ADDR:
feebcaeac79ad86 Jason Wang 2019-05-24 1581 r = vhost_vring_set_addr(d, vq, argp);
feebcaeac79ad86 Jason Wang 2019-05-24 1582 break;
feebcaeac79ad86 Jason Wang 2019-05-24 1583 default:
feebcaeac79ad86 Jason Wang 2019-05-24 1584 BUG();
feebcaeac79ad86 Jason Wang 2019-05-24 1585 }
feebcaeac79ad86 Jason Wang 2019-05-24 1586
feebcaeac79ad86 Jason Wang 2019-05-24 1587 mutex_unlock(&vq->mutex);
feebcaeac79ad86 Jason Wang 2019-05-24 1588
feebcaeac79ad86 Jason Wang 2019-05-24 1589 return r;
feebcaeac79ad86 Jason Wang 2019-05-24 1590 }
26b36604523f4a6 Sonny Rao 2018-03-14 1591 long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp)
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1592 {
cecb46f194460d2 Al Viro 2012-08-27 1593 struct file *eventfp, *filep = NULL;
cecb46f194460d2 Al Viro 2012-08-27 1594 bool pollstart = false, pollstop = false;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1595 struct eventfd_ctx *ctx = NULL;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1596 u32 __user *idxp = argp;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1597 struct vhost_virtqueue *vq;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1598 struct vhost_vring_state s;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1599 struct vhost_vring_file f;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1600 u32 idx;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1601 long r;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1602
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 @1603 r = get_user(idx, idxp);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1604 if (r < 0)
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1605 return r;
0f3d9a17469d71b Krishna Kumar 2010-05-25 1606 if (idx >= d->nvqs)
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1607 return -ENOBUFS;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1608
ff002269a4ee9c7 Jason Wang 2018-10-30 1609 idx = array_index_nospec(idx, d->nvqs);
3ab2e420ec1caf4 Asias He 2013-04-27 1610 vq = d->vqs[idx];
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1611
feebcaeac79ad86 Jason Wang 2019-05-24 1612 if (ioctl == VHOST_SET_VRING_NUM ||
feebcaeac79ad86 Jason Wang 2019-05-24 1613 ioctl == VHOST_SET_VRING_ADDR) {
feebcaeac79ad86 Jason Wang 2019-05-24 1614 return vhost_vring_set_num_addr(d, vq, ioctl, argp);
feebcaeac79ad86 Jason Wang 2019-05-24 1615 }
feebcaeac79ad86 Jason Wang 2019-05-24 1616
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1617 mutex_lock(&vq->mutex);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1618
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1619 switch (ioctl) {
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1620 case VHOST_SET_VRING_BASE:
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1621 /* Moving base with an active backend?
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1622 * You don't want to do that. */
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1623 if (vq->private_data) {
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1624 r = -EBUSY;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1625 break;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1626 }
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1627 if (copy_from_user(&s, argp, sizeof s)) {
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1628 r = -EFAULT;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1629 break;
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1630 }
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1631 if (s.num > 0xffff) {
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1632 r = -EINVAL;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1633 break;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1634 }
8d65843c44269c2 Jason Wang 2017-07-27 1635 vq->last_avail_idx = s.num;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1636 /* Forget the cached index value. */
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1637 vq->avail_idx = vq->last_avail_idx;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1638 break;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1639 case VHOST_GET_VRING_BASE:
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1640 s.index = idx;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1641 s.num = vq->last_avail_idx;
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1642 if (copy_to_user(argp, &s, sizeof s))
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1643 r = -EFAULT;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1644 break;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1645 case VHOST_SET_VRING_KICK:
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1646 if (copy_from_user(&f, argp, sizeof f)) {
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1647 r = -EFAULT;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1648 break;
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1649 }
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1650 eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd);
535297a6ae4c3b7 Michael S. Tsirkin 2010-03-17 1651 if (IS_ERR(eventfp)) {
535297a6ae4c3b7 Michael S. Tsirkin 2010-03-17 1652 r = PTR_ERR(eventfp);
535297a6ae4c3b7 Michael S. Tsirkin 2010-03-17 1653 break;
535297a6ae4c3b7 Michael S. Tsirkin 2010-03-17 1654 }
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1655 if (eventfp != vq->kick) {
cecb46f194460d2 Al Viro 2012-08-27 1656 pollstop = (filep = vq->kick) != NULL;
cecb46f194460d2 Al Viro 2012-08-27 1657 pollstart = (vq->kick = eventfp) != NULL;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1658 } else
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1659 filep = eventfp;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1660 break;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1661 case VHOST_SET_VRING_CALL:
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1662 if (copy_from_user(&f, argp, sizeof f)) {
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1663 r = -EFAULT;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1664 break;
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1665 }
e050c7d93f4adb2 Eric Biggers 2018-01-06 1666 ctx = f.fd == -1 ? NULL : eventfd_ctx_fdget(f.fd);
e050c7d93f4adb2 Eric Biggers 2018-01-06 1667 if (IS_ERR(ctx)) {
e050c7d93f4adb2 Eric Biggers 2018-01-06 1668 r = PTR_ERR(ctx);
535297a6ae4c3b7 Michael S. Tsirkin 2010-03-17 1669 break;
535297a6ae4c3b7 Michael S. Tsirkin 2010-03-17 1670 }
e050c7d93f4adb2 Eric Biggers 2018-01-06 1671 swap(ctx, vq->call_ctx);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1672 break;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1673 case VHOST_SET_VRING_ERR:
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1674 if (copy_from_user(&f, argp, sizeof f)) {
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1675 r = -EFAULT;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1676 break;
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1677 }
09f332a589232f5 Eric Biggers 2018-01-06 1678 ctx = f.fd == -1 ? NULL : eventfd_ctx_fdget(f.fd);
09f332a589232f5 Eric Biggers 2018-01-06 1679 if (IS_ERR(ctx)) {
09f332a589232f5 Eric Biggers 2018-01-06 1680 r = PTR_ERR(ctx);
535297a6ae4c3b7 Michael S. Tsirkin 2010-03-17 1681 break;
535297a6ae4c3b7 Michael S. Tsirkin 2010-03-17 1682 }
09f332a589232f5 Eric Biggers 2018-01-06 1683 swap(ctx, vq->error_ctx);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1684 break;
2751c9882b94729 Greg Kurz 2015-04-24 1685 case VHOST_SET_VRING_ENDIAN:
2751c9882b94729 Greg Kurz 2015-04-24 1686 r = vhost_set_vring_endian(vq, argp);
2751c9882b94729 Greg Kurz 2015-04-24 1687 break;
2751c9882b94729 Greg Kurz 2015-04-24 1688 case VHOST_GET_VRING_ENDIAN:
2751c9882b94729 Greg Kurz 2015-04-24 1689 r = vhost_get_vring_endian(vq, idx, argp);
2751c9882b94729 Greg Kurz 2015-04-24 1690 break;
030881372460654 Jason Wang 2016-03-04 1691 case VHOST_SET_VRING_BUSYLOOP_TIMEOUT:
030881372460654 Jason Wang 2016-03-04 1692 if (copy_from_user(&s, argp, sizeof(s))) {
030881372460654 Jason Wang 2016-03-04 1693 r = -EFAULT;
030881372460654 Jason Wang 2016-03-04 1694 break;
030881372460654 Jason Wang 2016-03-04 1695 }
030881372460654 Jason Wang 2016-03-04 1696 vq->busyloop_timeout = s.num;
030881372460654 Jason Wang 2016-03-04 1697 break;
030881372460654 Jason Wang 2016-03-04 1698 case VHOST_GET_VRING_BUSYLOOP_TIMEOUT:
030881372460654 Jason Wang 2016-03-04 1699 s.index = idx;
030881372460654 Jason Wang 2016-03-04 1700 s.num = vq->busyloop_timeout;
030881372460654 Jason Wang 2016-03-04 1701 if (copy_to_user(argp, &s, sizeof(s)))
030881372460654 Jason Wang 2016-03-04 1702 r = -EFAULT;
030881372460654 Jason Wang 2016-03-04 1703 break;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1704 default:
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1705 r = -ENOIOCTLCMD;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1706 }
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1707
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1708 if (pollstop && vq->handle_kick)
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1709 vhost_poll_stop(&vq->poll);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1710
e050c7d93f4adb2 Eric Biggers 2018-01-06 1711 if (!IS_ERR_OR_NULL(ctx))
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1712 eventfd_ctx_put(ctx);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1713 if (filep)
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1714 fput(filep);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1715
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1716 if (pollstart && vq->handle_kick)
2b8b328b61c7999 Jason Wang 2013-01-28 1717 r = vhost_poll_start(&vq->poll, vq->kick);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1718
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1719 mutex_unlock(&vq->mutex);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1720
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1721 if (pollstop && vq->handle_kick)
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1722 vhost_poll_flush(&vq->poll);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1723 return r;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1724 }
6ac1afbf6132df0 Asias He 2013-05-06 1725 EXPORT_SYMBOL_GPL(vhost_vring_ioctl);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1726
6b1e6cc7855b09a Jason Wang 2016-06-23 1727 int vhost_init_device_iotlb(struct vhost_dev *d, bool enabled)
6b1e6cc7855b09a Jason Wang 2016-06-23 1728 {
6b1e6cc7855b09a Jason Wang 2016-06-23 1729 struct vhost_umem *niotlb, *oiotlb;
6b1e6cc7855b09a Jason Wang 2016-06-23 1730 int i;
6b1e6cc7855b09a Jason Wang 2016-06-23 1731
6b1e6cc7855b09a Jason Wang 2016-06-23 1732 niotlb = vhost_umem_alloc();
6b1e6cc7855b09a Jason Wang 2016-06-23 1733 if (!niotlb)
6b1e6cc7855b09a Jason Wang 2016-06-23 1734 return -ENOMEM;
6b1e6cc7855b09a Jason Wang 2016-06-23 1735
6b1e6cc7855b09a Jason Wang 2016-06-23 1736 oiotlb = d->iotlb;
6b1e6cc7855b09a Jason Wang 2016-06-23 1737 d->iotlb = niotlb;
6b1e6cc7855b09a Jason Wang 2016-06-23 1738
6b1e6cc7855b09a Jason Wang 2016-06-23 1739 for (i = 0; i < d->nvqs; ++i) {
b13f9c6364373a1 Jason Wang 2018-08-08 1740 struct vhost_virtqueue *vq = d->vqs[i];
b13f9c6364373a1 Jason Wang 2018-08-08 1741
b13f9c6364373a1 Jason Wang 2018-08-08 1742 mutex_lock(&vq->mutex);
b13f9c6364373a1 Jason Wang 2018-08-08 1743 vq->iotlb = niotlb;
b13f9c6364373a1 Jason Wang 2018-08-08 1744 __vhost_vq_meta_reset(vq);
b13f9c6364373a1 Jason Wang 2018-08-08 1745 mutex_unlock(&vq->mutex);
6b1e6cc7855b09a Jason Wang 2016-06-23 1746 }
6b1e6cc7855b09a Jason Wang 2016-06-23 1747
6b1e6cc7855b09a Jason Wang 2016-06-23 1748 vhost_umem_clean(oiotlb);
6b1e6cc7855b09a Jason Wang 2016-06-23 1749
6b1e6cc7855b09a Jason Wang 2016-06-23 1750 return 0;
6b1e6cc7855b09a Jason Wang 2016-06-23 1751 }
6b1e6cc7855b09a Jason Wang 2016-06-23 1752 EXPORT_SYMBOL_GPL(vhost_init_device_iotlb);
6b1e6cc7855b09a Jason Wang 2016-06-23 1753
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1754 /* Caller must have device mutex */
935cdee7ee15956 Michael S. Tsirkin 2012-12-06 1755 long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp)
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1756 {
d25cc43c6775bff Eric Biggers 2018-01-06 1757 struct eventfd_ctx *ctx;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1758 u64 p;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1759 long r;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1760 int i, fd;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1761
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1762 /* If you are not the owner, you can become one */
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1763 if (ioctl == VHOST_SET_OWNER) {
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1764 r = vhost_dev_set_owner(d);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1765 goto done;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1766 }
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1767
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1768 /* You must be the owner to do anything else */
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1769 r = vhost_dev_check_owner(d);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1770 if (r)
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1771 goto done;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1772
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1773 switch (ioctl) {
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1774 case VHOST_SET_MEM_TABLE:
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1775 r = vhost_set_memory(d, argp);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1776 break;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1777 case VHOST_SET_LOG_BASE:
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1778 if (copy_from_user(&p, argp, sizeof p)) {
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1779 r = -EFAULT;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1780 break;
7ad9c9d27048547 Takuya Yoshikawa 2010-05-27 1781 }
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1782 if ((u64)(unsigned long)p != p) {
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1783 r = -EFAULT;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1784 break;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1785 }
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1786 for (i = 0; i < d->nvqs; ++i) {
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1787 struct vhost_virtqueue *vq;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1788 void __user *base = (void __user *)(unsigned long)p;
3ab2e420ec1caf4 Asias He 2013-04-27 1789 vq = d->vqs[i];
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1790 mutex_lock(&vq->mutex);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1791 /* If ring is inactive, will check when it's enabled. */
ea16c51433510f7 Michael S. Tsirkin 2014-06-05 1792 if (vq->private_data && !vq_log_access_ok(vq, base))
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1793 r = -EFAULT;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1794 else
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1795 vq->log_base = base;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1796 mutex_unlock(&vq->mutex);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1797 }
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1798 break;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1799 case VHOST_SET_LOG_FD:
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 @1800 r = get_user(fd, (int __user *)argp);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1801 if (r < 0)
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1802 break;
d25cc43c6775bff Eric Biggers 2018-01-06 1803 ctx = fd == -1 ? NULL : eventfd_ctx_fdget(fd);
d25cc43c6775bff Eric Biggers 2018-01-06 1804 if (IS_ERR(ctx)) {
d25cc43c6775bff Eric Biggers 2018-01-06 1805 r = PTR_ERR(ctx);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1806 break;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1807 }
d25cc43c6775bff Eric Biggers 2018-01-06 1808 swap(ctx, d->log_ctx);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1809 for (i = 0; i < d->nvqs; ++i) {
3ab2e420ec1caf4 Asias He 2013-04-27 1810 mutex_lock(&d->vqs[i]->mutex);
3ab2e420ec1caf4 Asias He 2013-04-27 1811 d->vqs[i]->log_ctx = d->log_ctx;
3ab2e420ec1caf4 Asias He 2013-04-27 1812 mutex_unlock(&d->vqs[i]->mutex);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1813 }
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1814 if (ctx)
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1815 eventfd_ctx_put(ctx);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1816 break;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1817 default:
935cdee7ee15956 Michael S. Tsirkin 2012-12-06 1818 r = -ENOIOCTLCMD;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1819 break;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1820 }
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1821 done:
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1822 return r;
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1823 }
6ac1afbf6132df0 Asias He 2013-05-06 1824 EXPORT_SYMBOL_GPL(vhost_dev_ioctl);
3a4d5c94e959359 Michael S. Tsirkin 2010-01-14 1825
:::::: The code at line 1603 was first introduced by commit
:::::: 3a4d5c94e959359ece6d6b55045c3f046677f55c vhost_net: a kernel-level virtio server
:::::: TO: Michael S. Tsirkin <mst(a)redhat.com>
:::::: CC: David S. Miller <davem(a)davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [PATCH bpf-next v3 07/15] i40e: separate kernel allocated rx_bi rings from AF_XDP rings
by kbuild test robot
Hi "Björn,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
[also build test WARNING on jkirsher-next-queue/dev-queue next-20200518]
[cannot apply to bpf/master linus/master v5.7-rc6]
[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/Bj-rn-T-pel/Introduce-AF_XDP-buf...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
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
# 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: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/net/ethernet/intel/i40e/i40e_txrx.c:531:6: warning: no previous prototype for function 'i40e_fd_handle_status' [-Wmissing-prototypes]
void i40e_fd_handle_status(struct i40e_ring *rx_ring, u64 qword0_raw,
^
drivers/net/ethernet/intel/i40e/i40e_txrx.c:531:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void i40e_fd_handle_status(struct i40e_ring *rx_ring, u64 qword0_raw,
^
static
1 warning generated.
vim +/i40e_fd_handle_status +531 drivers/net/ethernet/intel/i40e/i40e_txrx.c
520
521 /**
522 * i40e_fd_handle_status - check the Programming Status for FD
523 * @rx_ring: the Rx ring for this descriptor
524 * @qword0_raw: qword0
525 * @qword1: qword1 after le_to_cpu
526 * @prog_id: the id originally used for programming
527 *
528 * This is used to verify if the FD programming or invalidation
529 * requested by SW to the HW is successful or not and take actions accordingly.
530 **/
> 531 void i40e_fd_handle_status(struct i40e_ring *rx_ring, u64 qword0_raw,
532 u64 qword1, u8 prog_id)
533 {
534 struct i40e_pf *pf = rx_ring->vsi->back;
535 struct pci_dev *pdev = pf->pdev;
536 struct i40e_32b_rx_wb_qw0 *qw0;
537 u32 fcnt_prog, fcnt_avail;
538 u32 error;
539
540 qw0 = (struct i40e_32b_rx_wb_qw0 *)&qword0_raw;
541 error = (qword1 & I40E_RX_PROG_STATUS_DESC_QW1_ERROR_MASK) >>
542 I40E_RX_PROG_STATUS_DESC_QW1_ERROR_SHIFT;
543
544 if (error == BIT(I40E_RX_PROG_STATUS_DESC_FD_TBL_FULL_SHIFT)) {
545 pf->fd_inv = le32_to_cpu(qw0->hi_dword.fd_id);
546 if (qw0->hi_dword.fd_id != 0 ||
547 (I40E_DEBUG_FD & pf->hw.debug_mask))
548 dev_warn(&pdev->dev, "ntuple filter loc = %d, could not be added\n",
549 pf->fd_inv);
550
551 /* Check if the programming error is for ATR.
552 * If so, auto disable ATR and set a state for
553 * flush in progress. Next time we come here if flush is in
554 * progress do nothing, once flush is complete the state will
555 * be cleared.
556 */
557 if (test_bit(__I40E_FD_FLUSH_REQUESTED, pf->state))
558 return;
559
560 pf->fd_add_err++;
561 /* store the current atr filter count */
562 pf->fd_atr_cnt = i40e_get_current_atr_cnt(pf);
563
564 if (qw0->hi_dword.fd_id == 0 &&
565 test_bit(__I40E_FD_SB_AUTO_DISABLED, pf->state)) {
566 /* These set_bit() calls aren't atomic with the
567 * test_bit() here, but worse case we potentially
568 * disable ATR and queue a flush right after SB
569 * support is re-enabled. That shouldn't cause an
570 * issue in practice
571 */
572 set_bit(__I40E_FD_ATR_AUTO_DISABLED, pf->state);
573 set_bit(__I40E_FD_FLUSH_REQUESTED, pf->state);
574 }
575
576 /* filter programming failed most likely due to table full */
577 fcnt_prog = i40e_get_global_fd_count(pf);
578 fcnt_avail = pf->fdir_pf_filter_count;
579 /* If ATR is running fcnt_prog can quickly change,
580 * if we are very close to full, it makes sense to disable
581 * FD ATR/SB and then re-enable it when there is room.
582 */
583 if (fcnt_prog >= (fcnt_avail - I40E_FDIR_BUFFER_FULL_MARGIN)) {
584 if ((pf->flags & I40E_FLAG_FD_SB_ENABLED) &&
585 !test_and_set_bit(__I40E_FD_SB_AUTO_DISABLED,
586 pf->state))
587 if (I40E_DEBUG_FD & pf->hw.debug_mask)
588 dev_warn(&pdev->dev, "FD filter space full, new ntuple rules will not be added\n");
589 }
590 } else if (error == BIT(I40E_RX_PROG_STATUS_DESC_NO_FD_ENTRY_SHIFT)) {
591 if (I40E_DEBUG_FD & pf->hw.debug_mask)
592 dev_info(&pdev->dev, "ntuple filter fd_id = %d, could not be removed\n",
593 qw0->hi_dword.fd_id);
594 }
595 }
596
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [PATCH bpf-next v3 07/15] i40e: separate kernel allocated rx_bi rings from AF_XDP rings
by kbuild test robot
Hi "Björn,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
[also build test WARNING on jkirsher-next-queue/dev-queue next-20200518]
[cannot apply to bpf/master linus/master v5.7-rc6]
[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/Bj-rn-T-pel/Introduce-AF_XDP-buf...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/net/ethernet/intel/i40e/i40e_txrx.c:531:6: warning: no previous prototype for 'i40e_fd_handle_status' [-Wmissing-prototypes]
531 | void i40e_fd_handle_status(struct i40e_ring *rx_ring, u64 qword0_raw,
| ^~~~~~~~~~~~~~~~~~~~~
vim +/i40e_fd_handle_status +531 drivers/net/ethernet/intel/i40e/i40e_txrx.c
520
521 /**
522 * i40e_fd_handle_status - check the Programming Status for FD
523 * @rx_ring: the Rx ring for this descriptor
524 * @qword0_raw: qword0
525 * @qword1: qword1 after le_to_cpu
526 * @prog_id: the id originally used for programming
527 *
528 * This is used to verify if the FD programming or invalidation
529 * requested by SW to the HW is successful or not and take actions accordingly.
530 **/
> 531 void i40e_fd_handle_status(struct i40e_ring *rx_ring, u64 qword0_raw,
532 u64 qword1, u8 prog_id)
533 {
534 struct i40e_pf *pf = rx_ring->vsi->back;
535 struct pci_dev *pdev = pf->pdev;
536 struct i40e_32b_rx_wb_qw0 *qw0;
537 u32 fcnt_prog, fcnt_avail;
538 u32 error;
539
540 qw0 = (struct i40e_32b_rx_wb_qw0 *)&qword0_raw;
541 error = (qword1 & I40E_RX_PROG_STATUS_DESC_QW1_ERROR_MASK) >>
542 I40E_RX_PROG_STATUS_DESC_QW1_ERROR_SHIFT;
543
544 if (error == BIT(I40E_RX_PROG_STATUS_DESC_FD_TBL_FULL_SHIFT)) {
545 pf->fd_inv = le32_to_cpu(qw0->hi_dword.fd_id);
546 if (qw0->hi_dword.fd_id != 0 ||
547 (I40E_DEBUG_FD & pf->hw.debug_mask))
548 dev_warn(&pdev->dev, "ntuple filter loc = %d, could not be added\n",
549 pf->fd_inv);
550
551 /* Check if the programming error is for ATR.
552 * If so, auto disable ATR and set a state for
553 * flush in progress. Next time we come here if flush is in
554 * progress do nothing, once flush is complete the state will
555 * be cleared.
556 */
557 if (test_bit(__I40E_FD_FLUSH_REQUESTED, pf->state))
558 return;
559
560 pf->fd_add_err++;
561 /* store the current atr filter count */
562 pf->fd_atr_cnt = i40e_get_current_atr_cnt(pf);
563
564 if (qw0->hi_dword.fd_id == 0 &&
565 test_bit(__I40E_FD_SB_AUTO_DISABLED, pf->state)) {
566 /* These set_bit() calls aren't atomic with the
567 * test_bit() here, but worse case we potentially
568 * disable ATR and queue a flush right after SB
569 * support is re-enabled. That shouldn't cause an
570 * issue in practice
571 */
572 set_bit(__I40E_FD_ATR_AUTO_DISABLED, pf->state);
573 set_bit(__I40E_FD_FLUSH_REQUESTED, pf->state);
574 }
575
576 /* filter programming failed most likely due to table full */
577 fcnt_prog = i40e_get_global_fd_count(pf);
578 fcnt_avail = pf->fdir_pf_filter_count;
579 /* If ATR is running fcnt_prog can quickly change,
580 * if we are very close to full, it makes sense to disable
581 * FD ATR/SB and then re-enable it when there is room.
582 */
583 if (fcnt_prog >= (fcnt_avail - I40E_FDIR_BUFFER_FULL_MARGIN)) {
584 if ((pf->flags & I40E_FLAG_FD_SB_ENABLED) &&
585 !test_and_set_bit(__I40E_FD_SB_AUTO_DISABLED,
586 pf->state))
587 if (I40E_DEBUG_FD & pf->hw.debug_mask)
588 dev_warn(&pdev->dev, "FD filter space full, new ntuple rules will not be added\n");
589 }
590 } else if (error == BIT(I40E_RX_PROG_STATUS_DESC_NO_FD_ENTRY_SHIFT)) {
591 if (I40E_DEBUG_FD & pf->hw.debug_mask)
592 dev_info(&pdev->dev, "ntuple filter fd_id = %d, could not be removed\n",
593 qw0->hi_dword.fd_id);
594 }
595 }
596
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[danielt-linux:kgdb/for-next 9/14] drivers/tty/serial/kgdboc.c:410:13: error: expected parameter declarator
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux.git kgdb/for-next
head: 3dc6a1ac3f70f1e4530132bd231599e0a91d5b5d
commit: eae3e19ca930a56c726fbf4dc3adc198b8f5d61d [9/14] kgdboc: Remove useless #ifdef CONFIG_KGDB_SERIAL_CONSOLE in kgdboc
config: x86_64-allmodconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
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
git checkout eae3e19ca930a56c726fbf4dc3adc198b8f5d61d
# 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: kbuild test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/tty/serial/kgdboc.c:410:13: error: expected parameter declarator
early_param("ekgdboc", kgdboc_early_init);
^
>> drivers/tty/serial/kgdboc.c:410:13: error: expected ')'
drivers/tty/serial/kgdboc.c:410:12: note: to match this '('
early_param("ekgdboc", kgdboc_early_init);
^
>> drivers/tty/serial/kgdboc.c:410:1: warning: declaration specifier missing, defaulting to 'int'
early_param("ekgdboc", kgdboc_early_init);
^
int
>> drivers/tty/serial/kgdboc.c:410:12: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
early_param("ekgdboc", kgdboc_early_init);
^
void
1 warning and 3 errors generated.
vim +410 drivers/tty/serial/kgdboc.c
9731191f75a54c4 drivers/serial/kgdboc.c Jason Wessel 2010-05-20 409
9731191f75a54c4 drivers/serial/kgdboc.c Jason Wessel 2010-05-20 @410 early_param("ekgdboc", kgdboc_early_init);
9731191f75a54c4 drivers/serial/kgdboc.c Jason Wessel 2010-05-20 411
:::::: The code at line 410 was first introduced by commit
:::::: 9731191f75a54c4fa17e9b9b88f3144cf4b47836 kgdboc: Add ekgdboc for early use of the kernel debugger
:::::: TO: Jason Wessel <jason.wessel(a)windriver.com>
:::::: CC: Jason Wessel <jason.wessel(a)windriver.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months