[ardb:arm32-wchan-test 6/10] arch/mips/kernel/process.c:527:22: warning: unused function 'thread_saved_pc'

From: kernel test robot
Date: Sat Nov 06 2021 - 23:18:34 EST


tree: git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git arm32-wchan-test
head: d5745a2fa90e622a22e958cc49044e288fe20286
commit: b6df12c0e3b6d617c6f1cf1b78b942d154561086 [6/10] arch: __get_wchan || STACKTRACE_SUPPORT
config: mips-randconfig-r026-20211027 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5db7568a6a1fcb408eb8988abdaff2a225a8eb72)
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
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?id=b6df12c0e3b6d617c6f1cf1b78b942d154561086
git remote add ardb git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git
git fetch --no-tags ardb arm32-wchan-test
git checkout b6df12c0e3b6d617c6f1cf1b78b942d154561086
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash arch/mips/kernel/ kernel/trace/

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

All warnings (new ones prefixed by >>):

>> arch/mips/kernel/process.c:527:22: warning: unused function 'thread_saved_pc'
static unsigned long thread_saved_pc(struct task_struct
^
fatal error: error in backend: Nested variants found in inline asm string: ' .set push
.set mips64r2
.if ( 0x00 ) != -1)) 0x00 ) != -1)) : ($( static struct ftrace_branch_data __attribute__((__aligned__(4))) __attribute__((__section__("_ftrace_branch"))) __if_trace = $( .func = __func__, .file = "arch/mips/include/asm/bitops.h", .line = 133, $); 0x00 ) != -1)) : $))) ) && ( 0 ); .set push; .set mips64r2; .rept 1; sync 0x00; .endr; .set pop; .else; ; .endif
1: ll $0, $1
and $0, $2
sc $0, $1
beqz $0, 1b
.set pop
'
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: clang -Wp,-MMD,arch/mips/kernel/.process.o.d -nostdinc -isystem /opt/cross/clang-cefc01fa65/lib/clang/14.0.0/include -Iarch/mips/include -I./arch/mips/include/generated -Iinclude -I./include -Iarch/mips/include/uapi -I./arch/mips/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -DVMLINUX_LOAD_ADDRESS=0xffffffff84000000 -DLINKER_LOAD_ADDRESS=0x84000000 -DDATAOFFSET=0 -Qunused-arguments -fmacro-prefix-map== -DKBUILD_EXTRA_WARN1 -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 --target=mips-linux -fintegrated-as -Werror=unknown-warning-option -Werror=ignored-optimization-argument -mno-check-zero-division -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -DGAS_HAS_SET_HARDFLOAT -Wa,-msoft-float -ffreestanding -EB -fno-stack-check -march=mips32 -Wa,-mips32 -Wa,--trap -DTOOLCHAIN_SUPPORTS_VIRT -Iarch/mips/include/asm/mach-bcm63xx/ -Iarch/mips/include/asm/mach-generic -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-address-of-packed-member -O2 -Wframe-larger-than=1024 -fstack-protector -Wno-gnu -mno-global-merge -Wno-unused-but-set-variable -Wno-unused-const-variable -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -fno-stack-clash-protection -pg -falign-functions=64 -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-array-bounds -fno-strict-overflow -fno-stack-check -Werror=date-time -Werror=incompatible-pointer-types -Wextra -Wunused -Wno-unused-parameter -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wmissing-include-dirs -Wunused-but-set-variable -Wunused-const-variable -Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits -fsanitize-coverage=trace-pc -fsanitize-coverage=trace-cmp -I arch/mips/kernel -I ./arch/mips/kernel -ffunction-sections -fdata-sections -DKBUILD_MODFILE="arch/mips/kernel/process" -DKBUILD_BASENAME="process" -DKBUILD_MODNAME="process" -D__KBUILD_MODNAME=kmod_process -c -o arch/mips/kernel/process.o arch/mips/kernel/process.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'arch/mips/kernel/process.c'.
4. Running pass 'Mips Assembly Printer' on function '@start_thread'
#0 0x0000563d505e1e8f Signals.cpp:0:0
#1 0x0000563d505dfdac llvm::sys::CleanupOnSignal(unsigned long) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x3295dac)
#2 0x0000563d5052e6b7 llvm::CrashRecoveryContext::HandleExit(int) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x31e46b7)
#3 0x0000563d505d845e llvm::sys::Process::Exit(int, bool) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x328e45e)
#4 0x0000563d4e30f58b (/opt/cross/clang-cefc01fa65/bin/clang-14+0xfc558b)
#5 0x0000563d5053510c llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x31eb10c)
#6 0x0000563d511afb26 llvm::AsmPrinter::emitInlineAsm(llvm::MachineInstr const (/opt/cross/clang-cefc01fa65/bin/clang-14+0x3e65b26)
#7 0x0000563d511ab286 llvm::AsmPrinter::emitFunctionBody() (/opt/cross/clang-cefc01fa65/bin/clang-14+0x3e61286)
#8 0x0000563d4ed4881e llvm::MipsAsmPrinter::runOnMachineFunction(llvm::MachineFunction&) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x19fe81e)
#9 0x0000563d4f97f90d llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.53) MachineFunctionPass.cpp:0:0
#10 0x0000563d4fda4ba7 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x2a5aba7)
#11 0x0000563d4fda4d21 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x2a5ad21)
#12 0x0000563d4fda5fff llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x2a5bfff)
#13 0x0000563d508cb5ca clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x35815ca)
#14 0x0000563d51537a93 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x41eda93)
#15 0x0000563d52027579 clang::ParseAST(clang::Sema&, bool, bool) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x4cdd579)
#16 0x0000563d515368ff clang::CodeGenAction::ExecuteAction() (/opt/cross/clang-cefc01fa65/bin/clang-14+0x41ec8ff)
#17 0x0000563d50ecc601 clang::FrontendAction::Execute() (/opt/cross/clang-cefc01fa65/bin/clang-14+0x3b82601)
#18 0x0000563d50e64c0a clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x3b1ac0a)
#19 0x0000563d50f9556b (/opt/cross/clang-cefc01fa65/bin/clang-14+0x3c4b56b)
#20 0x0000563d4e3102c4 cc1_main(llvm::ArrayRef<char char (/opt/cross/clang-cefc01fa65/bin/clang-14+0xfc62c4)
#21 0x0000563d4e30d81b ExecuteCC1Tool(llvm::SmallVectorImpl<char driver.cpp:0:0
#22 0x0000563d50d0a535 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> const::'lambda'()>(long) Job.cpp:0:0
#23 0x0000563d5052e573 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x31e4573)
#24 0x0000563d50d0ae37 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> const (.part.216) Job.cpp:0:0
#25 0x0000563d50ce21c7 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const (/opt/cross/clang-cefc01fa65/bin/clang-14+0x39981c7)
#26 0x0000563d50ce2ba7 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command >&) const (/opt/cross/clang-cefc01fa65/bin/clang-14+0x3998ba7)
#27 0x0000563d50cebee9 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command >&) (/opt/cross/clang-cefc01fa65/bin/clang-14+0x39a1ee9)
#28 0x0000563d4e238c9f main (/opt/cross/clang-cefc01fa65/bin/clang-14+0xeeec9f)
#29 0x00007ffa95510d0a __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26d0a)
#30 0x0000563d4e30d33a _start (/opt/cross/clang-cefc01fa65/bin/clang-14+0xfc333a)
clang-14: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 14.0.0 (git://gitmirror/llvm_project cefc01fa65a7ebcc10cbf3c3bb2278a6a122deaf)
Target: mips-unknown-linux
Thread model: posix
InstalledDir: /opt/cross/clang-cefc01fa65/bin
clang-14: note: diagnostic msg:
Makefile arch drivers include kernel nr_bisected scripts source usr


vim +/thread_saved_pc +527 arch/mips/kernel/process.c

^1da177e4c3f4152 Linus Torvalds 2005-04-16 523
^1da177e4c3f4152 Linus Torvalds 2005-04-16 524 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 525 * Return saved PC of a blocked thread.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 526 */
508c5757a72873d0 Tobias Klauser 2017-09-18 @527 static unsigned long thread_saved_pc(struct task_struct *tsk)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 528 {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 529 struct thread_struct *t = &tsk->thread;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 530
^1da177e4c3f4152 Linus Torvalds 2005-04-16 531 /* New born processes are a special case */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 532 if (t->reg31 == (unsigned long) ret_from_fork)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 533 return t->reg31;
b5943182592ba256 Franck Bui-Huu 2006-08-18 534 if (schedule_mfi.pc_offset < 0)
dc953df1ba552681 Thiemo Seufer 2005-02-21 535 return 0;
b5943182592ba256 Franck Bui-Huu 2006-08-18 536 return ((unsigned long *)t->reg29)[schedule_mfi.pc_offset];
^1da177e4c3f4152 Linus Torvalds 2005-04-16 537 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 538

:::::: The code at line 527 was first introduced by commit
:::::: 508c5757a72873d007e932faff5fa0014b25812d MIPS: make thread_saved_pc static

:::::: TO: Tobias Klauser <tklauser@xxxxxxxxxx>
:::::: CC: Ralf Baechle <ralf@xxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip