All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 bpf-next 0/2] introduce btf_tracing_ids
@ 2021-11-12  7:01 Song Liu
  2021-11-12  7:01 ` [PATCH v2 bpf-next 1/2] bpf: extend BTF_ID_LIST_GLOBAL with parameter for number of IDs Song Liu
  2021-11-12  7:01 ` [PATCH v2 bpf-next 2/2] bpf: introduce btf_tracing_ids Song Liu
  0 siblings, 2 replies; 7+ messages in thread
From: Song Liu @ 2021-11-12  7:01 UTC (permalink / raw)
  To: bpf, netdev; +Cc: ast, daniel, andrii, kernel-team, Song Liu

Changes v1 => v2:
1. Add patch 2/2. (Alexei)

1/2 fixes issue with btf_task_struct_ids w/o CONFIG_DEBUG_INFO_BTF.
2/2 replaces btf_task_struct_ids with easier to understand btf_tracing_ids.

Song Liu (2):
  bpf: extend BTF_ID_LIST_GLOBAL with parameter for number of IDs
  bpf: introduce btf_tracing_ids

 include/linux/btf_ids.h       | 20 ++++++++++++++++----
 kernel/bpf/bpf_task_storage.c |  4 ++--
 kernel/bpf/btf.c              |  8 ++++----
 kernel/bpf/stackmap.c         |  2 +-
 kernel/bpf/task_iter.c        | 12 ++++++------
 kernel/bpf/verifier.c         |  2 +-
 kernel/trace/bpf_trace.c      |  4 ++--
 net/core/filter.c             |  6 +-----
 8 files changed, 33 insertions(+), 25 deletions(-)

--
2.30.2

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 bpf-next 1/2] bpf: extend BTF_ID_LIST_GLOBAL with parameter for number of IDs
  2021-11-12  7:01 [PATCH v2 bpf-next 0/2] introduce btf_tracing_ids Song Liu
@ 2021-11-12  7:01 ` Song Liu
  2021-11-12  7:01 ` [PATCH v2 bpf-next 2/2] bpf: introduce btf_tracing_ids Song Liu
  1 sibling, 0 replies; 7+ messages in thread
From: Song Liu @ 2021-11-12  7:01 UTC (permalink / raw)
  To: bpf, netdev
  Cc: ast, daniel, andrii, kernel-team, Song Liu,
	syzbot+e0d81ec552a21d9071aa, Eric Dumazet

syzbot reported the following BUG w/o CONFIG_DEBUG_INFO_BTF

BUG: KASAN: global-out-of-bounds in task_iter_init+0x212/0x2e7 kernel/bpf/task_iter.c:661
Read of size 4 at addr ffffffff90297404 by task swapper/0/1

CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.15.0-syzkaller #0
Hardware name: ... Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description.constprop.0.cold+0xf/0x309 mm/kasan/report.c:256
__kasan_report mm/kasan/report.c:442 [inline]
kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
task_iter_init+0x212/0x2e7 kernel/bpf/task_iter.c:661
do_one_initcall+0x103/0x650 init/main.c:1295
do_initcall_level init/main.c:1368 [inline]
do_initcalls init/main.c:1384 [inline]
do_basic_setup init/main.c:1403 [inline]
kernel_init_freeable+0x6b1/0x73a init/main.c:1606
kernel_init+0x1a/0x1d0 init/main.c:1497
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
</TASK>

This is caused by hard-coded name[1] in BTF_ID_LIST_GLOBAL (w/o
CONFIG_DEBUG_INFO_BTF). Fix this by adding a parameter n to
BTF_ID_LIST_GLOBAL. This avoids ifdef CONFIG_DEBUG_INFO_BTF in btf.c and
filter.c.

