drivers/vdpa/mlx5/core/mr.c:244: undefined reference to `vhost_iotlb_itree_first'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7eac66d0456fe12a462e5c14c68e97c7460989da
commit: 94abbccdf2916cb03f9626f2d36c6e9971490c12 vdpa/mlx5: Add shared memory registration code
date: 2 weeks ago
config: x86_64-randconfig-m001-20200820 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
git checkout 94abbccdf2916cb03f9626f2d36c6e9971490c12
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
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 >>):
ld: drivers/vdpa/mlx5/core/mr.o: in function `map_direct_mr':
>> drivers/vdpa/mlx5/core/mr.c:244: undefined reference to `vhost_iotlb_itree_first'
>> ld: drivers/vdpa/mlx5/core/mr.c:245: undefined reference to `vhost_iotlb_itree_next'
>> ld: drivers/vdpa/mlx5/core/mr.c:260: undefined reference to `vhost_iotlb_itree_first'
ld: drivers/vdpa/mlx5/core/mr.c:261: undefined reference to `vhost_iotlb_itree_next'
ld: drivers/vdpa/mlx5/core/mr.o: in function `_mlx5_vdpa_create_mr':
drivers/vdpa/mlx5/core/mr.c:377: undefined reference to `vhost_iotlb_itree_first'
ld: drivers/vdpa/mlx5/core/mr.c:378: undefined reference to `vhost_iotlb_itree_next'
ld: drivers/vdpa/mlx5/core/mr.o: in function `map_empty':
drivers/vdpa/mlx5/core/mr.c:460: undefined reference to `vhost_iotlb_itree_first'
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 94abbccdf2916cb03f9626f2d36c6e9971490c12
vim +244 drivers/vdpa/mlx5/core/mr.c
225
226 static int map_direct_mr(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_direct_mr *mr,
227 struct vhost_iotlb *iotlb)
228 {
229 struct vhost_iotlb_map *map;
230 unsigned long lgcd = 0;
231 int log_entity_size;
232 unsigned long size;
233 u64 start = 0;
234 int err;
235 struct page *pg;
236 unsigned int nsg;
237 int sglen;
238 u64 pa;
239 u64 paend;
240 struct scatterlist *sg;
241 struct device *dma = mvdev->mdev->device;
242 int ret;
243
> 244 for (map = vhost_iotlb_itree_first(iotlb, mr->start, mr->end - 1);
> 245 map; map = vhost_iotlb_itree_next(map, start, mr->end - 1)) {
246 size = maplen(map, mr);
247 lgcd = gcd(lgcd, size);
248 start += size;
249 }
250 log_entity_size = ilog2(lgcd);
251
252 sglen = 1 << log_entity_size;
253 nsg = MLX5_DIV_ROUND_UP_POW2(mr->end - mr->start, log_entity_size);
254
255 err = sg_alloc_table(&mr->sg_head, nsg, GFP_KERNEL);
256 if (err)
257 return err;
258
259 sg = mr->sg_head.sgl;
> 260 for (map = vhost_iotlb_itree_first(iotlb, mr->start, mr->end - 1);
261 map; map = vhost_iotlb_itree_next(map, mr->start, mr->end - 1)) {
262 paend = map->addr + maplen(map, mr);
263 for (pa = map->addr; pa < paend; pa += sglen) {
264 pg = pfn_to_page(__phys_to_pfn(pa));
265 if (!sg) {
266 mlx5_vdpa_warn(mvdev, "sg null. start 0x%llx, end 0x%llx\n",
267 map->start, map->last + 1);
268 err = -ENOMEM;
269 goto err_map;
270 }
271 sg_set_page(sg, pg, sglen, 0);
272 sg = sg_next(sg);
273 if (!sg)
274 goto done;
275 }
276 }
277 done:
278 mr->log_size = log_entity_size;
279 mr->nsg = nsg;
280 ret = dma_map_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0);
281 if (!ret)
282 goto err_map;
283
284 err = create_direct_mr(mvdev, mr);
285 if (err)
286 goto err_direct;
287
288 return 0;
289
290 err_direct:
291 dma_unmap_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0);
292 err_map:
293 sg_free_table(&mr->sg_head);
294 return err;
295 }
296
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[intel-linux-intel-lts:5.4/yocto 178/9302] drivers/platform/x86/socwatch/sw_driver.c:1058 sw_get_cta_aggregators_i() warn: maybe return -EFAULT instead of the bytes
by Dan Carpenter
tree: https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: eeb611e5394c56d45c5cc8f7dc484c9f19e93143
commit: a8d1e48baaa24069690e7178f3d5ebfabc3d52ba [178/9302] platform/x86: Update SoCWatch driver for 5.4 pull
config: x86_64-randconfig-m001-20200818 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/platform/x86/socwatch/sw_driver.c:1058 sw_get_cta_aggregators_i() warn: maybe return -EFAULT instead of the bytes remaining?
Old smatch warnings:
drivers/platform/x86/socwatch/sw_driver.c:698 sw_set_driver_infos_i() warn: variable dereferenced before check 'local_msg' (see line 695)
drivers/platform/x86/socwatch/sw_driver.c:998 sw_get_available_name_id_mappings_i() warn: maybe return -EFAULT instead of the bytes remaining?
drivers/platform/x86/socwatch/sw_driver.c:1048 sw_get_topology_changes_i() warn: maybe return -EFAULT instead of the bytes remaining?
drivers/platform/x86/socwatch/sw_driver.c:1100 sw_set_continuous_i() warn: inconsistent indenting
# https://github.com/intel/linux-intel-lts/commit/a8d1e48baaa24069690e7178f...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/yocto
git checkout a8d1e48baaa24069690e7178f3d5ebfabc3d52ba
vim +1058 drivers/platform/x86/socwatch/sw_driver.c
1051 static long
1052 sw_get_cta_aggregators_i(struct _sw_aggregator_msg __user *remote_msg,
1053 size_t local_len)
1054 {
1055 const struct _sw_aggregator_msg *_msg = sw_get_cta_aggregators();
1056 long retval = copy_to_user(remote_msg, _msg, sizeof(*_msg));
1057
1058 return retval;
It should return zero on success and -EFAULT if the copy fails.
1059 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[linux-review:UPDATE-20200821-181056/Chris-Wilson/mm-Export-flush_vm_area-to-sync-the-PTEs-upon-construction/20200821-165232 2/4] drivers/gpu/drm/i915/gem/i915_gem_pages.c:307:2: error: implicit declaration of function 'flush_vm_area'; did you mean
by kernel test robot
tree: https://github.com/0day-ci/linux/commits/UPDATE-20200821-181056/Chris-Wil...
head: 38b0cab83068fdb9ea08a83d0aa478dea9dc0198
commit: 428d9f1a613ed8a93d2b6476ec1aeb95fe90dedc [2/4] drm/i915/gem: Sync the vmap PTEs upon construction
config: i386-randconfig-a012-20200820 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
git checkout 428d9f1a613ed8a93d2b6476ec1aeb95fe90dedc
# save the attached .config to linux build tree
make 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 >>):
drivers/gpu/drm/i915/gem/i915_gem_pages.c: In function 'i915_gem_object_map':
>> drivers/gpu/drm/i915/gem/i915_gem_pages.c:307:2: error: implicit declaration of function 'flush_vm_area'; did you mean 'free_vm_area'? [-Werror=implicit-function-declaration]
307 | flush_vm_area(area);
| ^~~~~~~~~~~~~
| free_vm_area
cc1: some warnings being treated as errors
# https://github.com/0day-ci/linux/commit/428d9f1a613ed8a93d2b6476ec1aeb95f...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review UPDATE-20200821-181056/Chris-Wilson/mm-Export-flush_vm_area-to-sync-the-PTEs-upon-construction/20200821-165232
git checkout 428d9f1a613ed8a93d2b6476ec1aeb95fe90dedc
vim +307 drivers/gpu/drm/i915/gem/i915_gem_pages.c
243
244 /* The 'mapping' part of i915_gem_object_pin_map() below */
245 static void *i915_gem_object_map(struct drm_i915_gem_object *obj,
246 enum i915_map_type type)
247 {
248 unsigned long n_pte = obj->base.size >> PAGE_SHIFT;
249 struct sg_table *sgt = obj->mm.pages;
250 pte_t *stack[32], **mem;
251 struct vm_struct *area;
252 pgprot_t pgprot;
253
254 if (!i915_gem_object_has_struct_page(obj) && type != I915_MAP_WC)
255 return NULL;
256
257 /* A single page can always be kmapped */
258 if (n_pte == 1 && type == I915_MAP_WB)
259 return kmap(sg_page(sgt->sgl));
260
261 mem = stack;
262 if (n_pte > ARRAY_SIZE(stack)) {
263 /* Too big for stack -- allocate temporary array instead */
264 mem = kvmalloc_array(n_pte, sizeof(*mem), GFP_KERNEL);
265 if (!mem)
266 return NULL;
267 }
268
269 area = alloc_vm_area(obj->base.size, mem);
270 if (!area) {
271 if (mem != stack)
272 kvfree(mem);
273 return NULL;
274 }
275
276 switch (type) {
277 default:
278 MISSING_CASE(type);
279 /* fallthrough - to use PAGE_KERNEL anyway */
280 case I915_MAP_WB:
281 pgprot = PAGE_KERNEL;
282 break;
283 case I915_MAP_WC:
284 pgprot = pgprot_writecombine(PAGE_KERNEL_IO);
285 break;
286 }
287
288 if (i915_gem_object_has_struct_page(obj)) {
289 struct sgt_iter iter;
290 struct page *page;
291 pte_t **ptes = mem;
292
293 for_each_sgt_page(page, iter, sgt)
294 **ptes++ = mk_pte(page, pgprot);
295 } else {
296 resource_size_t iomap;
297 struct sgt_iter iter;
298 pte_t **ptes = mem;
299 dma_addr_t addr;
300
301 iomap = obj->mm.region->iomap.base;
302 iomap -= obj->mm.region->region.start;
303
304 for_each_sgt_daddr(addr, iter, sgt)
305 **ptes++ = iomap_pte(iomap, addr, pgprot);
306 }
> 307 flush_vm_area(area);
308
309 if (mem != stack)
310 kvfree(mem);
311
312 return area->addr;
313 }
314
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
include/asm-generic/mmiowb.h:56:9: sparse: sparse: context imbalance in 'ep0_write' - unexpected unlock
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: da2968ff879b9e74688cdc658f646971991d2c56
commit: df8df5e4bc37e39010cfdf5d50cf726fe08aae5b usb: get rid of 'choice' for legacy gadget drivers
date: 5 months ago
config: powerpc-randconfig-s032-20200821 (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
# apt-get install sparse
# sparse version: v0.6.2-191-g10164920-dirty
git checkout df8df5e4bc37e39010cfdf5d50cf726fe08aae5b
# 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__' ARCH=powerpc
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/usb/gadget/legacy/inode.c: note: in included file (through arch/powerpc/include/asm/mmiowb.h, include/linux/spinlock.h, include/linux/seqlock.h, ...):
>> include/asm-generic/mmiowb.h:56:9: sparse: sparse: context imbalance in 'ep0_write' - unexpected unlock
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout df8df5e4bc37e39010cfdf5d50cf726fe08aae5b
vim +/ep0_write +56 include/asm-generic/mmiowb.h
d1be6a28b13ce6 Will Deacon 2019-02-22 46
d1be6a28b13ce6 Will Deacon 2019-02-22 47 static inline void mmiowb_spin_unlock(void)
d1be6a28b13ce6 Will Deacon 2019-02-22 48 {
d1be6a28b13ce6 Will Deacon 2019-02-22 49 struct mmiowb_state *ms = __mmiowb_state();
d1be6a28b13ce6 Will Deacon 2019-02-22 50
d1be6a28b13ce6 Will Deacon 2019-02-22 51 if (unlikely(ms->mmiowb_pending)) {
d1be6a28b13ce6 Will Deacon 2019-02-22 52 ms->mmiowb_pending = 0;
d1be6a28b13ce6 Will Deacon 2019-02-22 53 mmiowb();
d1be6a28b13ce6 Will Deacon 2019-02-22 54 }
d1be6a28b13ce6 Will Deacon 2019-02-22 55
d1be6a28b13ce6 Will Deacon 2019-02-22 @56 ms->nesting_count--;
:::::: The code at line 56 was first introduced by commit
:::::: d1be6a28b13ce6d1bc42bf9b6a9454c65839225b asm-generic/mmiowb: Add generic implementation of mmiowb() tracking
:::::: TO: Will Deacon <will.deacon(a)arm.com>
:::::: CC: Will Deacon <will.deacon(a)arm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
Re: [PATCH V2 3/3] vdpa_sim: implement get_iova_range()
by kernel test robot
Hi Jason,
I love your patch! Perhaps something to improve:
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on linus/master v5.9-rc1 next-20200821]
[cannot apply to linux/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Jason-Wang/vDPA-API-for-reportin...
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: x86_64-randconfig-a002-20200820 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project b587ca93be114d07ec3bf654add97d7872325281)
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
# 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 >>):
>> drivers/vdpa/vdpa_sim/vdpa_sim.c:577:24: warning: no previous prototype for function 'vdpasim_get_iova_range' [-Wmissing-prototypes]
struct vdpa_iova_range vdpasim_get_iova_range(struct vdpa_device *vdpa)
^
drivers/vdpa/vdpa_sim/vdpa_sim.c:577:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
struct vdpa_iova_range vdpasim_get_iova_range(struct vdpa_device *vdpa)
^
static
drivers/vdpa/vdpa_sim/vdpa_sim.c:89:19: warning: unused function 'vdpasim16_to_cpu' [-Wunused-function]
static inline u16 vdpasim16_to_cpu(struct vdpasim *vdpasim, __virtio16 val)
^
2 warnings generated.
# https://github.com/0day-ci/linux/commit/fba5ff6281e9d46144860bcc558068b55...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jason-Wang/vDPA-API-for-reporting-IOVA-range/20200821-173030
git checkout fba5ff6281e9d46144860bcc558068b5516e5e62
vim +/vdpasim_get_iova_range +577 drivers/vdpa/vdpa_sim/vdpa_sim.c
576
> 577 struct vdpa_iova_range vdpasim_get_iova_range(struct vdpa_device *vdpa)
578 {
579 struct vdpa_iova_range range = {
580 .first = 0ULL,
581 .last = ULLONG_MAX,
582 };
583
584 return range;
585 }
586
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
Re: [PATCH V2 3/3] vdpa_sim: implement get_iova_range()
by kernel test robot
Hi Jason,
I love your patch! Perhaps something to improve:
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on linus/master v5.9-rc1 next-20200821]
[cannot apply to linux/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Jason-Wang/vDPA-API-for-reportin...
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: arm-randconfig-r026-20200820 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project b587ca93be114d07ec3bf654add97d7872325281)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
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 >>):
>> drivers/vdpa/vdpa_sim/vdpa_sim.c:577:24: warning: no previous prototype for function 'vdpasim_get_iova_range' [-Wmissing-prototypes]
struct vdpa_iova_range vdpasim_get_iova_range(struct vdpa_device *vdpa)
^
drivers/vdpa/vdpa_sim/vdpa_sim.c:577:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
struct vdpa_iova_range vdpasim_get_iova_range(struct vdpa_device *vdpa)
^
static
drivers/vdpa/vdpa_sim/vdpa_sim.c:89:19: warning: unused function 'vdpasim16_to_cpu' [-Wunused-function]
static inline u16 vdpasim16_to_cpu(struct vdpasim *vdpasim, __virtio16 val)
^
2 warnings generated.
# https://github.com/0day-ci/linux/commit/fba5ff6281e9d46144860bcc558068b55...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jason-Wang/vDPA-API-for-reporting-IOVA-range/20200821-173030
git checkout fba5ff6281e9d46144860bcc558068b5516e5e62
vim +/vdpasim_get_iova_range +577 drivers/vdpa/vdpa_sim/vdpa_sim.c
576
> 577 struct vdpa_iova_range vdpasim_get_iova_range(struct vdpa_device *vdpa)
578 {
579 struct vdpa_iova_range range = {
580 .first = 0ULL,
581 .last = ULLONG_MAX,
582 };
583
584 return range;
585 }
586
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[cryptodev:master 2/35] drivers/crypto/stm32/stm32-crc32.c:128:2: error: implicit declaration of function 'writel_relaxed'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
head: 3d29e98d1d7550fc959a7ad4258bd804b533b493
commit: 0c3dc787a62aef3ca7aedf3797ec42fff9b0a913 [2/35] crypto: algapi - Remove skbuff.h inclusion
config: arm-randconfig-r016-20200820 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project b587ca93be114d07ec3bf654add97d7872325281)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
git checkout 0c3dc787a62aef3ca7aedf3797ec42fff9b0a913
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
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 >>):
>> drivers/crypto/stm32/stm32-crc32.c:128:2: error: implicit declaration of function 'writel_relaxed' [-Werror,-Wimplicit-function-declaration]
writel_relaxed(bitrev32(mctx->key), crc->regs + CRC_INIT);
^
>> drivers/crypto/stm32/stm32-crc32.c:134:17: error: implicit declaration of function 'readl_relaxed' [-Werror,-Wimplicit-function-declaration]
ctx->partial = readl_relaxed(crc->regs + CRC_DR);
^
drivers/crypto/stm32/stm32-crc32.c:134:17: note: did you mean 'writel_relaxed'?
drivers/crypto/stm32/stm32-crc32.c:128:2: note: 'writel_relaxed' declared here
writel_relaxed(bitrev32(mctx->key), crc->regs + CRC_INIT);
^
drivers/crypto/stm32/stm32-crc32.c:166:2: error: implicit declaration of function 'writel_relaxed' [-Werror,-Wimplicit-function-declaration]
writel_relaxed(bitrev32(ctx->partial), crc->regs + CRC_INIT);
^
>> drivers/crypto/stm32/stm32-crc32.c:176:4: error: implicit declaration of function 'writeb_relaxed' [-Werror,-Wimplicit-function-declaration]
writeb_relaxed(*d8++, crc->regs + CRC_DR);
^
drivers/crypto/stm32/stm32-crc32.c:176:4: note: did you mean 'writel_relaxed'?
drivers/crypto/stm32/stm32-crc32.c:128:2: note: 'writel_relaxed' declared here
writel_relaxed(bitrev32(mctx->key), crc->regs + CRC_INIT);
^
drivers/crypto/stm32/stm32-crc32.c:192:4: error: implicit declaration of function 'writeb_relaxed' [-Werror,-Wimplicit-function-declaration]
writeb_relaxed(*d8++, crc->regs + CRC_DR);
^
drivers/crypto/stm32/stm32-crc32.c:196:17: error: implicit declaration of function 'readl_relaxed' [-Werror,-Wimplicit-function-declaration]
ctx->partial = readl_relaxed(crc->regs + CRC_DR);
^
6 errors generated.
--
>> drivers/crypto/stm32/stm32-hash.c:492:18: error: implicit declaration of function 'dma_map_sg' [-Werror,-Wimplicit-function-declaration]
rctx->dma_ct = dma_map_sg(hdev->dev, &rctx->sg_key, 1,
^
>> drivers/crypto/stm32/stm32-hash.c:493:8: error: use of undeclared identifier 'DMA_TO_DEVICE'
DMA_TO_DEVICE);
^
>> drivers/crypto/stm32/stm32-hash.c:501:3: error: implicit declaration of function 'dma_unmap_sg' [-Werror,-Wimplicit-function-declaration]
dma_unmap_sg(hdev->dev, &rctx->sg_key, 1, DMA_TO_DEVICE);
^
drivers/crypto/stm32/stm32-hash.c:501:3: note: did you mean 'dma_map_sg'?
drivers/crypto/stm32/stm32-hash.c:492:18: note: 'dma_map_sg' declared here
rctx->dma_ct = dma_map_sg(hdev->dev, &rctx->sg_key, 1,
^
drivers/crypto/stm32/stm32-hash.c:501:45: error: use of undeclared identifier 'DMA_TO_DEVICE'
dma_unmap_sg(hdev->dev, &rctx->sg_key, 1, DMA_TO_DEVICE);
^
drivers/crypto/stm32/stm32-hash.c:588:18: error: implicit declaration of function 'dma_map_sg' [-Werror,-Wimplicit-function-declaration]
rctx->dma_ct = dma_map_sg(hdev->dev, sg, 1,
^
drivers/crypto/stm32/stm32-hash.c:589:8: error: use of undeclared identifier 'DMA_TO_DEVICE'
DMA_TO_DEVICE);
^
drivers/crypto/stm32/stm32-hash.c:598:3: error: implicit declaration of function 'dma_unmap_sg' [-Werror,-Wimplicit-function-declaration]
dma_unmap_sg(hdev->dev, sg, 1, DMA_TO_DEVICE);
^
drivers/crypto/stm32/stm32-hash.c:598:34: error: use of undeclared identifier 'DMA_TO_DEVICE'
dma_unmap_sg(hdev->dev, sg, 1, DMA_TO_DEVICE);
^
8 errors generated.
# https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git...
git remote add cryptodev https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
git fetch --no-tags cryptodev master
git checkout 0c3dc787a62aef3ca7aedf3797ec42fff9b0a913
vim +/writel_relaxed +128 drivers/crypto/stm32/stm32-crc32.c
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 111
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 112 static int stm32_crc_init(struct shash_desc *desc)
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 113 {
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 114 struct stm32_crc_desc_ctx *ctx = shash_desc_ctx(desc);
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 115 struct stm32_crc_ctx *mctx = crypto_shash_ctx(desc->tfm);
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 116 struct stm32_crc *crc;
7795c0baf5ac25e drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 117 unsigned long flags;
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 118
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 119 crc = stm32_crc_get_next_crc();
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 120 if (!crc)
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 121 return -ENODEV;
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 122
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 123 pm_runtime_get_sync(crc->dev);
73463ade0a57d2c drivers/crypto/stm32/stm32_crc32.c lionel.debieve(a)st.com 2018-06-26 124
7795c0baf5ac25e drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 125 spin_lock_irqsave(&crc->lock, flags);
7795c0baf5ac25e drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 126
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 127 /* Reset, set key, poly and configure in bit reverse mode */
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 @128 writel_relaxed(bitrev32(mctx->key), crc->regs + CRC_INIT);
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 129 writel_relaxed(bitrev32(mctx->poly), crc->regs + CRC_POL);
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 130 writel_relaxed(CRC_CR_RESET | CRC_CR_REV_IN_WORD | CRC_CR_REV_OUT,
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 131 crc->regs + CRC_CR);
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 132
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 133 /* Store partial result */
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 @134 ctx->partial = readl_relaxed(crc->regs + CRC_DR);
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 135
7795c0baf5ac25e drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 136 spin_unlock_irqrestore(&crc->lock, flags);
7795c0baf5ac25e drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 137
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 138 pm_runtime_mark_last_busy(crc->dev);
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 139 pm_runtime_put_autosuspend(crc->dev);
73463ade0a57d2c drivers/crypto/stm32/stm32_crc32.c lionel.debieve(a)st.com 2018-06-26 140
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 141 return 0;
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 142 }
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 143
7795c0baf5ac25e drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 144 static int burst_update(struct shash_desc *desc, const u8 *d8,
7795c0baf5ac25e drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 145 size_t length)
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 146 {
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 147 struct stm32_crc_desc_ctx *ctx = shash_desc_ctx(desc);
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 148 struct stm32_crc_ctx *mctx = crypto_shash_ctx(desc->tfm);
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 149 struct stm32_crc *crc;
7795c0baf5ac25e drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 150 unsigned long flags;
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 151
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 152 crc = stm32_crc_get_next_crc();
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 153 if (!crc)
10b89c43a64eb0d drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 154 return -ENODEV;
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 155
73463ade0a57d2c drivers/crypto/stm32/stm32_crc32.c lionel.debieve(a)st.com 2018-06-26 156 pm_runtime_get_sync(crc->dev);
73463ade0a57d2c drivers/crypto/stm32/stm32_crc32.c lionel.debieve(a)st.com 2018-06-26 157
7795c0baf5ac25e drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 158 spin_lock_irqsave(&crc->lock, flags);
7795c0baf5ac25e drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 159
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 160 /*
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 161 * Restore previously calculated CRC for this context as init value
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 162 * Restore polynomial configuration
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 163 * Configure in register for word input data,
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 164 * Configure out register in reversed bit mode data.
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 165 */
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 166 writel_relaxed(bitrev32(ctx->partial), crc->regs + CRC_INIT);
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 167 writel_relaxed(bitrev32(mctx->poly), crc->regs + CRC_POL);
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 168 writel_relaxed(CRC_CR_RESET | CRC_CR_REV_IN_WORD | CRC_CR_REV_OUT,
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 169 crc->regs + CRC_CR);
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 170
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 171 if (d8 != PTR_ALIGN(d8, sizeof(u32))) {
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 172 /* Configure for byte data */
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 173 writel_relaxed(CRC_CR_REV_IN_BYTE | CRC_CR_REV_OUT,
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 174 crc->regs + CRC_CR);
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 175 while (d8 != PTR_ALIGN(d8, sizeof(u32)) && length) {
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 @176 writeb_relaxed(*d8++, crc->regs + CRC_DR);
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 177 length--;
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 178 }
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 179 /* Configure for word data */
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 180 writel_relaxed(CRC_CR_REV_IN_WORD | CRC_CR_REV_OUT,
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 181 crc->regs + CRC_CR);
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 182 }
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 183
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 184 for (; length >= sizeof(u32); d8 += sizeof(u32), length -= sizeof(u32))
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 185 writel_relaxed(*((u32 *)d8), crc->regs + CRC_DR);
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 186
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 187 if (length) {
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 188 /* Configure for byte data */
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 189 writel_relaxed(CRC_CR_REV_IN_BYTE | CRC_CR_REV_OUT,
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 190 crc->regs + CRC_CR);
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 191 while (length--)
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 192 writeb_relaxed(*d8++, crc->regs + CRC_DR);
49c2c082e00e0bc drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 193 }
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 194
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 195 /* Store partial result */
391775191f38f80 drivers/crypto/stm32/stm32_crc32.c lionel.debieve(a)st.com 2017-07-13 196 ctx->partial = readl_relaxed(crc->regs + CRC_DR);
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 197
7795c0baf5ac25e drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 198 spin_unlock_irqrestore(&crc->lock, flags);
7795c0baf5ac25e drivers/crypto/stm32/stm32-crc32.c Nicolas Toromanoff 2020-05-12 199
73463ade0a57d2c drivers/crypto/stm32/stm32_crc32.c lionel.debieve(a)st.com 2018-06-26 200 pm_runtime_mark_last_busy(crc->dev);
73463ade0a57d2c drivers/crypto/stm32/stm32_crc32.c lionel.debieve(a)st.com 2018-06-26 201 pm_runtime_put_autosuspend(crc->dev);
73463ade0a57d2c drivers/crypto/stm32/stm32_crc32.c lionel.debieve(a)st.com 2018-06-26 202
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 203 return 0;
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 204 }
b51dbe90912a0ce drivers/crypto/stm32/stm32_crc32.c Fabien DESSENNE 2017-03-21 205
:::::: The code at line 128 was first introduced by commit
:::::: 49c2c082e00e0bc4f5cbb7c21c7f0f873b35ab09 crypto: stm32/crc32 - fix ext4 chksum BUG_ON()
:::::: TO: Nicolas Toromanoff <nicolas.toromanoff(a)st.com>
:::::: CC: Herbert Xu <herbert(a)gondor.apana.org.au>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[peterz-queue:locking/wip 9/10] include/linux/spinlock_api_smp.h:126:2: error: implicit declaration of function 'arch_irqs_disabled'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/wip
head: 5087f2b9cf24ee0e6e1eb118b473fee280922a99
commit: d42ea184d6f89df14ad19483932874466ec29c2c [9/10] lockdep: Only trace IRQ edges
config: arm64-randconfig-r005-20200820 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 4deda57106f7c9b982a49cb907c33e3966c8de7f)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git checkout d42ea184d6f89df14ad19483932874466ec29c2c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
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/arm64/kernel/asm-offsets.c:10:
In file included from include/linux/arm_sdei.h:8:
In file included from include/acpi/ghes.h:5:
In file included from include/acpi/apei.h:9:
In file included from include/linux/acpi.h:13:
In file included from include/linux/irqdomain.h:35:
In file included from include/linux/of.h:17:
In file included from include/linux/kobject.h:20:
In file included from include/linux/sysfs.h:16:
In file included from include/linux/kernfs.h:13:
In file included from include/linux/idr.h:15:
In file included from include/linux/radix-tree.h:16:
In file included from include/linux/spinlock.h:318:
>> include/linux/spinlock_api_smp.h:126:2: error: implicit declaration of function 'arch_irqs_disabled' [-Werror,-Wimplicit-function-declaration]
local_irq_disable();
^
include/linux/irqflags.h:194:23: note: expanded from macro 'local_irq_disable'
bool was_disabled = raw_irqs_disabled();\
^
include/linux/irqflags.h:177:31: note: expanded from macro 'raw_irqs_disabled'
#define raw_irqs_disabled() (arch_irqs_disabled())
^
include/linux/spinlock_api_smp.h:126:2: note: did you mean 'arch_irqs_disabled_flags'?
include/linux/irqflags.h:194:23: note: expanded from macro 'local_irq_disable'
bool was_disabled = raw_irqs_disabled();\
^
include/linux/irqflags.h:177:31: note: expanded from macro 'raw_irqs_disabled'
#define raw_irqs_disabled() (arch_irqs_disabled())
^
arch/arm64/include/asm/irqflags.h:83:19: note: 'arch_irqs_disabled_flags' declared here
static inline int arch_irqs_disabled_flags(unsigned long flags)
^
In file included from arch/arm64/kernel/asm-offsets.c:10:
In file included from include/linux/arm_sdei.h:8:
In file included from include/acpi/ghes.h:5:
In file included from include/acpi/apei.h:9:
In file included from include/linux/acpi.h:13:
In file included from include/linux/irqdomain.h:35:
In file included from include/linux/of.h:17:
In file included from include/linux/kobject.h:20:
In file included from include/linux/sysfs.h:16:
In file included from include/linux/kernfs.h:13:
In file included from include/linux/idr.h:15:
In file included from include/linux/radix-tree.h:16:
In file included from include/linux/spinlock.h:318:
In file included from include/linux/spinlock_api_smp.h:190:
>> include/linux/rwlock_api_smp.h:167:2: error: implicit declaration of function 'arch_irqs_disabled' [-Werror,-Wimplicit-function-declaration]
local_irq_disable();
^
include/linux/irqflags.h:194:23: note: expanded from macro 'local_irq_disable'
bool was_disabled = raw_irqs_disabled();\
^
include/linux/irqflags.h:177:31: note: expanded from macro 'raw_irqs_disabled'
#define raw_irqs_disabled() (arch_irqs_disabled())
^
In file included from arch/arm64/kernel/asm-offsets.c:10:
In file included from include/linux/arm_sdei.h:8:
In file included from include/acpi/ghes.h:5:
In file included from include/acpi/apei.h:9:
In file included from include/linux/acpi.h:13:
In file included from include/linux/irqdomain.h:35:
In file included from include/linux/of.h:17:
In file included from include/linux/kobject.h:20:
In file included from include/linux/sysfs.h:16:
In file included from include/linux/kernfs.h:13:
In file included from include/linux/idr.h:15:
In file included from include/linux/radix-tree.h:16:
In file included from include/linux/spinlock.h:318:
In file included from include/linux/spinlock_api_smp.h:190:
include/linux/rwlock_api_smp.h:194:2: error: implicit declaration of function 'arch_irqs_disabled' [-Werror,-Wimplicit-function-declaration]
local_irq_disable();
^
include/linux/irqflags.h:194:23: note: expanded from macro 'local_irq_disable'
bool was_disabled = raw_irqs_disabled();\
^
include/linux/irqflags.h:177:31: note: expanded from macro 'raw_irqs_disabled'
#define raw_irqs_disabled() (arch_irqs_disabled())
^
In file included from arch/arm64/kernel/asm-offsets.c:10:
In file included from include/linux/arm_sdei.h:8:
In file included from include/acpi/ghes.h:5:
In file included from include/acpi/apei.h:9:
In file included from include/linux/acpi.h:13:
In file included from include/linux/irqdomain.h:35:
In file included from include/linux/of.h:17:
In file included from include/linux/kobject.h:20:
In file included from include/linux/sysfs.h:16:
In file included from include/linux/kernfs.h:13:
In file included from include/linux/idr.h:15:
In file included from include/linux/radix-tree.h:16:
>> include/linux/spinlock.h:419:9: error: implicit declaration of function 'arch_irqs_disabled' [-Werror,-Wimplicit-function-declaration]
return raw_spin_trylock_irq(&lock->rlock);
^
include/linux/spinlock.h:299:2: note: expanded from macro 'raw_spin_trylock_irq'
local_irq_disable(); \
^
include/linux/irqflags.h:194:23: note: expanded from macro 'local_irq_disable'
bool was_disabled = raw_irqs_disabled();\
^
include/linux/irqflags.h:177:31: note: expanded from macro 'raw_irqs_disabled'
#define raw_irqs_disabled() (arch_irqs_disabled())
^
In file included from arch/arm64/kernel/asm-offsets.c:14:
In file included from include/linux/kvm_host.h:36:
In file included from arch/arm64/include/asm/kvm_host.h:36:
In file included from include/kvm/arm_pmu.h:10:
In file included from include/linux/perf_event.h:57:
In file included from include/linux/cgroup.h:26:
In file included from include/linux/kernel_stat.h:9:
>> include/linux/interrupt.h:426:2: error: implicit declaration of function 'arch_irqs_disabled' [-Werror,-Wimplicit-function-declaration]
local_irq_disable();
^
include/linux/irqflags.h:194:23: note: expanded from macro 'local_irq_disable'
bool was_disabled = raw_irqs_disabled();\
^
include/linux/irqflags.h:177:31: note: expanded from macro 'raw_irqs_disabled'
#define raw_irqs_disabled() (arch_irqs_disabled())
^
In file included from arch/arm64/kernel/asm-offsets.c:14:
In file included from include/linux/kvm_host.h:36:
In file included from arch/arm64/include/asm/kvm_host.h:36:
In file included from include/kvm/arm_pmu.h:10:
In file included from include/linux/perf_event.h:57:
In file included from include/linux/cgroup.h:26:
In file included from include/linux/kernel_stat.h:9:
include/linux/interrupt.h:442:2: error: implicit declaration of function 'arch_irqs_disabled' [-Werror,-Wimplicit-function-declaration]
local_irq_disable();
^
include/linux/irqflags.h:194:23: note: expanded from macro 'local_irq_disable'
bool was_disabled = raw_irqs_disabled();\
^
include/linux/irqflags.h:177:31: note: expanded from macro 'raw_irqs_disabled'
#define raw_irqs_disabled() (arch_irqs_disabled())
^
6 errors generated.
make[2]: *** [scripts/Makefile.build:117: arch/arm64/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1203: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:185: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue locking/wip
git checkout d42ea184d6f89df14ad19483932874466ec29c2c
vim +/arch_irqs_disabled +126 include/linux/spinlock_api_smp.h
69d0ee7377eef80 Heiko Carstens 2009-08-31 123
9c1721aa4994f66 Thomas Gleixner 2009-12-03 124 static inline void __raw_spin_lock_irq(raw_spinlock_t *lock)
69d0ee7377eef80 Heiko Carstens 2009-08-31 125 {
69d0ee7377eef80 Heiko Carstens 2009-08-31 @126 local_irq_disable();
69d0ee7377eef80 Heiko Carstens 2009-08-31 127 preempt_disable();
69d0ee7377eef80 Heiko Carstens 2009-08-31 128 spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
9828ea9d75c38fe Thomas Gleixner 2009-12-03 129 LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock);
69d0ee7377eef80 Heiko Carstens 2009-08-31 130 }
69d0ee7377eef80 Heiko Carstens 2009-08-31 131
:::::: The code at line 126 was first introduced by commit
:::::: 69d0ee7377eef808e34ba5542b554ec97244b871 locking: Move spinlock function bodies to header file
:::::: TO: Heiko Carstens <heiko.carstens(a)de.ibm.com>
:::::: CC: Ingo Molnar <mingo(a)elte.hu>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[linux-review:UPDATE-20200818-215429/Alessio-Balsini/fuse-Add-support-for-passthrough-read-write/20200813-001731 2/2] fs/fuse/passthrough.c:140 fuse_passthrough_write_iter() warn: inconsistent returns 'fuse_inode->i_rwsem'.
by Dan Carpenter
tree: https://github.com/0day-ci/linux/commits/UPDATE-20200818-215429/Alessio-B...
head: db983424acd984ba063ea00211c5c1b8a9a85b22
commit: db983424acd984ba063ea00211c5c1b8a9a85b22 [2/2] fuse: Add support for passthrough read/write
config: x86_64-randconfig-m001-20200818 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
fs/fuse/passthrough.c:140 fuse_passthrough_write_iter() warn: inconsistent returns 'fuse_inode->i_rwsem'.
# https://github.com/0day-ci/linux/commit/db983424acd984ba063ea00211c5c1b8a...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review UPDATE-20200818-215429/Alessio-Balsini/fuse-Add-support-for-passthrough-read-write/20200813-001731
git checkout db983424acd984ba063ea00211c5c1b8a9a85b22
vim +140 fs/fuse/passthrough.c
db983424acd984 Alessio Balsini 2020-08-18 92 ssize_t fuse_passthrough_write_iter(struct kiocb *iocb_fuse,
db983424acd984 Alessio Balsini 2020-08-18 93 struct iov_iter *iter)
db983424acd984 Alessio Balsini 2020-08-18 94 {
db983424acd984 Alessio Balsini 2020-08-18 95 struct file *fuse_filp = iocb_fuse->ki_filp;
db983424acd984 Alessio Balsini 2020-08-18 96 struct fuse_file *ff = fuse_filp->private_data;
db983424acd984 Alessio Balsini 2020-08-18 97 struct file *passthrough_filp = ff->passthrough_filp;
db983424acd984 Alessio Balsini 2020-08-18 98 struct inode *passthrough_inode = file_inode(passthrough_filp);
db983424acd984 Alessio Balsini 2020-08-18 99 struct inode *fuse_inode = file_inode(fuse_filp);
db983424acd984 Alessio Balsini 2020-08-18 100 ssize_t ret;
db983424acd984 Alessio Balsini 2020-08-18 101
db983424acd984 Alessio Balsini 2020-08-18 102 if (!iov_iter_count(iter))
db983424acd984 Alessio Balsini 2020-08-18 103 return 0;
db983424acd984 Alessio Balsini 2020-08-18 104
db983424acd984 Alessio Balsini 2020-08-18 105 inode_lock(fuse_inode);
^^^^^^^^^^^^^^^^^^^^^^
db983424acd984 Alessio Balsini 2020-08-18 106
db983424acd984 Alessio Balsini 2020-08-18 107 if (is_sync_kiocb(iocb_fuse)) {
db983424acd984 Alessio Balsini 2020-08-18 108 struct kiocb iocb;
db983424acd984 Alessio Balsini 2020-08-18 109
db983424acd984 Alessio Balsini 2020-08-18 110 kiocb_clone(&iocb, iocb_fuse, passthrough_filp);
db983424acd984 Alessio Balsini 2020-08-18 111
db983424acd984 Alessio Balsini 2020-08-18 112 file_start_write(passthrough_filp);
db983424acd984 Alessio Balsini 2020-08-18 113 ret = call_write_iter(passthrough_filp, &iocb, iter);
db983424acd984 Alessio Balsini 2020-08-18 114 file_end_write(passthrough_filp);
db983424acd984 Alessio Balsini 2020-08-18 115
db983424acd984 Alessio Balsini 2020-08-18 116 iocb_fuse->ki_pos = iocb.ki_pos;
db983424acd984 Alessio Balsini 2020-08-18 117 fuse_copyattr(fuse_filp, passthrough_filp, true);
db983424acd984 Alessio Balsini 2020-08-18 118 } else {
db983424acd984 Alessio Balsini 2020-08-18 119 struct fuse_aio_req *aio_req;
db983424acd984 Alessio Balsini 2020-08-18 120
db983424acd984 Alessio Balsini 2020-08-18 121 aio_req =
db983424acd984 Alessio Balsini 2020-08-18 122 kmem_cache_zalloc(fuse_aio_request_cachep, GFP_KERNEL);
db983424acd984 Alessio Balsini 2020-08-18 123 if (!aio_req)
db983424acd984 Alessio Balsini 2020-08-18 124 return -ENOMEM;
Need to unlock.
db983424acd984 Alessio Balsini 2020-08-18 125
db983424acd984 Alessio Balsini 2020-08-18 126 file_start_write(passthrough_filp);
db983424acd984 Alessio Balsini 2020-08-18 127 __sb_writers_release(passthrough_inode->i_sb, SB_FREEZE_WRITE);
db983424acd984 Alessio Balsini 2020-08-18 128
db983424acd984 Alessio Balsini 2020-08-18 129 aio_req->iocb_fuse = iocb_fuse;
db983424acd984 Alessio Balsini 2020-08-18 130 kiocb_clone(&aio_req->iocb, iocb_fuse, passthrough_filp);
db983424acd984 Alessio Balsini 2020-08-18 131 aio_req->iocb.ki_complete = fuse_aio_rw_complete;
db983424acd984 Alessio Balsini 2020-08-18 132 ret = vfs_iocb_iter_write(passthrough_filp, &aio_req->iocb,
db983424acd984 Alessio Balsini 2020-08-18 133 iter);
db983424acd984 Alessio Balsini 2020-08-18 134 if (ret != -EIOCBQUEUED)
db983424acd984 Alessio Balsini 2020-08-18 135 fuse_aio_cleanup_handler(aio_req);
db983424acd984 Alessio Balsini 2020-08-18 136 }
db983424acd984 Alessio Balsini 2020-08-18 137
db983424acd984 Alessio Balsini 2020-08-18 138 inode_unlock(fuse_inode);
^^^^^^^^^^^^^^^^^^^^^^^^
db983424acd984 Alessio Balsini 2020-08-18 139
db983424acd984 Alessio Balsini 2020-08-18 @140 return ret;
db983424acd984 Alessio Balsini 2020-08-18 141 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
Re: [PATCH 1/9] l2tp: don't log data frames
by kernel test robot
Hi Tom,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Tom-Parkin/l2tp-replace-custom-l...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git d0a84e1f38d9d6ae2dfab0b6c2407d667a265aa5
config: riscv-randconfig-r035-20200820 (attached as .config)
compiler: riscv32-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
# 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: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
net/l2tp/l2tp_core.c: In function 'l2tp_recv_common':
>> net/l2tp/l2tp_core.c:663:14: warning: variable 'nr' set but not used [-Wunused-but-set-variable]
663 | u32 ns = 0, nr = 0;
| ^~
# https://github.com/0day-ci/linux/commit/5b9d9c3057638c81876e600aa2210e4a3...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Tom-Parkin/l2tp-replace-custom-logging-code-with-tracepoints/20200821-184919
git checkout 5b9d9c3057638c81876e600aa2210e4a3e35fa8d
vim +/nr +663 net/l2tp/l2tp_core.c
b6dc01a43aaca24 James Chapman 2013-07-02 598
f7faffa3ff8ef6a James Chapman 2010-04-02 599 /* Do receive processing of L2TP data frames. We handle both L2TPv2
f7faffa3ff8ef6a James Chapman 2010-04-02 600 * and L2TPv3 data frames here.
f7faffa3ff8ef6a James Chapman 2010-04-02 601 *
f7faffa3ff8ef6a James Chapman 2010-04-02 602 * L2TPv2 Data Message Header
f7faffa3ff8ef6a James Chapman 2010-04-02 603 *
f7faffa3ff8ef6a James Chapman 2010-04-02 604 * 0 1 2 3
f7faffa3ff8ef6a James Chapman 2010-04-02 605 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
f7faffa3ff8ef6a James Chapman 2010-04-02 606 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 607 * |T|L|x|x|S|x|O|P|x|x|x|x| Ver | Length (opt) |
f7faffa3ff8ef6a James Chapman 2010-04-02 608 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 609 * | Tunnel ID | Session ID |
f7faffa3ff8ef6a James Chapman 2010-04-02 610 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 611 * | Ns (opt) | Nr (opt) |
f7faffa3ff8ef6a James Chapman 2010-04-02 612 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 613 * | Offset Size (opt) | Offset pad... (opt)
f7faffa3ff8ef6a James Chapman 2010-04-02 614 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 615 *
f7faffa3ff8ef6a James Chapman 2010-04-02 616 * Data frames are marked by T=0. All other fields are the same as
f7faffa3ff8ef6a James Chapman 2010-04-02 617 * those in L2TP control frames.
f7faffa3ff8ef6a James Chapman 2010-04-02 618 *
f7faffa3ff8ef6a James Chapman 2010-04-02 619 * L2TPv3 Data Message Header
f7faffa3ff8ef6a James Chapman 2010-04-02 620 *
f7faffa3ff8ef6a James Chapman 2010-04-02 621 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 622 * | L2TP Session Header |
f7faffa3ff8ef6a James Chapman 2010-04-02 623 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 624 * | L2-Specific Sublayer |
f7faffa3ff8ef6a James Chapman 2010-04-02 625 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 626 * | Tunnel Payload ...
f7faffa3ff8ef6a James Chapman 2010-04-02 627 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 628 *
f7faffa3ff8ef6a James Chapman 2010-04-02 629 * L2TPv3 Session Header Over IP
f7faffa3ff8ef6a James Chapman 2010-04-02 630 *
f7faffa3ff8ef6a James Chapman 2010-04-02 631 * 0 1 2 3
f7faffa3ff8ef6a James Chapman 2010-04-02 632 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
f7faffa3ff8ef6a James Chapman 2010-04-02 633 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 634 * | Session ID |
f7faffa3ff8ef6a James Chapman 2010-04-02 635 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 636 * | Cookie (optional, maximum 64 bits)...
f7faffa3ff8ef6a James Chapman 2010-04-02 637 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 638 * |
f7faffa3ff8ef6a James Chapman 2010-04-02 639 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 640 *
f7faffa3ff8ef6a James Chapman 2010-04-02 641 * L2TPv3 L2-Specific Sublayer Format
f7faffa3ff8ef6a James Chapman 2010-04-02 642 *
f7faffa3ff8ef6a James Chapman 2010-04-02 643 * 0 1 2 3
f7faffa3ff8ef6a James Chapman 2010-04-02 644 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
f7faffa3ff8ef6a James Chapman 2010-04-02 645 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 646 * |x|S|x|x|x|x|x|x| Sequence Number |
f7faffa3ff8ef6a James Chapman 2010-04-02 647 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
f7faffa3ff8ef6a James Chapman 2010-04-02 648 *
23fe846f9a48d53 Guillaume Nault 2018-01-05 649 * Cookie value and sublayer format are negotiated with the peer when
23fe846f9a48d53 Guillaume Nault 2018-01-05 650 * the session is set up. Unlike L2TPv2, we do not need to parse the
23fe846f9a48d53 Guillaume Nault 2018-01-05 651 * packet header to determine if optional fields are present.
f7faffa3ff8ef6a James Chapman 2010-04-02 652 *
f7faffa3ff8ef6a James Chapman 2010-04-02 653 * Caller must already have parsed the frame and determined that it is
f7faffa3ff8ef6a James Chapman 2010-04-02 654 * a data (not control) frame before coming here. Fields up to the
f7faffa3ff8ef6a James Chapman 2010-04-02 655 * session-id have already been parsed and ptr points to the data
f7faffa3ff8ef6a James Chapman 2010-04-02 656 * after the session-id.
fd558d186df2c13 James Chapman 2010-04-02 657 */
f7faffa3ff8ef6a James Chapman 2010-04-02 658 void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb,
f7faffa3ff8ef6a James Chapman 2010-04-02 659 unsigned char *ptr, unsigned char *optr, u16 hdrflags,
2b139e6b1ec86e1 Guillaume Nault 2018-07-25 660 int length)
fd558d186df2c13 James Chapman 2010-04-02 661 {
f7faffa3ff8ef6a James Chapman 2010-04-02 662 struct l2tp_tunnel *tunnel = session->tunnel;
95075150d0bdaa7 Tom Parkin 2020-07-24 @663 u32 ns = 0, nr = 0;
fd558d186df2c13 James Chapman 2010-04-02 664 int offset;
fd558d186df2c13 James Chapman 2010-04-02 665
f7faffa3ff8ef6a James Chapman 2010-04-02 666 /* Parse and check optional cookie */
f7faffa3ff8ef6a James Chapman 2010-04-02 667 if (session->peer_cookie_len > 0) {
f7faffa3ff8ef6a James Chapman 2010-04-02 668 if (memcmp(ptr, &session->peer_cookie[0], session->peer_cookie_len)) {
a4ca44fa578c7c7 Joe Perches 2012-05-16 669 l2tp_info(tunnel, L2TP_MSG_DATA,
f7faffa3ff8ef6a James Chapman 2010-04-02 670 "%s: cookie mismatch (%u/%u). Discarding.\n",
a4ca44fa578c7c7 Joe Perches 2012-05-16 671 tunnel->name, tunnel->tunnel_id,
a4ca44fa578c7c7 Joe Perches 2012-05-16 672 session->session_id);
7b7c0719cd7afee Tom Parkin 2013-03-19 673 atomic_long_inc(&session->stats.rx_cookie_discards);
f7faffa3ff8ef6a James Chapman 2010-04-02 674 goto discard;
f7faffa3ff8ef6a James Chapman 2010-04-02 675 }
f7faffa3ff8ef6a James Chapman 2010-04-02 676 ptr += session->peer_cookie_len;
f7faffa3ff8ef6a James Chapman 2010-04-02 677 }
f7faffa3ff8ef6a James Chapman 2010-04-02 678
fd558d186df2c13 James Chapman 2010-04-02 679 /* Handle the optional sequence numbers. Sequence numbers are
fd558d186df2c13 James Chapman 2010-04-02 680 * in different places for L2TPv2 and L2TPv3.
fd558d186df2c13 James Chapman 2010-04-02 681 *
fd558d186df2c13 James Chapman 2010-04-02 682 * If we are the LAC, enable/disable sequence numbers under
fd558d186df2c13 James Chapman 2010-04-02 683 * the control of the LNS. If no sequence numbers present but
fd558d186df2c13 James Chapman 2010-04-02 684 * we were expecting them, discard frame.
fd558d186df2c13 James Chapman 2010-04-02 685 */
fd558d186df2c13 James Chapman 2010-04-02 686 L2TP_SKB_CB(skb)->has_seq = 0;
f7faffa3ff8ef6a James Chapman 2010-04-02 687 if (tunnel->version == L2TP_HDR_VER_2) {
fd558d186df2c13 James Chapman 2010-04-02 688 if (hdrflags & L2TP_HDRFLAG_S) {
f7faffa3ff8ef6a James Chapman 2010-04-02 689 ns = ntohs(*(__be16 *)ptr);
fd558d186df2c13 James Chapman 2010-04-02 690 ptr += 2;
fd558d186df2c13 James Chapman 2010-04-02 691 nr = ntohs(*(__be16 *)ptr);
fd558d186df2c13 James Chapman 2010-04-02 692 ptr += 2;
fd558d186df2c13 James Chapman 2010-04-02 693
fd558d186df2c13 James Chapman 2010-04-02 694 /* Store L2TP info in the skb */
fd558d186df2c13 James Chapman 2010-04-02 695 L2TP_SKB_CB(skb)->ns = ns;
fd558d186df2c13 James Chapman 2010-04-02 696 L2TP_SKB_CB(skb)->has_seq = 1;
fd558d186df2c13 James Chapman 2010-04-02 697 }
f7faffa3ff8ef6a James Chapman 2010-04-02 698 } else if (session->l2specific_type == L2TP_L2SPECTYPE_DEFAULT) {
f7faffa3ff8ef6a James Chapman 2010-04-02 699 u32 l2h = ntohl(*(__be32 *)ptr);
f7faffa3ff8ef6a James Chapman 2010-04-02 700
f7faffa3ff8ef6a James Chapman 2010-04-02 701 if (l2h & 0x40000000) {
f7faffa3ff8ef6a James Chapman 2010-04-02 702 ns = l2h & 0x00ffffff;
f7faffa3ff8ef6a James Chapman 2010-04-02 703
f7faffa3ff8ef6a James Chapman 2010-04-02 704 /* Store L2TP info in the skb */
f7faffa3ff8ef6a James Chapman 2010-04-02 705 L2TP_SKB_CB(skb)->ns = ns;
f7faffa3ff8ef6a James Chapman 2010-04-02 706 L2TP_SKB_CB(skb)->has_seq = 1;
f7faffa3ff8ef6a James Chapman 2010-04-02 707 }
62e7b6a57c7b9bf Lorenzo Bianconi 2018-01-16 708 ptr += 4;
f7faffa3ff8ef6a James Chapman 2010-04-02 709 }
f7faffa3ff8ef6a James Chapman 2010-04-02 710
fd558d186df2c13 James Chapman 2010-04-02 711 if (L2TP_SKB_CB(skb)->has_seq) {
20dcb1107ab1a34 Tom Parkin 2020-07-22 712 /* Received a packet with sequence numbers. If we're the LAC,
fd558d186df2c13 James Chapman 2010-04-02 713 * check if we sre sending sequence numbers and if not,
fd558d186df2c13 James Chapman 2010-04-02 714 * configure it so.
fd558d186df2c13 James Chapman 2010-04-02 715 */
6c0ec37b8283463 Tom Parkin 2020-07-23 716 if (!session->lns_mode && !session->send_seq) {
a4ca44fa578c7c7 Joe Perches 2012-05-16 717 l2tp_info(session, L2TP_MSG_SEQ,
fd558d186df2c13 James Chapman 2010-04-02 718 "%s: requested to enable seq numbers by LNS\n",
fd558d186df2c13 James Chapman 2010-04-02 719 session->name);
3f9b9770b479986 Asbjørn Sloth Tønnesen 2016-11-07 720 session->send_seq = 1;
f7faffa3ff8ef6a James Chapman 2010-04-02 721 l2tp_session_set_header_len(session, tunnel->version);
fd558d186df2c13 James Chapman 2010-04-02 722 }
fd558d186df2c13 James Chapman 2010-04-02 723 } else {
fd558d186df2c13 James Chapman 2010-04-02 724 /* No sequence numbers.
fd558d186df2c13 James Chapman 2010-04-02 725 * If user has configured mandatory sequence numbers, discard.
fd558d186df2c13 James Chapman 2010-04-02 726 */
fd558d186df2c13 James Chapman 2010-04-02 727 if (session->recv_seq) {
a4ca44fa578c7c7 Joe Perches 2012-05-16 728 l2tp_warn(session, L2TP_MSG_SEQ,
a4ca44fa578c7c7 Joe Perches 2012-05-16 729 "%s: recv data has no seq numbers when required. Discarding.\n",
a4ca44fa578c7c7 Joe Perches 2012-05-16 730 session->name);
7b7c0719cd7afee Tom Parkin 2013-03-19 731 atomic_long_inc(&session->stats.rx_seq_discards);
fd558d186df2c13 James Chapman 2010-04-02 732 goto discard;
fd558d186df2c13 James Chapman 2010-04-02 733 }
fd558d186df2c13 James Chapman 2010-04-02 734
fd558d186df2c13 James Chapman 2010-04-02 735 /* If we're the LAC and we're sending sequence numbers, the
fd558d186df2c13 James Chapman 2010-04-02 736 * LNS has requested that we no longer send sequence numbers.
fd558d186df2c13 James Chapman 2010-04-02 737 * If we're the LNS and we're sending sequence numbers, the
fd558d186df2c13 James Chapman 2010-04-02 738 * LAC is broken. Discard the frame.
fd558d186df2c13 James Chapman 2010-04-02 739 */
6c0ec37b8283463 Tom Parkin 2020-07-23 740 if (!session->lns_mode && session->send_seq) {
a4ca44fa578c7c7 Joe Perches 2012-05-16 741 l2tp_info(session, L2TP_MSG_SEQ,
fd558d186df2c13 James Chapman 2010-04-02 742 "%s: requested to disable seq numbers by LNS\n",
fd558d186df2c13 James Chapman 2010-04-02 743 session->name);
fd558d186df2c13 James Chapman 2010-04-02 744 session->send_seq = 0;
f7faffa3ff8ef6a James Chapman 2010-04-02 745 l2tp_session_set_header_len(session, tunnel->version);
fd558d186df2c13 James Chapman 2010-04-02 746 } else if (session->send_seq) {
a4ca44fa578c7c7 Joe Perches 2012-05-16 747 l2tp_warn(session, L2TP_MSG_SEQ,
a4ca44fa578c7c7 Joe Perches 2012-05-16 748 "%s: recv data has no seq numbers when required. Discarding.\n",
a4ca44fa578c7c7 Joe Perches 2012-05-16 749 session->name);
7b7c0719cd7afee Tom Parkin 2013-03-19 750 atomic_long_inc(&session->stats.rx_seq_discards);
fd558d186df2c13 James Chapman 2010-04-02 751 goto discard;
fd558d186df2c13 James Chapman 2010-04-02 752 }
fd558d186df2c13 James Chapman 2010-04-02 753 }
fd558d186df2c13 James Chapman 2010-04-02 754
900631ee6a2651d James Chapman 2018-01-03 755 /* Session data offset is defined only for L2TPv2 and is
900631ee6a2651d James Chapman 2018-01-03 756 * indicated by an optional 16-bit value in the header.
f7faffa3ff8ef6a James Chapman 2010-04-02 757 */
f7faffa3ff8ef6a James Chapman 2010-04-02 758 if (tunnel->version == L2TP_HDR_VER_2) {
fd558d186df2c13 James Chapman 2010-04-02 759 /* If offset bit set, skip it. */
fd558d186df2c13 James Chapman 2010-04-02 760 if (hdrflags & L2TP_HDRFLAG_O) {
fd558d186df2c13 James Chapman 2010-04-02 761 offset = ntohs(*(__be16 *)ptr);
fd558d186df2c13 James Chapman 2010-04-02 762 ptr += 2 + offset;
fd558d186df2c13 James Chapman 2010-04-02 763 }
900631ee6a2651d James Chapman 2018-01-03 764 }
fd558d186df2c13 James Chapman 2010-04-02 765
fd558d186df2c13 James Chapman 2010-04-02 766 offset = ptr - optr;
fd558d186df2c13 James Chapman 2010-04-02 767 if (!pskb_may_pull(skb, offset))
fd558d186df2c13 James Chapman 2010-04-02 768 goto discard;
fd558d186df2c13 James Chapman 2010-04-02 769
fd558d186df2c13 James Chapman 2010-04-02 770 __skb_pull(skb, offset);
fd558d186df2c13 James Chapman 2010-04-02 771
fd558d186df2c13 James Chapman 2010-04-02 772 /* Prepare skb for adding to the session's reorder_q. Hold
fd558d186df2c13 James Chapman 2010-04-02 773 * packets for max reorder_timeout or 1 second if not
fd558d186df2c13 James Chapman 2010-04-02 774 * reordering.
fd558d186df2c13 James Chapman 2010-04-02 775 */
fd558d186df2c13 James Chapman 2010-04-02 776 L2TP_SKB_CB(skb)->length = length;
fd558d186df2c13 James Chapman 2010-04-02 777 L2TP_SKB_CB(skb)->expires = jiffies +
fd558d186df2c13 James Chapman 2010-04-02 778 (session->reorder_timeout ? session->reorder_timeout : HZ);
fd558d186df2c13 James Chapman 2010-04-02 779
fd558d186df2c13 James Chapman 2010-04-02 780 /* Add packet to the session's receive queue. Reordering is done here, if
fd558d186df2c13 James Chapman 2010-04-02 781 * enabled. Saved L2TP protocol info is stored in skb->sb[].
fd558d186df2c13 James Chapman 2010-04-02 782 */
fd558d186df2c13 James Chapman 2010-04-02 783 if (L2TP_SKB_CB(skb)->has_seq) {
b6dc01a43aaca24 James Chapman 2013-07-02 784 if (l2tp_recv_data_seq(session, skb))
fd558d186df2c13 James Chapman 2010-04-02 785 goto discard;
fd558d186df2c13 James Chapman 2010-04-02 786 } else {
fd558d186df2c13 James Chapman 2010-04-02 787 /* No sequence numbers. Add the skb to the tail of the
fd558d186df2c13 James Chapman 2010-04-02 788 * reorder queue. This ensures that it will be
fd558d186df2c13 James Chapman 2010-04-02 789 * delivered after all previous sequenced skbs.
fd558d186df2c13 James Chapman 2010-04-02 790 */
fd558d186df2c13 James Chapman 2010-04-02 791 skb_queue_tail(&session->reorder_q, skb);
fd558d186df2c13 James Chapman 2010-04-02 792 }
fd558d186df2c13 James Chapman 2010-04-02 793
fd558d186df2c13 James Chapman 2010-04-02 794 /* Try to dequeue as many skbs from reorder_q as we can. */
fd558d186df2c13 James Chapman 2010-04-02 795 l2tp_recv_dequeue(session);
fd558d186df2c13 James Chapman 2010-04-02 796
f7faffa3ff8ef6a James Chapman 2010-04-02 797 return;
fd558d186df2c13 James Chapman 2010-04-02 798
fd558d186df2c13 James Chapman 2010-04-02 799 discard:
7b7c0719cd7afee Tom Parkin 2013-03-19 800 atomic_long_inc(&session->stats.rx_errors);
fd558d186df2c13 James Chapman 2010-04-02 801 kfree_skb(skb);
f7faffa3ff8ef6a James Chapman 2010-04-02 802 }
ca7885dbcd899e6 Tom Parkin 2020-07-28 803 EXPORT_SYMBOL_GPL(l2tp_recv_common);
f7faffa3ff8ef6a James Chapman 2010-04-02 804
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month