On Tue, 2023-08-29 at 14:28 +0800, Tiezhu Yang wrote:
The initial aim is to silence the following objtool warnings:Hmm why? To me this seems a function. We don't branch to it but store
arch/loongarch/kernel/fpu.o: warning: objtool: _save_fp_context() falls through to next function fault()
arch/loongarch/kernel/fpu.o: warning: objtool: _restore_fp_context() falls through to next function fault()
arch/loongarch/kernel/fpu.o: warning: objtool: _save_lsx_context() falls through to next function fault()
arch/loongarch/kernel/fpu.o: warning: objtool: _restore_lsx_context() falls through to next function fault()
arch/loongarch/kernel/fpu.o: warning: objtool: _save_lasx_context() falls through to next function fault()
arch/loongarch/kernel/fpu.o: warning: objtool: _restore_lasx_context() falls through to next function fault()
Obviously, the symbol fault is not a function, it is just a local label,
its address (a "function pointer") in the extable.
And these warnings do not make any sense to me:
/* snip */
diff --git a/arch/loongarch/kernel/fpu.S b/arch/loongarch/kernel/fpu.S_restore_lasx_context returns with this instruction. How can it fall
index b4032de..7defe50 100644
--- a/arch/loongarch/kernel/fpu.S
+++ b/arch/loongarch/kernel/fpu.S
@@ -521,7 +521,7 @@ SYM_FUNC_START(_restore_lasx_context)
jr ra
through into fault?
SYM_FUNC_END(_restore_lasx_context)
-SYM_FUNC_START(fault)
+SYM_CODE_START_LOCAL(fault)
li.w a0, -EFAULT # failure
jr ra
-SYM_FUNC_END(fault)
+SYM_CODE_END(fault)