Fixes: 7c7e3d31e785 ("bpf: Introduce helper bpf_find_vma")
Reported-by: syzbot+e0d81ec552a21d9071aa@syzkaller.appspotmail.com
Suggested-by: Eric Dumazet <edumazet@google.com>
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
---
 include/linux/btf_ids.h | 6 +++---
 kernel/bpf/btf.c        | 2 +-
 net/core/filter.c       | 6 +-----
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h
index 47d9abfbdb556..6bb42b785293a 100644
--- a/include/linux/btf_ids.h
+++ b/include/linux/btf_ids.h
@@ -73,7 +73,7 @@ asm(							\
 __BTF_ID_LIST(name, local)				\
 extern u32 name[];
 
-#define BTF_ID_LIST_GLOBAL(name)			\
+#define BTF_ID_LIST_GLOBAL(name, n)			\
 __BTF_ID_LIST(name, globl)
 
 /* The BTF_ID_LIST_SINGLE macro defines a BTF_ID_LIST with
@@ -83,7 +83,7 @@ __BTF_ID_LIST(name, globl)
 	BTF_ID_LIST(name) \
 	BTF_ID(prefix, typename)
 #define BTF_ID_LIST_GLOBAL_SINGLE(name, prefix, typename) \
-	BTF_ID_LIST_GLOBAL(name) \
+	BTF_ID_LIST_GLOBAL(name, 1)			  \
 	BTF_ID(prefix, typename)
 
 /*
@@ -149,7 +149,7 @@ extern struct btf_id_set name;
 #define BTF_ID_LIST(name) static u32 name[5];
 #define BTF_ID(prefix, name)
 #define BTF_ID_UNUSED
-#define BTF_ID_LIST_GLOBAL(name) u32 name[1];
+#define BTF_ID_LIST_GLOBAL(name, n) u32 name[n];
 #define BTF_ID_LIST_SINGLE(name, prefix, typename) static u32 name[1];
 #define BTF_ID_LIST_GLOBAL_SINGLE(name, prefix, typename) u32 name[1];
 #define BTF_SET_START(name) static struct btf_id_set name = { 0 };
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 1dd9ba82da1e0..2a9d8a1fee1de 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -6354,7 +6354,7 @@ const struct bpf_func_proto bpf_btf_find_by_name_kind_proto = {
 	.arg4_type	= ARG_ANYTHING,
 };
 
-BTF_ID_LIST_GLOBAL(btf_task_struct_ids)
+BTF_ID_LIST_GLOBAL(btf_task_struct_ids, 3)
 BTF_ID(struct, task_struct)
 BTF_ID(struct, file)
 BTF_ID(struct, vm_area_struct)
diff --git a/net/core/filter.c b/net/core/filter.c
index 315a58466fc93..46f09a8fba20b 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -10611,14 +10611,10 @@ void bpf_prog_change_xdp(struct bpf_prog *prev_prog, struct bpf_prog *prog)
 	bpf_dispatcher_change_prog(BPF_DISPATCHER_PTR(xdp), prev_prog, prog);
 }
 
-#ifdef CONFIG_DEBUG_INFO_BTF
-BTF_ID_LIST_GLOBAL(btf_sock_ids)
+BTF_ID_LIST_GLOBAL(btf_sock_ids, MAX_BTF_SOCK_TYPE)
 #define BTF_SOCK_TYPE(name, type) BTF_ID(struct, type)
 BTF_SOCK_TYPE_xxx
 #undef BTF_SOCK_TYPE
-#else
-u32 btf_sock_ids[MAX_BTF_SOCK_TYPE];
-#endif
 
 BPF_CALL_1(bpf_skc_to_tcp6_sock, struct sock *, sk)
 {
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 bpf-next 2/2] bpf: introduce btf_tracing_ids
  2021-11-12  7:01 [PATCH v2 bpf-next 0/2] introduce btf_tracing_ids Song Liu
  2021-11-12  7:01 ` [PATCH v2 bpf-next 1/2] bpf: extend BTF_ID_LIST_GLOBAL with parameter for number of IDs Song Liu
@ 2021-11-12  7:01 ` Song Liu
  2021-11-12  9:33     ` kernel test robot
  2021-11-12 10:41     ` kernel test robot
  1 sibling, 2 replies; 7+ messages in thread
From: Song Liu @ 2021-11-12  7:01 UTC (permalink / raw)
  To: bpf, netdev; +Cc: ast, daniel, andrii, kernel-team, Song Liu

Similar to btf_sock_ids, btf_tracing_ids provides btf ID for task_struct,
file, and vm_area_struct via easy to understand format like
btf_tracing_ids[BTF_TRACING_TYPE_[TASK|file|VMA]].

Suggested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Song Liu <songliubraving@fb.com>
---
 include/linux/btf_ids.h       | 14 +++++++++++++-
 kernel/bpf/bpf_task_storage.c |  4 ++--
 kernel/bpf/btf.c              |  8 ++++----
 kernel/bpf/stackmap.c         |  2 +-
 kernel/bpf/task_iter.c        | 12 ++++++------
 kernel/bpf/verifier.c         |  2 +-
 kernel/trace/bpf_trace.c      |  4 ++--
 7 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h
index 6bb42b785293a..919c0fde1c515 100644
--- a/include/linux/btf_ids.h
+++ b/include/linux/btf_ids.h
@@ -189,6 +189,18 @@ MAX_BTF_SOCK_TYPE,
 extern u32 btf_sock_ids[];
 #endif
 
-extern u32 btf_task_struct_ids[];
+#define BTF_TRACING_TYPE_xxx	\
+	BTF_TRACING_TYPE(BTF_TRACING_TYPE_TASK, task_struct)	\
+	BTF_TRACING_TYPE(BTF_TRACING_TYPE_FILE, file)		\
+	BTF_TRACING_TYPE(BTF_TRACING_TYPE_VMA, vm_area_struct)
+
+enum {
+#define BTF_TRACING_TYPE(name, type) name,
+BTF_TRACING_TYPE_xxx
+#undef BTF_TRACING_TYPE
+MAX_BTF_TRACING_TYPE,
+};
+
+extern u32 btf_tracing_ids[];
 
 #endif
diff --git a/kernel/bpf/bpf_task_storage.c b/kernel/bpf/bpf_task_storage.c
index ebfa8bc908923..bb69aea1a7776 100644
--- a/kernel/bpf/bpf_task_storage.c
+++ b/kernel/bpf/bpf_task_storage.c
@@ -323,7 +323,7 @@ const struct bpf_func_proto bpf_task_storage_get_proto = {
 	.ret_type = RET_PTR_TO_MAP_VALUE_OR_NULL,
 	.arg1_type = ARG_CONST_MAP_PTR,
 	.arg2_type = ARG_PTR_TO_BTF_ID,
-	.arg2_btf_id = &btf_task_struct_ids[0],
+	.arg2_btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK],
 	.arg3_type = ARG_PTR_TO_MAP_VALUE_OR_NULL,
 	.arg4_type = ARG_ANYTHING,
 };
@@ -334,5 +334,5 @@ const struct bpf_func_proto bpf_task_storage_delete_proto = {
 	.ret_type = RET_INTEGER,
 	.arg1_type = ARG_CONST_MAP_PTR,
 	.arg2_type = ARG_PTR_TO_BTF_ID,
-	.arg2_btf_id = &btf_task_struct_ids[0],
+	.arg2_btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK],
 };
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 2a9d8a1fee1de..6b9d23be1e992 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -6354,10 +6354,10 @@ const struct bpf_func_proto bpf_btf_find_by_name_kind_proto = {
 	.arg4_type	= ARG_ANYTHING,
 };
 
-BTF_ID_LIST_GLOBAL(btf_task_struct_ids, 3)
-BTF_ID(struct, task_struct)
-BTF_ID(struct, file)
-BTF_ID(struct, vm_area_struct)
+BTF_ID_LIST_GLOBAL(btf_tracing_ids, MAX_BTF_TRACING_TYPE)
+#define BTF_TRACING_TYPE(name, type) BTF_ID(struct, type)
+BTF_TRACING_TYPE_xxx
+#undef BTF_TRACING_TYPE
 
 /* BTF ID set registration API for modules */
 
diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
index 1de0a1b03636e..49e567209c6b6 100644
--- a/kernel/bpf/stackmap.c
+++ b/kernel/bpf/stackmap.c
@@ -489,7 +489,7 @@ const struct bpf_func_proto bpf_get_task_stack_proto = {
 	.gpl_only	= false,
 	.ret_type	= RET_INTEGER,
 	.arg1_type	= ARG_PTR_TO_BTF_ID,
-	.arg1_btf_id	= &btf_task_struct_ids[0],
+	.arg1_btf_id	= &btf_tracing_ids[BTF_TRACING_TYPE_TASK],
 	.arg2_type	= ARG_PTR_TO_UNINIT_MEM,
 	.arg3_type	= ARG_CONST_SIZE_OR_ZERO,
 	.arg4_type	= ARG_ANYTHING,
diff --git a/kernel/bpf/task_iter.c b/kernel/bpf/task_iter.c
index f171479f7dd6b..0aa14afa8173e 100644
--- a/kernel/bpf/task_iter.c
+++ b/kernel/bpf/task_iter.c
@@ -622,7 +622,7 @@ const struct bpf_func_proto bpf_find_vma_proto = {
 	.func		= bpf_find_vma,
 	.ret_type	= RET_INTEGER,
 	.arg1_type	= ARG_PTR_TO_BTF_ID,
-	.arg1_btf_id	= &btf_task_struct_ids[0],
+	.arg1_btf_id	= &btf_tracing_ids[BTF_TRACING_TYPE_TASK],
 	.arg2_type	= ARG_ANYTHING,
 	.arg3_type	= ARG_PTR_TO_FUNC,
 	.arg4_type	= ARG_PTR_TO_STACK_OR_NULL,
@@ -652,19 +652,19 @@ static int __init task_iter_init(void)
 		init_irq_work(&work->irq_work, do_mmap_read_unlock);
 	}
 
-	task_reg_info.ctx_arg_info[0].btf_id = btf_task_struct_ids[0];
+	task_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
 	ret = bpf_iter_reg_target(&task_reg_info);
 	if (ret)
 		return ret;
 
-	task_file_reg_info.ctx_arg_info[0].btf_id = btf_task_struct_ids[0];
-	task_file_reg_info.ctx_arg_info[1].btf_id = btf_task_struct_ids[1];
+	task_file_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
+	task_file_reg_info.ctx_arg_info[1].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_FILE];
 	ret =  bpf_iter_reg_target(&task_file_reg_info);
 	if (ret)
 		return ret;
 
-	task_vma_reg_info.ctx_arg_info[0].btf_id = btf_task_struct_ids[0];
-	task_vma_reg_info.ctx_arg_info[1].btf_id = btf_task_struct_ids[2];
+	task_vma_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
+	task_vma_reg_info.ctx_arg_info[1].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_VMA];
 	return bpf_iter_reg_target(&task_vma_reg_info);
 }
 late_initcall(task_iter_init);
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 1aafb43f61d1c..d31a031ab3775 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -6147,7 +6147,7 @@ static int set_find_vma_callback_state(struct bpf_verifier_env *env,
 	callee->regs[BPF_REG_2].type = PTR_TO_BTF_ID;
 	__mark_reg_known_zero(&callee->regs[BPF_REG_2]);
 	callee->regs[BPF_REG_2].btf =  btf_vmlinux;
-	callee->regs[BPF_REG_2].btf_id = btf_task_struct_ids[2];
+	callee->regs[BPF_REG_2].btf_id = btf_tracing_ids[BTF_TRACING_TYPE_VMA],
 
 	/* pointer to stack or null */
 	callee->regs[BPF_REG_3] = caller->regs[BPF_REG_4];
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 390176a3031ab..25ea521fb8f14 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -764,7 +764,7 @@ const struct bpf_func_proto bpf_get_current_task_btf_proto = {
 	.func		= bpf_get_current_task_btf,
 	.gpl_only	= true,
 	.ret_type	= RET_PTR_TO_BTF_ID,
-	.ret_btf_id	= &btf_task_struct_ids[0],
+	.ret_btf_id	= &btf_tracing_ids[BTF_TRACING_TYPE_TASK],
 };
 
 BPF_CALL_1(bpf_task_pt_regs, struct task_struct *, task)
@@ -779,7 +779,7 @@ const struct bpf_func_proto bpf_task_pt_regs_proto = {
 	.func		= bpf_task_pt_regs,
 	.gpl_only	= true,
 	.arg1_type	= ARG_PTR_TO_BTF_ID,
-	.arg1_btf_id	= &btf_task_struct_ids[0],
+	.arg1_btf_id	= &btf_tracing_ids[BTF_TRACING_TYPE_TASK],
 	.ret_type	= RET_PTR_TO_BTF_ID,
 	.ret_btf_id	= &bpf_task_pt_regs_ids[0],
 };
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 bpf-next 2/2] bpf: introduce btf_tracing_ids
  2021-11-12  7:01 ` [PATCH v2 bpf-next 2/2] bpf: introduce btf_tracing_ids Song Liu
@ 2021-11-12  9:33     ` kernel test robot
  2021-11-12 10:41     ` kernel test robot
  1 sibling, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-11-12  9:33 UTC (permalink / raw)
  To: Song Liu, bpf, netdev
  Cc: kbuild-all, ast, daniel, andrii, kernel-team, Song Liu

[-- Attachment #1: Type: text/plain, Size: 3472 bytes --]

Hi Song,

I love your patch! Perhaps something to improve:

[auto build test WARNING on bpf-next/master]

url:    https://github.com/0day-ci/linux/commits/Song-Liu/introduce-btf_tracing_ids/20211112-150610
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: m68k-defconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/44d18dd3ca4645c999b4c0ec9ae232de79648286
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Song-Liu/introduce-btf_tracing_ids/20211112-150610
        git checkout 44d18dd3ca4645c999b4c0ec9ae232de79648286
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   kernel/bpf/task_iter.c: In function 'task_iter_init':
>> kernel/bpf/task_iter.c:655:46: warning: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Wint-conversion]
     655 |         task_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
         |                                              ^
   kernel/bpf/task_iter.c:660:51: warning: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Wint-conversion]
     660 |         task_file_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
         |                                                   ^
   kernel/bpf/task_iter.c:661:51: warning: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Wint-conversion]
     661 |         task_file_reg_info.ctx_arg_info[1].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_FILE];
         |                                                   ^
   kernel/bpf/task_iter.c:666:50: warning: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Wint-conversion]
     666 |         task_vma_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
         |                                                  ^
   kernel/bpf/task_iter.c:667:50: warning: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Wint-conversion]
     667 |         task_vma_reg_info.ctx_arg_info[1].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_VMA];
         |                                                  ^


vim +655 kernel/bpf/task_iter.c

   644	
   645	static int __init task_iter_init(void)
   646	{
   647		struct mmap_unlock_irq_work *work;
   648		int ret, cpu;
   649	
   650		for_each_possible_cpu(cpu) {
   651			work = per_cpu_ptr(&mmap_unlock_work, cpu);
   652			init_irq_work(&work->irq_work, do_mmap_read_unlock);
   653		}
   654	
 > 655		task_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 17422 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 bpf-next 2/2] bpf: introduce btf_tracing_ids
@ 2021-11-12  9:33     ` kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-11-12  9:33 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3535 bytes --]

Hi Song,

I love your patch! Perhaps something to improve:

[auto build test WARNING on bpf-next/master]

url:    https://github.com/0day-ci/linux/commits/Song-Liu/introduce-btf_tracing_ids/20211112-150610
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: m68k-defconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/44d18dd3ca4645c999b4c0ec9ae232de79648286
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Song-Liu/introduce-btf_tracing_ids/20211112-150610
        git checkout 44d18dd3ca4645c999b4c0ec9ae232de79648286
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   kernel/bpf/task_iter.c: In function 'task_iter_init':
>> kernel/bpf/task_iter.c:655:46: warning: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Wint-conversion]
     655 |         task_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
         |                                              ^
   kernel/bpf/task_iter.c:660:51: warning: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Wint-conversion]
     660 |         task_file_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
         |                                                   ^
   kernel/bpf/task_iter.c:661:51: warning: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Wint-conversion]
     661 |         task_file_reg_info.ctx_arg_info[1].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_FILE];
         |                                                   ^
   kernel/bpf/task_iter.c:666:50: warning: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Wint-conversion]
     666 |         task_vma_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
         |                                                  ^
   kernel/bpf/task_iter.c:667:50: warning: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Wint-conversion]
     667 |         task_vma_reg_info.ctx_arg_info[1].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_VMA];
         |                                                  ^


vim +655 kernel/bpf/task_iter.c

   644	
   645	static int __init task_iter_init(void)
   646	{
   647		struct mmap_unlock_irq_work *work;
   648		int ret, cpu;
   649	
   650		for_each_possible_cpu(cpu) {
   651			work = per_cpu_ptr(&mmap_unlock_work, cpu);
   652			init_irq_work(&work->irq_work, do_mmap_read_unlock);
   653		}
   654	
 > 655		task_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 17422 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 bpf-next 2/2] bpf: introduce btf_tracing_ids
  2021-11-12  7:01 ` [PATCH v2 bpf-next 2/2] bpf: introduce btf_tracing_ids Song Liu
@ 2021-11-12 10:41     ` kernel test robot
  2021-11-12 10:41     ` kernel test robot
  1 sibling, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-11-12 10:41 UTC (permalink / raw)
  To: Song Liu, bpf, netdev
  Cc: kbuild-all, ast, daniel, andrii, kernel-team, Song Liu

[-- Attachment #1: Type: text/plain, Size: 3532 bytes --]

Hi Song,

I love your patch! Yet something to improve:

[auto build test ERROR on bpf-next/master]

url:    https://github.com/0day-ci/linux/commits/Song-Liu/introduce-btf_tracing_ids/20211112-150610
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/44d18dd3ca4645c999b4c0ec9ae232de79648286
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Song-Liu/introduce-btf_tracing_ids/20211112-150610
        git checkout 44d18dd3ca4645c999b4c0ec9ae232de79648286
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   kernel/bpf/task_iter.c: In function 'task_iter_init':
>> kernel/bpf/task_iter.c:655:46: error: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Werror=int-conversion]
     655 |         task_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
         |                                              ^
   kernel/bpf/task_iter.c:660:51: error: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Werror=int-conversion]
     660 |         task_file_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
         |                                                   ^
   kernel/bpf/task_iter.c:661:51: error: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Werror=int-conversion]
     661 |         task_file_reg_info.ctx_arg_info[1].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_FILE];
         |                                                   ^
   kernel/bpf/task_iter.c:666:50: error: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Werror=int-conversion]
     666 |         task_vma_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
         |                                                  ^
   kernel/bpf/task_iter.c:667:50: error: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Werror=int-conversion]
     667 |         task_vma_reg_info.ctx_arg_info[1].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_VMA];
         |                                                  ^
   cc1: all warnings being treated as errors


vim +655 kernel/bpf/task_iter.c

   644	
   645	static int __init task_iter_init(void)
   646	{
   647		struct mmap_unlock_irq_work *work;
   648		int ret, cpu;
   649	
   650		for_each_possible_cpu(cpu) {
   651			work = per_cpu_ptr(&mmap_unlock_work, cpu);
   652			init_irq_work(&work->irq_work, do_mmap_read_unlock);
   653		}
   654	
 > 655		task_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 61783 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 bpf-next 2/2] bpf: introduce btf_tracing_ids
@ 2021-11-12 10:41     ` kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-11-12 10:41 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3596 bytes --]

