[lpieralisi-pci:pci/rcar 8/11] drivers/pci/endpoint/pci-epc-mem.c:65 pci_epc_multi_mem_init() warn: double check that we're allocating correct size: 4 vs 112
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git pci/rcar
head: 3aecbd9786b5e91d7d4819434b20db7dcf71761b
commit: ecbae8715e31504a6ca2f596ed5322a78bb971cb [8/11] PCI: endpoint: Add support to handle multiple base for mapping outbound memory
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/pci/endpoint/pci-epc-mem.c:65 pci_epc_multi_mem_init() warn: double check that we're allocating correct size: 4 vs 112
# https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit...
git remote add lpieralisi-pci https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git
git remote update lpieralisi-pci
git checkout ecbae8715e31504a6ca2f596ed5322a78bb971cb
vim +65 drivers/pci/endpoint/pci-epc-mem.c
ecbae8715e31504 Lad Prabhakar 2020-05-07 47 int pci_epc_multi_mem_init(struct pci_epc *epc,
ecbae8715e31504 Lad Prabhakar 2020-05-07 48 struct pci_epc_mem_window *windows,
ecbae8715e31504 Lad Prabhakar 2020-05-07 49 unsigned int num_windows)
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 50 {
ecbae8715e31504 Lad Prabhakar 2020-05-07 51 struct pci_epc_mem *mem = NULL;
ecbae8715e31504 Lad Prabhakar 2020-05-07 52 unsigned long *bitmap = NULL;
52c9285d47459cf Kishon Vijay Abraham I 2017-08-18 53 unsigned int page_shift;
ecbae8715e31504 Lad Prabhakar 2020-05-07 54 size_t page_size;
52c9285d47459cf Kishon Vijay Abraham I 2017-08-18 55 int bitmap_size;
ecbae8715e31504 Lad Prabhakar 2020-05-07 56 int pages;
ecbae8715e31504 Lad Prabhakar 2020-05-07 57 int ret;
ecbae8715e31504 Lad Prabhakar 2020-05-07 58 int i;
ecbae8715e31504 Lad Prabhakar 2020-05-07 59
ecbae8715e31504 Lad Prabhakar 2020-05-07 60 epc->num_windows = 0;
ecbae8715e31504 Lad Prabhakar 2020-05-07 61
ecbae8715e31504 Lad Prabhakar 2020-05-07 62 if (!windows || !num_windows)
ecbae8715e31504 Lad Prabhakar 2020-05-07 63 return -EINVAL;
52c9285d47459cf Kishon Vijay Abraham I 2017-08-18 64
ecbae8715e31504 Lad Prabhakar 2020-05-07 @65 epc->windows = kcalloc(num_windows, sizeof(*mem), GFP_KERNEL);
^^^^^^^^^^^^
Wrong sizeof(). It should be sizeof(*epc->windows). I haven't looked
at the size difference but presumably Smatch is correct.
ecbae8715e31504 Lad Prabhakar 2020-05-07 66 if (!epc->windows)
ecbae8715e31504 Lad Prabhakar 2020-05-07 67 return -ENOMEM;
ecbae8715e31504 Lad Prabhakar 2020-05-07 68
ecbae8715e31504 Lad Prabhakar 2020-05-07 69 for (i = 0; i < num_windows; i++) {
ecbae8715e31504 Lad Prabhakar 2020-05-07 70 page_size = windows[i].page_size;
52c9285d47459cf Kishon Vijay Abraham I 2017-08-18 71 if (page_size < PAGE_SIZE)
52c9285d47459cf Kishon Vijay Abraham I 2017-08-18 72 page_size = PAGE_SIZE;
52c9285d47459cf Kishon Vijay Abraham I 2017-08-18 73 page_shift = ilog2(page_size);
ecbae8715e31504 Lad Prabhakar 2020-05-07 74 pages = windows[i].size >> page_shift;
52c9285d47459cf Kishon Vijay Abraham I 2017-08-18 75 bitmap_size = BITS_TO_LONGS(pages) * sizeof(long);
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 76
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 77 mem = kzalloc(sizeof(*mem), GFP_KERNEL);
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 78 if (!mem) {
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 79 ret = -ENOMEM;
ecbae8715e31504 Lad Prabhakar 2020-05-07 80 i--;
ecbae8715e31504 Lad Prabhakar 2020-05-07 81 goto err_mem;
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 82 }
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 83
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 84 bitmap = kzalloc(bitmap_size, GFP_KERNEL);
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 85 if (!bitmap) {
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 86 ret = -ENOMEM;
ecbae8715e31504 Lad Prabhakar 2020-05-07 87 kfree(mem);
ecbae8715e31504 Lad Prabhakar 2020-05-07 88 i--;
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 89 goto err_mem;
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 90 }
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 91
ecbae8715e31504 Lad Prabhakar 2020-05-07 92 mem->window.phys_base = windows[i].phys_base;
ecbae8715e31504 Lad Prabhakar 2020-05-07 93 mem->window.size = windows[i].size;
ecbae8715e31504 Lad Prabhakar 2020-05-07 94 mem->window.page_size = page_size;
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 95 mem->bitmap = bitmap;
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 96 mem->pages = pages;
04e046ca57ebed3 Kishon Vijay Abraham I 2020-02-24 97 mutex_init(&mem->lock);
ecbae8715e31504 Lad Prabhakar 2020-05-07 98 epc->windows[i] = mem;
ecbae8715e31504 Lad Prabhakar 2020-05-07 99 }
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 100
ecbae8715e31504 Lad Prabhakar 2020-05-07 101 epc->mem = epc->windows[0];
ecbae8715e31504 Lad Prabhakar 2020-05-07 102 epc->num_windows = num_windows;
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 103
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 104 return 0;
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 105
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 106 err_mem:
ecbae8715e31504 Lad Prabhakar 2020-05-07 107 for (; i >= 0; i--) {
ecbae8715e31504 Lad Prabhakar 2020-05-07 108 mem = epc->windows[i];
ecbae8715e31504 Lad Prabhakar 2020-05-07 109 kfree(mem->bitmap);
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 110 kfree(mem);
ecbae8715e31504 Lad Prabhakar 2020-05-07 111 }
ecbae8715e31504 Lad Prabhakar 2020-05-07 112 kfree(epc->windows);
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 113
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 114 return ret;
5e8cb4033807e39 Kishon Vijay Abraham I 2017-04-10 115 }
---
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 net-next 3/6] vxlan: ecmp support for mac fdb entries
by kbuild test robot
Hi Roopa,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
[also build test WARNING on net/master kselftest/next sparc-next/master linus/master v5.7-rc6 next-20200518]
[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/Roopa-Prabhu/Support-for-fdb-ECM...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 5cdfe8306631b2224e3f81fc5a1e2721c7a1948b
config: um-defconfig (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=um
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 <<):
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
In file included from include/linux/kernel.h:11:0,
from net/ipv4/ip_tunnel_core.c:9:
include/asm-generic/fixmap.h: In function 'fix_to_virt':
include/asm-generic/fixmap.h:32:19: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) ^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
^~~~~~~~~~~~~~~~
include/asm-generic/fixmap.h:32:2: note: in expansion of macro 'BUILD_BUG_ON'
BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
^~~~~~~~~~~~
In file included from include/linux/uaccess.h:11:0,
from include/linux/sched/task.h:11,
from include/linux/sched/signal.h:9,
from include/linux/rcuwait.h:6,
from include/linux/percpu-rwsem.h:7,
from include/linux/fs.h:34,
from include/linux/huge_mm.h:8,
from include/linux/mm.h:679,
from include/linux/bvec.h:13,
from include/linux/skbuff.h:17,
from net/ipv4/ip_tunnel_core.c:10:
arch/um/include/asm/uaccess.h: In function '__access_ok':
arch/um/include/asm/uaccess.h:17:29: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
(((unsigned long) (addr) >= FIXADDR_USER_START) && ^
arch/um/include/asm/uaccess.h:45:3: note: in expansion of macro '__access_ok_vsyscall'
__access_ok_vsyscall(addr, size) ||
^~~~~~~~~~~~~~~~~~~~
In file included from net/ipv4/ip_tunnel_core.c:38:0:
include/net/vxlan.h: In function 'vxlan_fdb_nh_path_select':
include/net/vxlan.h:496:8: error: implicit declaration of function 'nexthop_path_fdb_result' [-Werror=implicit-function-declaration]
nhc = nexthop_path_fdb_result(nh, hash);
^~~~~~~~~~~~~~~~~~~~~~~
>> include/net/vxlan.h:496:6: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
nhc = nexthop_path_fdb_result(nh, hash);
^
cc1: some warnings being treated as errors
vim +496 include/net/vxlan.h
489
490 static inline bool vxlan_fdb_nh_path_select(struct nexthop *nh,
491 int hash,
492 struct vxlan_rdst *rdst)
493 {
494 struct fib_nh_common *nhc;
495
> 496 nhc = nexthop_path_fdb_result(nh, hash);
497 if (unlikely(!nhc))
498 return false;
499
500 switch (nhc->nhc_gw_family) {
501 case AF_INET:
502 rdst->remote_ip.sin.sin_addr.s_addr = nhc->nhc_gw.ipv4;
503 rdst->remote_ip.sa.sa_family = AF_INET;
504 break;
505 case AF_INET6:
506 rdst->remote_ip.sin6.sin6_addr = nhc->nhc_gw.ipv6;
507 rdst->remote_ip.sa.sa_family = AF_INET6;
508 break;
509 }
510
511 return true;
512 }
513
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
kernel/trace/bpf_trace.c:216:36: warning: unused variable 'bpf_probe_read_compat_proto'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 642b151f45dd54809ea00ecd3976a56c1ec9b53d
commit: 0ebeea8ca8a4d1d453ad299aef0507dab04f6e8d bpf: Restrict bpf_probe_read{, str}() only to archs where they work
date: 4 days ago
config: s390-randconfig-r021-20200519 (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 s390 cross compiling tool for clang build
# apt-get install binutils-s390-linux-gnu
git checkout 0ebeea8ca8a4d1d453ad299aef0507dab04f6e8d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:492:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : ^
include/uapi/linux/swab.h:20:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x0000ff00UL) << 8) | ^
In file included from kernel/trace/bpf_trace.c:10:
In file included from include/linux/filter.h:13:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:492:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : ^
include/uapi/linux/swab.h:21:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | ^
In file included from kernel/trace/bpf_trace.c:10:
In file included from include/linux/filter.h:13:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:492:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : ^
include/uapi/linux/swab.h:22:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0xff000000UL) >> 24)))
^
In file included from kernel/trace/bpf_trace.c:10:
In file included from include/linux/filter.h:13:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:492:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:120:12: note: expanded from macro '__swab32'
__fswab32(x))
^
In file included from kernel/trace/bpf_trace.c:10:
In file included from include/linux/filter.h:13:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:503:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:513:46: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew(cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:523:46: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel(cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:585:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:593:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:601:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:610:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:619:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:628:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> kernel/trace/bpf_trace.c:216:36: warning: unused variable 'bpf_probe_read_compat_proto' [-Wunused-const-variable]
static const struct bpf_func_proto bpf_probe_read_compat_proto = {
^
>> kernel/trace/bpf_trace.c:271:36: warning: unused variable 'bpf_probe_read_compat_str_proto' [-Wunused-const-variable]
static const struct bpf_func_proto bpf_probe_read_compat_str_proto = {
^
22 warnings generated.
vim +/bpf_probe_read_compat_proto +216 kernel/trace/bpf_trace.c
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 215
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 @216 static const struct bpf_func_proto bpf_probe_read_compat_proto = {
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 217 .func = bpf_probe_read_compat,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 218 .gpl_only = true,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 219 .ret_type = RET_INTEGER,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 220 .arg1_type = ARG_PTR_TO_UNINIT_MEM,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 221 .arg2_type = ARG_CONST_SIZE_OR_ZERO,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 222 .arg3_type = ARG_ANYTHING,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 223 };
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 224
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 225 static __always_inline int
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 226 bpf_probe_read_kernel_str_common(void *dst, u32 size, const void *unsafe_ptr,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 227 const bool compat)
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 228 {
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 229 int ret = security_locked_down(LOCKDOWN_BPF_READ);
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 230
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 231 if (unlikely(ret < 0))
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 232 goto out;
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 233 /*
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 234 * The strncpy_from_unsafe_*() call will likely not fill the entire
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 235 * buffer, but that's okay in this circumstance as we're probing
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 236 * arbitrary memory anyway similar to bpf_probe_read_*() and might
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 237 * as well probe the stack. Thus, memory is explicitly cleared
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 238 * only in error case, so that improper users ignoring return
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 239 * code altogether don't copy garbage; otherwise length of string
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 240 * is returned that can be used for bpf_perf_event_output() et al.
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 241 */
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 242 ret = compat ? strncpy_from_unsafe(dst, unsafe_ptr, size) :
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 243 strncpy_from_unsafe_strict(dst, unsafe_ptr, size);
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 244 if (unlikely(ret < 0))
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 245 out:
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 246 memset(dst, 0, size);
074f528eed408b4 Daniel Borkmann 2016-04-13 247 return ret;
2541517c32be253 Alexei Starovoitov 2015-03-25 248 }
2541517c32be253 Alexei Starovoitov 2015-03-25 249
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 250 BPF_CALL_3(bpf_probe_read_kernel_str, void *, dst, u32, size,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 251 const void *, unsafe_ptr)
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 252 {
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 253 return bpf_probe_read_kernel_str_common(dst, size, unsafe_ptr, false);
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 254 }
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 255
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 256 static const struct bpf_func_proto bpf_probe_read_kernel_str_proto = {
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 257 .func = bpf_probe_read_kernel_str,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 258 .gpl_only = true,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 259 .ret_type = RET_INTEGER,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 260 .arg1_type = ARG_PTR_TO_UNINIT_MEM,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 261 .arg2_type = ARG_CONST_SIZE_OR_ZERO,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 262 .arg3_type = ARG_ANYTHING,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 263 };
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 264
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 265 BPF_CALL_3(bpf_probe_read_compat_str, void *, dst, u32, size,
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 266 const void *, unsafe_ptr)
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 267 {
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 268 return bpf_probe_read_kernel_str_common(dst, size, unsafe_ptr, true);
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 269 }
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 270
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 @271 static const struct bpf_func_proto bpf_probe_read_compat_str_proto = {
6ae08ae3dea2cfa Daniel Borkmann 2019-11-02 272 .func = bpf_probe_read_compat_str,
2541517c32be253 Alexei Starovoitov 2015-03-25 273 .gpl_only = true,
2541517c32be253 Alexei Starovoitov 2015-03-25 274 .ret_type = RET_INTEGER,
39f19ebbf57b403 Alexei Starovoitov 2017-01-09 275 .arg1_type = ARG_PTR_TO_UNINIT_MEM,
9c019e2bc4b2bd8 Yonghong Song 2017-11-12 276 .arg2_type = ARG_CONST_SIZE_OR_ZERO,
2541517c32be253 Alexei Starovoitov 2015-03-25 277 .arg3_type = ARG_ANYTHING,
2541517c32be253 Alexei Starovoitov 2015-03-25 278 };
2541517c32be253 Alexei Starovoitov 2015-03-25 279
:::::: The code at line 216 was first introduced by commit
:::::: 6ae08ae3dea2cfa03dd3665a3c8475c2d429ef47 bpf: Add probe_read_{user, kernel} and probe_read_{user, kernel}_str helpers
:::::: TO: Daniel Borkmann <daniel(a)iogearbox.net>
:::::: CC: Alexei Starovoitov <ast(a)kernel.org>
---
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 v2 bpf-next 1/7] bpf: implement BPF ring buffer and verifier support for it
by kbuild test robot
Hi Andrii,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
[also build test WARNING on next-20200518]
[cannot apply to bpf/master rcu/dev 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/Andrii-Nakryiko/BPF-ring-buffer/...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: nds32-allmodconfig (attached as .config)
compiler: nds32le-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=nds32
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 ./arch/nds32/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/nds32/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/ktime.h:24,
from include/linux/timer.h:6,
from include/linux/workqueue.h:9,
from include/linux/bpf.h:9,
from kernel/bpf/ringbuf.c:1:
include/linux/dma-mapping.h: In function 'dma_map_resource':
arch/nds32/include/asm/memory.h:82:32: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
82 | #define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_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))))
| ^~~~~~~~~
kernel/bpf/ringbuf.c: In function 'bpf_ringbuf_alloc':
>> kernel/bpf/ringbuf.c:133:14: warning: comparison is always false due to limited range of data type [-Wtype-limits]
133 | if (data_sz > RINGBUF_MAX_DATA_SZ)
| ^
vim +133 kernel/bpf/ringbuf.c
125
126 static struct bpf_ringbuf *bpf_ringbuf_alloc(size_t data_sz, int numa_node)
127 {
128 struct bpf_ringbuf *rb;
129
130 if (!data_sz || !PAGE_ALIGNED(data_sz))
131 return ERR_PTR(-EINVAL);
132
> 133 if (data_sz > RINGBUF_MAX_DATA_SZ)
134 return ERR_PTR(-E2BIG);
135
136 rb = bpf_ringbuf_area_alloc(data_sz, numa_node);
137 if (!rb)
138 return ERR_PTR(-ENOMEM);
139
140 spin_lock_init(&rb->spinlock);
141 init_waitqueue_head(&rb->waitq);
142 init_irq_work(&rb->work, bpf_ringbuf_notify);
143
144 rb->mask = data_sz - 1;
145 rb->consumer_pos = 0;
146 rb->producer_pos = 0;
147
148 return rb;
149 }
150
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[linux-next:master 6943/8703] drivers/net/dsa/sja1105/sja1105_static_config.c:463:8: warning: no previous prototype for function 'sja1105_vl_lookup_entry_packing'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: e098d7762d602be640c53565ceca342f81e55ad2
commit: 94f94d4acfb2a5e978f98d924be33c981e2f86c6 [6943/8703] net: dsa: sja1105: add static tables for virtual links
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
git checkout 94f94d4acfb2a5e978f98d924be33c981e2f86c6
# 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/dsa/sja1105/sja1105_static_config.c:105:8: warning: no previous prototype for function 'sja1105pqrs_avb_params_entry_packing' [-Wmissing-prototypes]
size_t sja1105pqrs_avb_params_entry_packing(void *buf, void *entry_ptr,
^
drivers/net/dsa/sja1105/sja1105_static_config.c:105:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
size_t sja1105pqrs_avb_params_entry_packing(void *buf, void *entry_ptr,
^
static
drivers/net/dsa/sja1105/sja1105_static_config.c:199:8: warning: no previous prototype for function 'sja1105_l2_forwarding_entry_packing' [-Wmissing-prototypes]
size_t sja1105_l2_forwarding_entry_packing(void *buf, void *entry_ptr,
^
drivers/net/dsa/sja1105/sja1105_static_config.c:199:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
size_t sja1105_l2_forwarding_entry_packing(void *buf, void *entry_ptr,
^
static
drivers/net/dsa/sja1105/sja1105_static_config.c:254:8: warning: no previous prototype for function 'sja1105et_l2_lookup_entry_packing' [-Wmissing-prototypes]
size_t sja1105et_l2_lookup_entry_packing(void *buf, void *entry_ptr,
^
drivers/net/dsa/sja1105/sja1105_static_config.c:254:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
size_t sja1105et_l2_lookup_entry_packing(void *buf, void *entry_ptr,
^
static
drivers/net/dsa/sja1105/sja1105_static_config.c:268:8: warning: no previous prototype for function 'sja1105pqrs_l2_lookup_entry_packing' [-Wmissing-prototypes]
size_t sja1105pqrs_l2_lookup_entry_packing(void *buf, void *entry_ptr,
^
drivers/net/dsa/sja1105/sja1105_static_config.c:268:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
size_t sja1105pqrs_l2_lookup_entry_packing(void *buf, void *entry_ptr,
^
static
drivers/net/dsa/sja1105/sja1105_static_config.c:344:8: warning: no previous prototype for function 'sja1105pqrs_mac_config_entry_packing' [-Wmissing-prototypes]
size_t sja1105pqrs_mac_config_entry_packing(void *buf, void *entry_ptr,
^
drivers/net/dsa/sja1105/sja1105_static_config.c:344:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
size_t sja1105pqrs_mac_config_entry_packing(void *buf, void *entry_ptr,
^
static
>> drivers/net/dsa/sja1105/sja1105_static_config.c:463:8: warning: no previous prototype for function 'sja1105_vl_lookup_entry_packing' [-Wmissing-prototypes]
size_t sja1105_vl_lookup_entry_packing(void *buf, void *entry_ptr,
^
drivers/net/dsa/sja1105/sja1105_static_config.c:463:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
size_t sja1105_vl_lookup_entry_packing(void *buf, void *entry_ptr,
^
static
drivers/net/dsa/sja1105/sja1105_static_config.c:513:8: warning: no previous prototype for function 'sja1105_vlan_lookup_entry_packing' [-Wmissing-prototypes]
size_t sja1105_vlan_lookup_entry_packing(void *buf, void *entry_ptr,
^
drivers/net/dsa/sja1105/sja1105_static_config.c:513:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
size_t sja1105_vlan_lookup_entry_packing(void *buf, void *entry_ptr,
^
static
7 warnings generated.
vim +/sja1105_vl_lookup_entry_packing +463 drivers/net/dsa/sja1105/sja1105_static_config.c
343
> 344 size_t sja1105pqrs_mac_config_entry_packing(void *buf, void *entry_ptr,
345 enum packing_op op)
346 {
347 const size_t size = SJA1105PQRS_SIZE_MAC_CONFIG_ENTRY;
348 struct sja1105_mac_config_entry *entry = entry_ptr;
349 int offset, i;
350
351 for (i = 0, offset = 104; i < 8; i++, offset += 19) {
352 sja1105_packing(buf, &entry->enabled[i],
353 offset + 0, offset + 0, size, op);
354 sja1105_packing(buf, &entry->base[i],
355 offset + 9, offset + 1, size, op);
356 sja1105_packing(buf, &entry->top[i],
357 offset + 18, offset + 10, size, op);
358 }
359 sja1105_packing(buf, &entry->ifg, 103, 99, size, op);
360 sja1105_packing(buf, &entry->speed, 98, 97, size, op);
361 sja1105_packing(buf, &entry->tp_delin, 96, 81, size, op);
362 sja1105_packing(buf, &entry->tp_delout, 80, 65, size, op);
363 sja1105_packing(buf, &entry->maxage, 64, 57, size, op);
364 sja1105_packing(buf, &entry->vlanprio, 56, 54, size, op);
365 sja1105_packing(buf, &entry->vlanid, 53, 42, size, op);
366 sja1105_packing(buf, &entry->ing_mirr, 41, 41, size, op);
367 sja1105_packing(buf, &entry->egr_mirr, 40, 40, size, op);
368 sja1105_packing(buf, &entry->drpnona664, 39, 39, size, op);
369 sja1105_packing(buf, &entry->drpdtag, 38, 38, size, op);
370 sja1105_packing(buf, &entry->drpuntag, 35, 35, size, op);
371 sja1105_packing(buf, &entry->retag, 34, 34, size, op);
372 sja1105_packing(buf, &entry->dyn_learn, 33, 33, size, op);
373 sja1105_packing(buf, &entry->egress, 32, 32, size, op);
374 sja1105_packing(buf, &entry->ingress, 31, 31, size, op);
375 return size;
376 }
377
378 static size_t
379 sja1105_schedule_entry_points_params_entry_packing(void *buf, void *entry_ptr,
380 enum packing_op op)
381 {
382 struct sja1105_schedule_entry_points_params_entry *entry = entry_ptr;
383 const size_t size = SJA1105_SIZE_SCHEDULE_ENTRY_POINTS_PARAMS_ENTRY;
384
385 sja1105_packing(buf, &entry->clksrc, 31, 30, size, op);
386 sja1105_packing(buf, &entry->actsubsch, 29, 27, size, op);
387 return size;
388 }
389
390 static size_t
391 sja1105_schedule_entry_points_entry_packing(void *buf, void *entry_ptr,
392 enum packing_op op)
393 {
394 struct sja1105_schedule_entry_points_entry *entry = entry_ptr;
395 const size_t size = SJA1105_SIZE_SCHEDULE_ENTRY_POINTS_ENTRY;
396
397 sja1105_packing(buf, &entry->subschindx, 31, 29, size, op);
398 sja1105_packing(buf, &entry->delta, 28, 11, size, op);
399 sja1105_packing(buf, &entry->address, 10, 1, size, op);
400 return size;
401 }
402
403 static size_t sja1105_schedule_params_entry_packing(void *buf, void *entry_ptr,
404 enum packing_op op)
405 {
406 const size_t size = SJA1105_SIZE_SCHEDULE_PARAMS_ENTRY;
407 struct sja1105_schedule_params_entry *entry = entry_ptr;
408 int offset, i;
409
410 for (i = 0, offset = 16; i < 8; i++, offset += 10)
411 sja1105_packing(buf, &entry->subscheind[i],
412 offset + 9, offset + 0, size, op);
413 return size;
414 }
415
416 static size_t sja1105_schedule_entry_packing(void *buf, void *entry_ptr,
417 enum packing_op op)
418 {
419 const size_t size = SJA1105_SIZE_SCHEDULE_ENTRY;
420 struct sja1105_schedule_entry *entry = entry_ptr;
421
422 sja1105_packing(buf, &entry->winstindex, 63, 54, size, op);
423 sja1105_packing(buf, &entry->winend, 53, 53, size, op);
424 sja1105_packing(buf, &entry->winst, 52, 52, size, op);
425 sja1105_packing(buf, &entry->destports, 51, 47, size, op);
426 sja1105_packing(buf, &entry->setvalid, 46, 46, size, op);
427 sja1105_packing(buf, &entry->txen, 45, 45, size, op);
428 sja1105_packing(buf, &entry->resmedia_en, 44, 44, size, op);
429 sja1105_packing(buf, &entry->resmedia, 43, 36, size, op);
430 sja1105_packing(buf, &entry->vlindex, 35, 26, size, op);
431 sja1105_packing(buf, &entry->delta, 25, 8, size, op);
432 return size;
433 }
434
435 static size_t
436 sja1105_vl_forwarding_params_entry_packing(void *buf, void *entry_ptr,
437 enum packing_op op)
438 {
439 struct sja1105_vl_forwarding_params_entry *entry = entry_ptr;
440 const size_t size = SJA1105_SIZE_VL_FORWARDING_PARAMS_ENTRY;
441 int offset, i;
442
443 for (i = 0, offset = 16; i < 8; i++, offset += 10)
444 sja1105_packing(buf, &entry->partspc[i],
445 offset + 9, offset + 0, size, op);
446 sja1105_packing(buf, &entry->debugen, 15, 15, size, op);
447 return size;
448 }
449
450 static size_t sja1105_vl_forwarding_entry_packing(void *buf, void *entry_ptr,
451 enum packing_op op)
452 {
453 struct sja1105_vl_forwarding_entry *entry = entry_ptr;
454 const size_t size = SJA1105_SIZE_VL_FORWARDING_ENTRY;
455
456 sja1105_packing(buf, &entry->type, 31, 31, size, op);
457 sja1105_packing(buf, &entry->priority, 30, 28, size, op);
458 sja1105_packing(buf, &entry->partition, 27, 25, size, op);
459 sja1105_packing(buf, &entry->destports, 24, 20, size, op);
460 return size;
461 }
462
> 463 size_t sja1105_vl_lookup_entry_packing(void *buf, void *entry_ptr,
464 enum packing_op op)
465 {
466 struct sja1105_vl_lookup_entry *entry = entry_ptr;
467 const size_t size = SJA1105_SIZE_VL_LOOKUP_ENTRY;
468
469 if (entry->format == SJA1105_VL_FORMAT_PSFP) {
470 /* Interpreting vllupformat as 0 */
471 sja1105_packing(buf, &entry->destports,
472 95, 91, size, op);
473 sja1105_packing(buf, &entry->iscritical,
474 90, 90, size, op);
475 sja1105_packing(buf, &entry->macaddr,
476 89, 42, size, op);
477 sja1105_packing(buf, &entry->vlanid,
478 41, 30, size, op);
479 sja1105_packing(buf, &entry->port,
480 29, 27, size, op);
481 sja1105_packing(buf, &entry->vlanprior,
482 26, 24, size, op);
483 } else {
484 /* Interpreting vllupformat as 1 */
485 sja1105_packing(buf, &entry->egrmirr,
486 95, 91, size, op);
487 sja1105_packing(buf, &entry->ingrmirr,
488 90, 90, size, op);
489 sja1105_packing(buf, &entry->vlid,
490 57, 42, size, op);
491 sja1105_packing(buf, &entry->port,
492 29, 27, size, op);
493 }
494 return size;
495 }
496
---
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 net-next 3/6] vxlan: ecmp support for mac fdb entries
by kbuild test robot
Hi Roopa,
I love your patch! Yet something to improve:
[auto build test ERROR on net-next/master]
[also build test ERROR on net/master kselftest/next sparc-next/master linus/master v5.7-rc6 next-20200518]
[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/Roopa-Prabhu/Support-for-fdb-ECM...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 5cdfe8306631b2224e3f81fc5a1e2721c7a1948b
config: sh-polaris_defconfig (attached as .config)
compiler: sh4-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=sh
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 <<):
In file included from net/ipv4/ip_tunnel_core.c:38:
include/net/vxlan.h: In function 'vxlan_fdb_nh_path_select':
>> include/net/vxlan.h:496:8: error: implicit declaration of function 'nexthop_path_fdb_result' [-Werror=implicit-function-declaration]
496 | nhc = nexthop_path_fdb_result(nh, hash);
| ^~~~~~~~~~~~~~~~~~~~~~~
>> include/net/vxlan.h:496:6: warning: assignment to 'struct fib_nh_common *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
496 | nhc = nexthop_path_fdb_result(nh, hash);
| ^
cc1: some warnings being treated as errors
vim +/nexthop_path_fdb_result +496 include/net/vxlan.h
489
490 static inline bool vxlan_fdb_nh_path_select(struct nexthop *nh,
491 int hash,
492 struct vxlan_rdst *rdst)
493 {
494 struct fib_nh_common *nhc;
495
> 496 nhc = nexthop_path_fdb_result(nh, hash);
497 if (unlikely(!nhc))
498 return false;
499
500 switch (nhc->nhc_gw_family) {
501 case AF_INET:
502 rdst->remote_ip.sin.sin_addr.s_addr = nhc->nhc_gw.ipv4;
503 rdst->remote_ip.sa.sa_family = AF_INET;
504 break;
505 case AF_INET6:
506 rdst->remote_ip.sin6.sin6_addr = nhc->nhc_gw.ipv6;
507 rdst->remote_ip.sa.sa_family = AF_INET6;
508 break;
509 }
510
511 return true;
512 }
513
---
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 V1 6/6] staging: greybus: audio: Enable GB codec, audio module compilation.
by kbuild test robot
Hi Vaibhav,
I love your patch! Perhaps something to improve:
[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v5.7-rc6 next-20200518]
[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/Vaibhav-Agarwal/Enable-Greybus-A...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git cef077e6aa4c7dbe2f23e1201cf705f9540ec467
config: nds32-allyesconfig (attached as .config)
compiler: nds32le-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=nds32
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/staging/greybus/audio_helper.c:59:5: warning: no previous prototype for 'gbaudio_dapm_link_component_dai_widgets' [-Wmissing-prototypes]
59 | int gbaudio_dapm_link_component_dai_widgets(struct snd_soc_card *card,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/greybus/audio_helper.c:112:5: warning: no previous prototype for 'gbaudio_dapm_free_controls' [-Wmissing-prototypes]
112 | int gbaudio_dapm_free_controls(struct snd_soc_dapm_context *dapm,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/greybus/audio_helper.c:189:5: warning: no previous prototype for 'gbaudio_remove_component_controls' [-Wmissing-prototypes]
189 | int gbaudio_remove_component_controls(struct snd_soc_component *component,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
drivers/staging/greybus/audio_topology.c: In function 'find_gb_module':
>> drivers/staging/greybus/audio_topology.c:31:14: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
31 | int dev_id, ret;
| ^~~
drivers/staging/greybus/audio_topology.c: In function 'gbcodec_mixer_dapm_ctl_get':
>> drivers/staging/greybus/audio_topology.c:380:33: warning: variable 'info' set but not used [-Wunused-but-set-variable]
380 | struct gb_audio_ctl_elem_info *info;
| ^~~~
vim +/gbaudio_dapm_link_component_dai_widgets +59 drivers/staging/greybus/audio_helper.c
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 58
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 @59 int gbaudio_dapm_link_component_dai_widgets(struct snd_soc_card *card,
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 60 struct snd_soc_dapm_context *dapm)
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 61 {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 62 struct snd_soc_dapm_widget *dai_w;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 63
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 64 /* For each DAI widget... */
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 65 list_for_each_entry(dai_w, &card->widgets, list) {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 66 if (dai_w->dapm != dapm)
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 67 continue;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 68 switch (dai_w->id) {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 69 case snd_soc_dapm_dai_in:
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 70 case snd_soc_dapm_dai_out:
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 71 break;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 72 default:
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 73 continue;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 74 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 75 gbaudio_dapm_link_dai_widget(dai_w, card);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 76 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 77
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 78 return 0;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 79 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 80
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 81 static void gbaudio_dapm_free_path(struct snd_soc_dapm_path *path)
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 82 {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 83 list_del(&path->list_node[SND_SOC_DAPM_DIR_IN]);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 84 list_del(&path->list_node[SND_SOC_DAPM_DIR_OUT]);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 85 list_del(&path->list_kcontrol);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 86 list_del(&path->list);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 87 kfree(path);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 88 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 89
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 90 static void gbaudio_dapm_free_widget(struct snd_soc_dapm_widget *w)
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 91 {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 92 struct snd_soc_dapm_path *p, *next_p;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 93 enum snd_soc_dapm_direction dir;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 94
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 95 list_del(&w->list);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 96 /*
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 97 * remove source and sink paths associated to this widget.
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 98 * While removing the path, remove reference to it from both
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 99 * source and sink widgets so that path is removed only once.
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 100 */
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 101 gbaudio_dapm_for_each_direction(dir) {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 102 snd_soc_dapm_widget_for_each_path_safe(w, dir, p, next_p)
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 103 gbaudio_dapm_free_path(p);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 104 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 105
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 106 kfree(w->kcontrols);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 107 kfree_const(w->name);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 108 kfree_const(w->sname);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 109 kfree(w);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 110 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 111
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 @112 int gbaudio_dapm_free_controls(struct snd_soc_dapm_context *dapm,
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 113 const struct snd_soc_dapm_widget *widget,
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 114 int num)
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 115 {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 116 int i;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 117 struct snd_soc_dapm_widget *w, *next_w;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 118 #ifdef CONFIG_DEBUG_FS
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 119 struct dentry *parent = dapm->debugfs_dapm;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 120 struct dentry *debugfs_w = NULL;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 121 #endif
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 122
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 123 mutex_lock(&dapm->card->dapm_mutex);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 124 for (i = 0; i < num; i++) {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 125 /* below logic can be optimized to identify widget pointer */
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 126 list_for_each_entry_safe(w, next_w, &dapm->card->widgets,
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 127 list) {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 128 if (w->dapm != dapm)
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 129 continue;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 130 if (!strcmp(w->name, widget->name))
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 131 break;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 132 w = NULL;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 133 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 134 if (!w) {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 135 dev_err(dapm->dev, "%s: widget not found\n",
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 136 widget->name);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 137 return -EINVAL;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 138 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 139 widget++;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 140 #ifdef CONFIG_DEBUG_FS
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 141 if (!parent)
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 142 debugfs_w = debugfs_lookup(w->name, parent);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 143 debugfs_remove(debugfs_w);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 144 debugfs_w = NULL;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 145 #endif
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 146 gbaudio_dapm_free_widget(w);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 147 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 148 mutex_unlock(&dapm->card->dapm_mutex);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 149 return 0;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 150 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 151
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 152 static int gbaudio_remove_controls(struct snd_card *card, struct device *dev,
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 153 const struct snd_kcontrol_new *controls,
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 154 int num_controls, const char *prefix)
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 155 {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 156 int i, err;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 157
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 158 for (i = 0; i < num_controls; i++) {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 159 const struct snd_kcontrol_new *control = &controls[i];
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 160 struct snd_ctl_elem_id id;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 161 struct snd_kcontrol *kctl;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 162
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 163 if (prefix)
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 164 snprintf(id.name, sizeof(id.name), "%s %s", prefix,
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 165 control->name);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 166 else
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 167 strlcpy(id.name, control->name, sizeof(id.name));
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 168 id.numid = 0;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 169 id.iface = control->iface;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 170 id.device = control->device;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 171 id.subdevice = control->subdevice;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 172 id.index = control->index;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 173 kctl = snd_ctl_find_id(card, &id);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 174 if (!kctl) {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 175 dev_err(dev, "%d: Failed to find %s\n", err,
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 176 control->name);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 177 return -ENOENT;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 178 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 179 err = snd_ctl_remove(card, kctl);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 180 if (err < 0) {
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 181 dev_err(dev, "%d: Failed to remove %s\n", err,
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 182 control->name);
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 183 return err;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 184 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 185 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 186 return 0;
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 187 }
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 188
94b08a33fd1bcaa Vaibhav Agarwal 2020-05-17 @189 int gbaudio_remove_component_controls(struct snd_soc_component *component,
:::::: The code at line 59 was first introduced by commit
:::::: 94b08a33fd1bcaa8660430f8107b5c7bbfbca3b4 staging: greybus: audio: Add helper APIs for dynamic audio modules
:::::: TO: Vaibhav Agarwal <vaibhav.sr(a)gmail.com>
:::::: CC: 0day robot <lkp(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[hnaz-linux-mm:master 476/523] arch/powerpc/xmon/xmon.c:3138:16: warning: variable 'pgdir' set but not used
by kbuild test robot
tree: https://github.com/hnaz/linux-mm master
head: 2bbf0589bfeb27800c730b76eacf34528eee5418
commit: 47dde7dbc279f3698c76a7b92ac0d0f1913539af [476/523] powerpc: add support for folded p4d page tables
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
git checkout 47dde7dbc279f3698c76a7b92ac0d0f1913539af
# 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 warnings (new ones prefixed by >>, old ones prefixed by <<):
arch/powerpc/xmon/xmon.c: In function 'show_pte':
>> arch/powerpc/xmon/xmon.c:3138:16: warning: variable 'pgdir' set but not used [-Wunused-but-set-variable]
3138 | pgd_t *pgdp, *pgdir;
| ^~~~~
arch/powerpc/xmon/xmon.c: At top level:
arch/powerpc/xmon/xmon.c:4122:1: warning: no previous prototype for 'spu_inst_dump' [-Wmissing-prototypes]
4122 | spu_inst_dump(unsigned long adr, long count, int praddr)
| ^~~~~~~~~~~~~
arch/powerpc/xmon/xmon.c: In function 'xmon_print_symbol':
arch/powerpc/xmon/xmon.c:3557:14: warning: variable 'name' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
3557 | const char *name = NULL;
| ^~~~
arch/powerpc/xmon/xmon.c: In function 'stop_spus':
arch/powerpc/xmon/xmon.c:3990:6: warning: variable 'i' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
3990 | int i;
| ^
arch/powerpc/xmon/xmon.c: In function 'restart_spus':
arch/powerpc/xmon/xmon.c:4031:6: warning: variable 'i' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
4031 | int i;
| ^
arch/powerpc/xmon/xmon.c: In function 'dump_opal_msglog':
arch/powerpc/xmon/xmon.c:2937:9: warning: variable 'pos' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
2937 | loff_t pos = 0;
| ^~~
arch/powerpc/xmon/xmon.c: In function 'show_pte':
arch/powerpc/xmon/xmon.c:3136:22: warning: variable 'tsk' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
3136 | struct task_struct *tsk = NULL;
| ^~~
arch/powerpc/xmon/xmon.c: In function 'show_tasks':
arch/powerpc/xmon/xmon.c:3234:22: warning: variable 'tsk' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
3234 | struct task_struct *tsk = NULL;
| ^~~
arch/powerpc/xmon/xmon.c: In function 'xmon_core':
arch/powerpc/xmon/xmon.c:490:6: warning: variable 'cmd' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
490 | int cmd = 0;
| ^~~
arch/powerpc/xmon/xmon.c:849:14: warning: variable 'bp' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
849 | struct bpt *bp;
| ^~
arch/powerpc/xmon/xmon.c:849:14: warning: variable 'bp' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
arch/powerpc/xmon/xmon.c:488:48: warning: argument 'fromipi' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
488 | static int xmon_core(struct pt_regs *regs, int fromipi)
| ~~~~^~~~~~~
vim +/pgdir +3138 arch/powerpc/xmon/xmon.c
80eff6c4847997 Balbir Singh 2017-10-30 3132
80eff6c4847997 Balbir Singh 2017-10-30 3133 static void show_pte(unsigned long addr)
80eff6c4847997 Balbir Singh 2017-10-30 3134 {
80eff6c4847997 Balbir Singh 2017-10-30 3135 unsigned long tskv = 0;
80eff6c4847997 Balbir Singh 2017-10-30 3136 struct task_struct *tsk = NULL;
80eff6c4847997 Balbir Singh 2017-10-30 3137 struct mm_struct *mm;
80eff6c4847997 Balbir Singh 2017-10-30 @3138 pgd_t *pgdp, *pgdir;
47dde7dbc279f3 Mike Rapoport 2020-05-16 3139 p4d_t *p4dp;
80eff6c4847997 Balbir Singh 2017-10-30 3140 pud_t *pudp;
80eff6c4847997 Balbir Singh 2017-10-30 3141 pmd_t *pmdp;
80eff6c4847997 Balbir Singh 2017-10-30 3142 pte_t *ptep;
80eff6c4847997 Balbir Singh 2017-10-30 3143
80eff6c4847997 Balbir Singh 2017-10-30 3144 if (!scanhex(&tskv))
80eff6c4847997 Balbir Singh 2017-10-30 3145 mm = &init_mm;
80eff6c4847997 Balbir Singh 2017-10-30 3146 else
80eff6c4847997 Balbir Singh 2017-10-30 3147 tsk = (struct task_struct *)tskv;
80eff6c4847997 Balbir Singh 2017-10-30 3148
80eff6c4847997 Balbir Singh 2017-10-30 3149 if (tsk == NULL)
80eff6c4847997 Balbir Singh 2017-10-30 3150 mm = &init_mm;
80eff6c4847997 Balbir Singh 2017-10-30 3151 else
80eff6c4847997 Balbir Singh 2017-10-30 3152 mm = tsk->active_mm;
80eff6c4847997 Balbir Singh 2017-10-30 3153
80eff6c4847997 Balbir Singh 2017-10-30 3154 if (setjmp(bus_error_jmp) != 0) {
80eff6c4847997 Balbir Singh 2017-10-30 3155 catch_memory_errors = 0;
d8104182087319 Michael Ellerman 2017-12-06 3156 printf("*** Error dumping pte for task %px\n", tsk);
80eff6c4847997 Balbir Singh 2017-10-30 3157 return;
80eff6c4847997 Balbir Singh 2017-10-30 3158 }
80eff6c4847997 Balbir Singh 2017-10-30 3159
80eff6c4847997 Balbir Singh 2017-10-30 3160 catch_memory_errors = 1;
80eff6c4847997 Balbir Singh 2017-10-30 3161 sync();
80eff6c4847997 Balbir Singh 2017-10-30 3162
80eff6c4847997 Balbir Singh 2017-10-30 3163 if (mm == &init_mm) {
80eff6c4847997 Balbir Singh 2017-10-30 3164 pgdp = pgd_offset_k(addr);
80eff6c4847997 Balbir Singh 2017-10-30 3165 pgdir = pgd_offset_k(0);
80eff6c4847997 Balbir Singh 2017-10-30 3166 } else {
80eff6c4847997 Balbir Singh 2017-10-30 3167 pgdp = pgd_offset(mm, addr);
80eff6c4847997 Balbir Singh 2017-10-30 3168 pgdir = pgd_offset(mm, 0);
80eff6c4847997 Balbir Singh 2017-10-30 3169 }
80eff6c4847997 Balbir Singh 2017-10-30 3170
47dde7dbc279f3 Mike Rapoport 2020-05-16 3171 p4dp = p4d_offset(pgdp, addr);
47dde7dbc279f3 Mike Rapoport 2020-05-16 3172
47dde7dbc279f3 Mike Rapoport 2020-05-16 3173 if (p4d_none(*p4dp)) {
47dde7dbc279f3 Mike Rapoport 2020-05-16 3174 printf("No valid P4D\n");
80eff6c4847997 Balbir Singh 2017-10-30 3175 return;
80eff6c4847997 Balbir Singh 2017-10-30 3176 }
80eff6c4847997 Balbir Singh 2017-10-30 3177
47dde7dbc279f3 Mike Rapoport 2020-05-16 3178 if (p4d_is_leaf(*p4dp)) {
47dde7dbc279f3 Mike Rapoport 2020-05-16 3179 format_pte(p4dp, p4d_val(*p4dp));
80eff6c4847997 Balbir Singh 2017-10-30 3180 return;
80eff6c4847997 Balbir Singh 2017-10-30 3181 }
80eff6c4847997 Balbir Singh 2017-10-30 3182
47dde7dbc279f3 Mike Rapoport 2020-05-16 3183 printf("p4dp @ 0x%px = 0x%016lx\n", p4dp, p4d_val(*p4dp));
47dde7dbc279f3 Mike Rapoport 2020-05-16 3184
47dde7dbc279f3 Mike Rapoport 2020-05-16 3185 pudp = pud_offset(p4dp, addr);
80eff6c4847997 Balbir Singh 2017-10-30 3186
80eff6c4847997 Balbir Singh 2017-10-30 3187 if (pud_none(*pudp)) {
80eff6c4847997 Balbir Singh 2017-10-30 3188 printf("No valid PUD\n");
80eff6c4847997 Balbir Singh 2017-10-30 3189 return;
80eff6c4847997 Balbir Singh 2017-10-30 3190 }
80eff6c4847997 Balbir Singh 2017-10-30 3191
d6eacedd1f0ebf Aneesh Kumar K.V 2019-05-14 3192 if (pud_is_leaf(*pudp)) {
80eff6c4847997 Balbir Singh 2017-10-30 3193 format_pte(pudp, pud_val(*pudp));
80eff6c4847997 Balbir Singh 2017-10-30 3194 return;
80eff6c4847997 Balbir Singh 2017-10-30 3195 }
80eff6c4847997 Balbir Singh 2017-10-30 3196
e70d8f55268ba9 Mathieu Malaterre 2018-03-25 3197 printf("pudp @ 0x%px = 0x%016lx\n", pudp, pud_val(*pudp));
80eff6c4847997 Balbir Singh 2017-10-30 3198
80eff6c4847997 Balbir Singh 2017-10-30 3199 pmdp = pmd_offset(pudp, addr);
80eff6c4847997 Balbir Singh 2017-10-30 3200
80eff6c4847997 Balbir Singh 2017-10-30 3201 if (pmd_none(*pmdp)) {
80eff6c4847997 Balbir Singh 2017-10-30 3202 printf("No valid PMD\n");
80eff6c4847997 Balbir Singh 2017-10-30 3203 return;
80eff6c4847997 Balbir Singh 2017-10-30 3204 }
80eff6c4847997 Balbir Singh 2017-10-30 3205
d6eacedd1f0ebf Aneesh Kumar K.V 2019-05-14 3206 if (pmd_is_leaf(*pmdp)) {
80eff6c4847997 Balbir Singh 2017-10-30 3207 format_pte(pmdp, pmd_val(*pmdp));
80eff6c4847997 Balbir Singh 2017-10-30 3208 return;
80eff6c4847997 Balbir Singh 2017-10-30 3209 }
e70d8f55268ba9 Mathieu Malaterre 2018-03-25 3210 printf("pmdp @ 0x%px = 0x%016lx\n", pmdp, pmd_val(*pmdp));
80eff6c4847997 Balbir Singh 2017-10-30 3211
80eff6c4847997 Balbir Singh 2017-10-30 3212 ptep = pte_offset_map(pmdp, addr);
80eff6c4847997 Balbir Singh 2017-10-30 3213 if (pte_none(*ptep)) {
80eff6c4847997 Balbir Singh 2017-10-30 3214 printf("no valid PTE\n");
80eff6c4847997 Balbir Singh 2017-10-30 3215 return;
80eff6c4847997 Balbir Singh 2017-10-30 3216 }
80eff6c4847997 Balbir Singh 2017-10-30 3217
80eff6c4847997 Balbir Singh 2017-10-30 3218 format_pte(ptep, pte_val(*ptep));
80eff6c4847997 Balbir Singh 2017-10-30 3219
80eff6c4847997 Balbir Singh 2017-10-30 3220 sync();
80eff6c4847997 Balbir Singh 2017-10-30 3221 __delay(200);
80eff6c4847997 Balbir Singh 2017-10-30 3222 catch_memory_errors = 0;
80eff6c4847997 Balbir Singh 2017-10-30 3223 }
80eff6c4847997 Balbir Singh 2017-10-30 3224 #else
80eff6c4847997 Balbir Singh 2017-10-30 3225 static void show_pte(unsigned long addr)
80eff6c4847997 Balbir Singh 2017-10-30 3226 {
80eff6c4847997 Balbir Singh 2017-10-30 3227 printf("show_pte not yet implemented\n");
80eff6c4847997 Balbir Singh 2017-10-30 3228 }
80eff6c4847997 Balbir Singh 2017-10-30 3229 #endif /* CONFIG_PPC_BOOK3S_64 */
80eff6c4847997 Balbir Singh 2017-10-30 3230
:::::: The code at line 3138 was first introduced by commit
:::::: 80eff6c484799722736471d15ff9cc86b64cae7a powerpc/xmon: Support dumping software pagetables
:::::: TO: Balbir Singh <bsingharora(a)gmail.com>
:::::: CC: Michael Ellerman <mpe(a)ellerman.id.au>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months