Skip to content

Commit 8037632

Browse files
seehearfeelchenhuacai
authored andcommitted
LoongArch: Add ifdefs to fix LSX and LASX related warnings
There exist some warnings when building kernel if CONFIG_CPU_HAS_LBT is set but CONFIG_CPU_HAS_LSX and CONFIG_CPU_HAS_LASX are not set. In this case, there are no definitions of _restore_lsx & _restore_lasx and there are also no definitions of kvm_restore_lsx & kvm_restore_lasx in fpu.S and switch.S respectively, just add some ifdefs to fix these warnings. AS arch/loongarch/kernel/fpu.o arch/loongarch/kernel/fpu.o: warning: objtool: unexpected relocation symbol type in .rela.discard.func_stack_frame_non_standard: 0 arch/loongarch/kernel/fpu.o: warning: objtool: unexpected relocation symbol type in .rela.discard.func_stack_frame_non_standard: 0 AS [M] arch/loongarch/kvm/switch.o arch/loongarch/kvm/switch.o: warning: objtool: unexpected relocation symbol type in .rela.discard.func_stack_frame_non_standard: 0 arch/loongarch/kvm/switch.o: warning: objtool: unexpected relocation symbol type in .rela.discard.func_stack_frame_non_standard: 0 MODPOST Module.symvers ERROR: modpost: "kvm_restore_lsx" [arch/loongarch/kvm/kvm.ko] undefined! ERROR: modpost: "kvm_restore_lasx" [arch/loongarch/kvm/kvm.ko] undefined! Cc: stable@vger.kernel.org # 6.9+ Fixes: cb8a2ef ("LoongArch: Add ORC stack unwinder support") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202408120955.qls5oNQY-lkp@intel.com/ Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 274ea35 commit 8037632

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

arch/loongarch/kernel/fpu.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,10 @@ SYM_FUNC_END(_restore_lasx_context)
530530

531531
#ifdef CONFIG_CPU_HAS_LBT
532532
STACK_FRAME_NON_STANDARD _restore_fp
533+
#ifdef CONFIG_CPU_HAS_LSX
533534
STACK_FRAME_NON_STANDARD _restore_lsx
535+
#endif
536+
#ifdef CONFIG_CPU_HAS_LASX
534537
STACK_FRAME_NON_STANDARD _restore_lasx
535538
#endif
539+
#endif

arch/loongarch/kvm/switch.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ SYM_DATA(kvm_enter_guest_size, .quad kvm_enter_guest_end - kvm_enter_guest)
277277

278278
#ifdef CONFIG_CPU_HAS_LBT
279279
STACK_FRAME_NON_STANDARD kvm_restore_fpu
280+
#ifdef CONFIG_CPU_HAS_LSX
280281
STACK_FRAME_NON_STANDARD kvm_restore_lsx
282+
#endif
283+
#ifdef CONFIG_CPU_HAS_LASX
281284
STACK_FRAME_NON_STANDARD kvm_restore_lasx
282285
#endif
286+
#endif

0 commit comments

Comments
 (0)