Hi Song,

I love your patch! Yet something to improve:

[auto build test ERROR on bpf-next/master]

url:    https://github.com/0day-ci/linux/commits/Song-Liu/introduce-btf_tracing_ids/20211112-150610
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/44d18dd3ca4645c999b4c0ec9ae232de79648286
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Song-Liu/introduce-btf_tracing_ids/20211112-150610
        git checkout 44d18dd3ca4645c999b4c0ec9ae232de79648286
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   kernel/bpf/task_iter.c: In function 'task_iter_init':
>> kernel/bpf/task_iter.c:655:46: error: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Werror=int-conversion]
     655 |         task_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
         |                                              ^
   kernel/bpf/task_iter.c:660:51: error: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Werror=int-conversion]
     660 |         task_file_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
         |                                                   ^
   kernel/bpf/task_iter.c:661:51: error: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Werror=int-conversion]
     661 |         task_file_reg_info.ctx_arg_info[1].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_FILE];
         |                                                   ^
   kernel/bpf/task_iter.c:666:50: error: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Werror=int-conversion]
     666 |         task_vma_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];
         |                                                  ^
   kernel/bpf/task_iter.c:667:50: error: assignment to 'u32' {aka 'unsigned int'} from 'u32 *' {aka 'unsigned int *'} makes integer from pointer without a cast [-Werror=int-conversion]
     667 |         task_vma_reg_info.ctx_arg_info[1].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_VMA];
         |                                                  ^
   cc1: all warnings being treated as errors


vim +655 kernel/bpf/task_iter.c

   644	
   645	static int __init task_iter_init(void)
   646	{
   647		struct mmap_unlock_irq_work *work;
   648		int ret, cpu;
   649	
   650		for_each_possible_cpu(cpu) {
   651			work = per_cpu_ptr(&mmap_unlock_work, cpu);
   652			init_irq_work(&work->irq_work, do_mmap_read_unlock);
   653		}
   654	
 > 655		task_reg_info.ctx_arg_info[0].btf_id = &btf_tracing_ids[BTF_TRACING_TYPE_TASK];

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 61783 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-11-12 10:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12  7:01 [PATCH v2 bpf-next 0/2] introduce btf_tracing_ids Song Liu
2021-11-12  7:01 ` [PATCH v2 bpf-next 1/2] bpf: extend BTF_ID_LIST_GLOBAL with parameter for number of IDs Song Liu
2021-11-12  7:01 ` [PATCH v2 bpf-next 2/2] bpf: introduce btf_tracing_ids Song Liu
2021-11-12  9:33   ` kernel test robot
2021-11-12  9:33     ` kernel test robot
2021-11-12 10:41   ` kernel test robot
2021-11-12 10:41     ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.