* arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit
@ 2020-08-11 2:17 ` kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-08-11 2:17 UTC (permalink / raw)
To: Zong Li; +Cc: kbuild-all, linux-kernel, Palmer Dabbelt, Masami Hiramatsu
[-- Attachment #1: Type: text/plain, Size: 5598 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4bcf69e57063c9b1b15df1a293c969e80a1c97e6
commit: 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6 riscv: Use text_mutex instead of patch_lock
date: 3 months ago
config: riscv-randconfig-s032-20200810 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-141-g19506bc2-dirty
git checkout 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6
# 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=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit
>> arch/riscv/kernel/ftrace.c:21:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_post_process' - wrong count at exit
vim +/ftrace_arch_code_modify_prepare +15 arch/riscv/kernel/ftrace.c
13
14 #ifdef CONFIG_DYNAMIC_FTRACE
> 15 int ftrace_arch_code_modify_prepare(void) __acquires(&text_mutex)
16 {
17 mutex_lock(&text_mutex);
18 return 0;
19 }
20
> 21 int ftrace_arch_code_modify_post_process(void) __releases(&text_mutex)
22 {
23 mutex_unlock(&text_mutex);
24 return 0;
25 }
26
27 static int ftrace_check_current_call(unsigned long hook_pos,
28 unsigned int *expected)
29 {
30 unsigned int replaced[2];
31 unsigned int nops[2] = {NOP4, NOP4};
32
33 /* we expect nops at the hook position */
34 if (!expected)
35 expected = nops;
36
37 /*
38 * Read the text we want to modify;
39 * return must be -EFAULT on read error
40 */
41 if (probe_kernel_read(replaced, (void *)hook_pos, MCOUNT_INSN_SIZE))
42 return -EFAULT;
43
44 /*
45 * Make sure it is what we expect it to be;
46 * return must be -EINVAL on failed comparison
47 */
48 if (memcmp(expected, replaced, sizeof(replaced))) {
49 pr_err("%p: expected (%08x %08x) but got (%08x %08x)\n",
50 (void *)hook_pos, expected[0], expected[1], replaced[0],
51 replaced[1]);
52 return -EINVAL;
53 }
54
55 return 0;
56 }
57
58 static int __ftrace_modify_call(unsigned long hook_pos, unsigned long target,
59 bool enable)
60 {
61 unsigned int call[2];
62 unsigned int nops[2] = {NOP4, NOP4};
63
64 make_call(hook_pos, target, call);
65
66 /* Replace the auipc-jalr pair at once. Return -EPERM on write error. */
67 if (patch_text_nosync
68 ((void *)hook_pos, enable ? call : nops, MCOUNT_INSN_SIZE))
69 return -EPERM;
70
71 return 0;
72 }
73
74 int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
75 {
76 int ret = ftrace_check_current_call(rec->ip, NULL);
77
78 if (ret)
79 return ret;
80
81 return __ftrace_modify_call(rec->ip, addr, true);
82 }
83
84 int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec,
85 unsigned long addr)
86 {
87 unsigned int call[2];
88 int ret;
89
90 make_call(rec->ip, addr, call);
91 ret = ftrace_check_current_call(rec->ip, call);
92
93 if (ret)
94 return ret;
95
96 return __ftrace_modify_call(rec->ip, addr, false);
97 }
98
99 int ftrace_update_ftrace_func(ftrace_func_t func)
100 {
101 int ret = __ftrace_modify_call((unsigned long)&ftrace_call,
102 (unsigned long)func, true);
103 if (!ret) {
104 ret = __ftrace_modify_call((unsigned long)&ftrace_regs_call,
105 (unsigned long)func, true);
106 }
107
108 return ret;
109 }
110
111 int __init ftrace_dyn_arch_init(void)
112 {
113 return 0;
114 }
115 #endif
116
117 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
118 int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
119 unsigned long addr)
120 {
121 unsigned int call[2];
122 int ret;
123
124 make_call(rec->ip, old_addr, call);
125 ret = ftrace_check_current_call(rec->ip, call);
126
127 if (ret)
128 return ret;
129
130 return __ftrace_modify_call(rec->ip, addr, true);
131 }
132 #endif
133
134 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
135 /*
136 * Most of this function is copied from arm64.
137 */
> 138 void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
139 unsigned long frame_pointer)
140 {
141 unsigned long return_hooker = (unsigned long)&return_to_handler;
142 unsigned long old;
143
144 if (unlikely(atomic_read(¤t->tracing_graph_pause)))
145 return;
146
147 /*
148 * We don't suffer access faults, so no extra fault-recovery assembly
149 * is needed here.
150 */
151 old = *parent;
152
153 if (!function_graph_enter(old, self_addr, frame_pointer, parent))
154 *parent = return_hooker;
155 }
156
---
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: 30745 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit
@ 2020-08-11 2:17 ` kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-08-11 2:17 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 5774 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4bcf69e57063c9b1b15df1a293c969e80a1c97e6
commit: 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6 riscv: Use text_mutex instead of patch_lock
date: 3 months ago
config: riscv-randconfig-s032-20200810 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-141-g19506bc2-dirty
git checkout 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6
# 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=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit
>> arch/riscv/kernel/ftrace.c:21:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_post_process' - wrong count at exit
vim +/ftrace_arch_code_modify_prepare +15 arch/riscv/kernel/ftrace.c
13
14 #ifdef CONFIG_DYNAMIC_FTRACE
> 15 int ftrace_arch_code_modify_prepare(void) __acquires(&text_mutex)
16 {
17 mutex_lock(&text_mutex);
18 return 0;
19 }
20
> 21 int ftrace_arch_code_modify_post_process(void) __releases(&text_mutex)
22 {
23 mutex_unlock(&text_mutex);
24 return 0;
25 }
26
27 static int ftrace_check_current_call(unsigned long hook_pos,
28 unsigned int *expected)
29 {
30 unsigned int replaced[2];
31 unsigned int nops[2] = {NOP4, NOP4};
32
33 /* we expect nops at the hook position */
34 if (!expected)
35 expected = nops;
36
37 /*
38 * Read the text we want to modify;
39 * return must be -EFAULT on read error
40 */
41 if (probe_kernel_read(replaced, (void *)hook_pos, MCOUNT_INSN_SIZE))
42 return -EFAULT;
43
44 /*
45 * Make sure it is what we expect it to be;
46 * return must be -EINVAL on failed comparison
47 */
48 if (memcmp(expected, replaced, sizeof(replaced))) {
49 pr_err("%p: expected (%08x %08x) but got (%08x %08x)\n",
50 (void *)hook_pos, expected[0], expected[1], replaced[0],
51 replaced[1]);
52 return -EINVAL;
53 }
54
55 return 0;
56 }
57
58 static int __ftrace_modify_call(unsigned long hook_pos, unsigned long target,
59 bool enable)
60 {
61 unsigned int call[2];
62 unsigned int nops[2] = {NOP4, NOP4};
63
64 make_call(hook_pos, target, call);
65
66 /* Replace the auipc-jalr pair at once. Return -EPERM on write error. */
67 if (patch_text_nosync
68 ((void *)hook_pos, enable ? call : nops, MCOUNT_INSN_SIZE))
69 return -EPERM;
70
71 return 0;
72 }
73
74 int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
75 {
76 int ret = ftrace_check_current_call(rec->ip, NULL);
77
78 if (ret)
79 return ret;
80
81 return __ftrace_modify_call(rec->ip, addr, true);
82 }
83
84 int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec,
85 unsigned long addr)
86 {
87 unsigned int call[2];
88 int ret;
89
90 make_call(rec->ip, addr, call);
91 ret = ftrace_check_current_call(rec->ip, call);
92
93 if (ret)
94 return ret;
95
96 return __ftrace_modify_call(rec->ip, addr, false);
97 }
98
99 int ftrace_update_ftrace_func(ftrace_func_t func)
100 {
101 int ret = __ftrace_modify_call((unsigned long)&ftrace_call,
102 (unsigned long)func, true);
103 if (!ret) {
104 ret = __ftrace_modify_call((unsigned long)&ftrace_regs_call,
105 (unsigned long)func, true);
106 }
107
108 return ret;
109 }
110
111 int __init ftrace_dyn_arch_init(void)
112 {
113 return 0;
114 }
115 #endif
116
117 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
118 int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
119 unsigned long addr)
120 {
121 unsigned int call[2];
122 int ret;
123
124 make_call(rec->ip, old_addr, call);
125 ret = ftrace_check_current_call(rec->ip, call);
126
127 if (ret)
128 return ret;
129
130 return __ftrace_modify_call(rec->ip, addr, true);
131 }
132 #endif
133
134 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
135 /*
136 * Most of this function is copied from arm64.
137 */
> 138 void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
139 unsigned long frame_pointer)
140 {
141 unsigned long return_hooker = (unsigned long)&return_to_handler;
142 unsigned long old;
143
144 if (unlikely(atomic_read(¤t->tracing_graph_pause)))
145 return;
146
147 /*
148 * We don't suffer access faults, so no extra fault-recovery assembly
149 * is needed here.
150 */
151 old = *parent;
152
153 if (!function_graph_enter(old, self_addr, frame_pointer, parent))
154 *parent = return_hooker;
155 }
156
---
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: 30745 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit
@ 2021-04-03 21:32 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-04-03 21:32 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 2825 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Zong Li <zong.li@sifive.com>
CC: Palmer Dabbelt <palmerdabbelt@google.com>
CC: Masami Hiramatsu <mhiramat@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8e29be3468d4565dd95fbb098df0d7a79ee60d71
commit: 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6 riscv: Use text_mutex instead of patch_lock
date: 11 months ago
:::::: branch date: 2 hours ago
:::::: commit date: 11 months ago
config: riscv-randconfig-s032-20210404 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-279-g6d5d9b42-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6
# 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=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit
>> arch/riscv/kernel/ftrace.c:21:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_post_process' - wrong count at exit
vim +/ftrace_arch_code_modify_prepare +15 arch/riscv/kernel/ftrace.c
10626c32e3827b Alan Kao 2017-12-18 13
c15ac4fd60d5ff Alan Kao 2018-02-13 14 #ifdef CONFIG_DYNAMIC_FTRACE
0ff7c3b331276f Zong Li 2020-04-21 @15 int ftrace_arch_code_modify_prepare(void) __acquires(&text_mutex)
0ff7c3b331276f Zong Li 2020-04-21 16 {
0ff7c3b331276f Zong Li 2020-04-21 17 mutex_lock(&text_mutex);
0ff7c3b331276f Zong Li 2020-04-21 18 return 0;
0ff7c3b331276f Zong Li 2020-04-21 19 }
0ff7c3b331276f Zong Li 2020-04-21 20
0ff7c3b331276f Zong Li 2020-04-21 @21 int ftrace_arch_code_modify_post_process(void) __releases(&text_mutex)
0ff7c3b331276f Zong Li 2020-04-21 22 {
0ff7c3b331276f Zong Li 2020-04-21 23 mutex_unlock(&text_mutex);
0ff7c3b331276f Zong Li 2020-04-21 24 return 0;
0ff7c3b331276f Zong Li 2020-04-21 25 }
0ff7c3b331276f Zong Li 2020-04-21 26
---
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: 27678 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit
@ 2021-03-17 20:31 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-03-17 20:31 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 2840 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Zong Li <zong.li@sifive.com>
CC: Palmer Dabbelt <palmerdabbelt@google.com>
CC: Masami Hiramatsu <mhiramat@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1df27313f50a57497c1faeb6a6ae4ca939c85a7d
commit: 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6 riscv: Use text_mutex instead of patch_lock
date: 10 months ago
:::::: branch date: 27 hours ago
:::::: commit date: 10 months ago
config: riscv-randconfig-s032-20210318 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-277-gc089cd2d-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6
# 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=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit
>> arch/riscv/kernel/ftrace.c:21:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_post_process' - wrong count at exit
vim +/ftrace_arch_code_modify_prepare +15 arch/riscv/kernel/ftrace.c
10626c32e3827bc Alan Kao 2017-12-18 13
c15ac4fd60d5ffd Alan Kao 2018-02-13 14 #ifdef CONFIG_DYNAMIC_FTRACE
0ff7c3b331276f5 Zong Li 2020-04-21 @15 int ftrace_arch_code_modify_prepare(void) __acquires(&text_mutex)
0ff7c3b331276f5 Zong Li 2020-04-21 16 {
0ff7c3b331276f5 Zong Li 2020-04-21 17 mutex_lock(&text_mutex);
0ff7c3b331276f5 Zong Li 2020-04-21 18 return 0;
0ff7c3b331276f5 Zong Li 2020-04-21 19 }
0ff7c3b331276f5 Zong Li 2020-04-21 20
0ff7c3b331276f5 Zong Li 2020-04-21 @21 int ftrace_arch_code_modify_post_process(void) __releases(&text_mutex)
0ff7c3b331276f5 Zong Li 2020-04-21 22 {
0ff7c3b331276f5 Zong Li 2020-04-21 23 mutex_unlock(&text_mutex);
0ff7c3b331276f5 Zong Li 2020-04-21 24 return 0;
0ff7c3b331276f5 Zong Li 2020-04-21 25 }
0ff7c3b331276f5 Zong Li 2020-04-21 26
---
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: 21065 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit
@ 2020-10-13 9:39 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-10-13 9:39 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 2815 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Zong Li <zong.li@sifive.com>
CC: Palmer Dabbelt <palmerdabbelt@google.com>
CC: Masami Hiramatsu <mhiramat@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 865c50e1d279671728c2936cb7680eb89355eeea
commit: 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6 riscv: Use text_mutex instead of patch_lock
date: 5 months ago
:::::: branch date: 8 hours ago
:::::: commit date: 5 months ago
config: riscv-randconfig-s032-20201013 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-rc1-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6
# 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=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit
>> arch/riscv/kernel/ftrace.c:21:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_post_process' - wrong count at exit
vim +/ftrace_arch_code_modify_prepare +15 arch/riscv/kernel/ftrace.c
10626c32e3827b Alan Kao 2017-12-18 13
c15ac4fd60d5ff Alan Kao 2018-02-13 14 #ifdef CONFIG_DYNAMIC_FTRACE
0ff7c3b331276f Zong Li 2020-04-21 @15 int ftrace_arch_code_modify_prepare(void) __acquires(&text_mutex)
0ff7c3b331276f Zong Li 2020-04-21 16 {
0ff7c3b331276f Zong Li 2020-04-21 17 mutex_lock(&text_mutex);
0ff7c3b331276f Zong Li 2020-04-21 18 return 0;
0ff7c3b331276f Zong Li 2020-04-21 19 }
0ff7c3b331276f Zong Li 2020-04-21 20
0ff7c3b331276f Zong Li 2020-04-21 @21 int ftrace_arch_code_modify_post_process(void) __releases(&text_mutex)
0ff7c3b331276f Zong Li 2020-04-21 22 {
0ff7c3b331276f Zong Li 2020-04-21 23 mutex_unlock(&text_mutex);
0ff7c3b331276f Zong Li 2020-04-21 24 return 0;
0ff7c3b331276f Zong Li 2020-04-21 25 }
0ff7c3b331276f Zong Li 2020-04-21 26
---
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: 23944 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit
@ 2020-09-12 10:37 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-09-12 10:37 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 2857 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Zong Li <zong.li@sifive.com>
CC: Palmer Dabbelt <palmerdabbelt@google.com>
CC: Masami Hiramatsu <mhiramat@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 729e3d091984487f7aa1ebfabfe594e5b317ed0f
commit: 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6 riscv: Use text_mutex instead of patch_lock
date: 4 months ago
:::::: branch date: 14 hours ago
:::::: commit date: 4 months ago
config: riscv-randconfig-s032-20200912 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-191-g10164920-dirty
git checkout 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6
# 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=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit
>> arch/riscv/kernel/ftrace.c:21:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_post_process' - wrong count at exit
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6
vim +/ftrace_arch_code_modify_prepare +15 arch/riscv/kernel/ftrace.c
10626c32e3827b Alan Kao 2017-12-18 13
c15ac4fd60d5ff Alan Kao 2018-02-13 14 #ifdef CONFIG_DYNAMIC_FTRACE
0ff7c3b331276f Zong Li 2020-04-21 @15 int ftrace_arch_code_modify_prepare(void) __acquires(&text_mutex)
0ff7c3b331276f Zong Li 2020-04-21 16 {
0ff7c3b331276f Zong Li 2020-04-21 17 mutex_lock(&text_mutex);
0ff7c3b331276f Zong Li 2020-04-21 18 return 0;
0ff7c3b331276f Zong Li 2020-04-21 19 }
0ff7c3b331276f Zong Li 2020-04-21 20
0ff7c3b331276f Zong Li 2020-04-21 @21 int ftrace_arch_code_modify_post_process(void) __releases(&text_mutex)
0ff7c3b331276f Zong Li 2020-04-21 22 {
0ff7c3b331276f Zong Li 2020-04-21 23 mutex_unlock(&text_mutex);
0ff7c3b331276f Zong Li 2020-04-21 24 return 0;
0ff7c3b331276f Zong Li 2020-04-21 25 }
0ff7c3b331276f Zong Li 2020-04-21 26
---
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: 30173 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-04-03 21:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11 2:17 arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit kernel test robot
2020-08-11 2:17 ` kernel test robot
2020-09-12 10:37 kernel test robot
2020-10-13 9:39 kernel test robot
2021-03-17 20:31 kernel test robot
2021-04-03 21:32 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.