Skip to contentSkip to conversation

arch/riscv/kernel/signal.c:130:2: error: call to undeclared function '__riscv_v_vstate_clean'; ISO C99 and later do not support implicit function declarations

PATCH kernel test robot 1 participant 1 message Nov 26

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://github.com/congwang/linux.git riscv-vector-discard
head:   82089161ab902778cdd13a9cd126871c69aa4e87
commit: 19973bf52f3795693ec7baaa5812d33009dbcd6e [3/5] riscv: clarify vector state semantics on syscall and context switch
config: riscv-randconfig-2005-20261126 (https://download.01.org/0day-ci/archive/20261126/[email protected]/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 3a9f981aab0cc32f74ffac36a87891cda8889c37)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261126/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from arch/riscv/kernel/signal.c:12:
In file included from include/linux/syscalls.h:96:
In file included from include/trace/syscall.h:7:
In file included from include/linux/trace_events.h:9:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:12:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:1209:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
1209 | return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
| ~~~~~~~~~~ ^

>> arch/riscv/kernel/signal.c:130:2: error: call to undeclared function '__riscv_v_vstate_clean'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     130 |         __riscv_v_vstate_clean(regs);
         |         ^
   arch/riscv/kernel/signal.c:130:2: note: did you mean 'riscv_v_vstate_query'?
   arch/riscv/include/asm/vector.h:429:20: note: 'riscv_v_vstate_query' declared here
     429 | static inline bool riscv_v_vstate_query(struct pt_regs *regs) { return false; }
         |                    ^

1 warning and 1 error generated.

vim +/__riscv_v_vstate_clean +130 arch/riscv/kernel/signal.c

107
108 /*
109 * Restore Vector extension context from the user's signal frame. This function
110 * assumes a valid extension header. So magic and size checking must be done by
111 * the caller.
112 */
113 static long __restore_v_state(struct pt_regs *regs, void __user *sc_vec)
114 {
115 long err;
116 struct __sc_riscv_v_state __user *state = sc_vec;
117 void __user *datap;
118
119 /*
120 * Mark the vstate as clean prior performing the actual copy,
121 * to avoid getting the vstate incorrectly clobbered by the
122 * discarded vector state.
123 *
124 * This also allows user to modify vregs through the signal
125 * interface at a syscall stop. e.g. to support user space
126 * context switching.
127 */
128 preempt_disable();
129 riscv_v_vstate_set_restore(current, regs);

 > 130		__riscv_v_vstate_clean(regs);

131 preempt_enable();
132
133 /* Copy everything of __sc_riscv_v_state except datap. */
134 err = __copy_from_user(&current->thread.vstate, &state->v_state,
135 offsetof(struct __riscv_v_ext_state, datap));
136 if (unlikely(err))
137 return err;
138
139 /* Copy the pointer datap itself. */
140 err = __get_user(datap, &state->v_state.datap);
141 if (unlikely(err))
142 return err;
143 /*
144 * Copy the whole vector content from user space datap. Use
145 * copy_from_user to prevent information leak.
146 */
147 return copy_from_user(current->thread.vstate.datap, datap, riscv_v_vsize);
148 }
149

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki