arch/arm64/kernel/proton-pack.c:783:14: sparse: sparse: symbol 'spectre_bhb_patch_fw_mitigation_enabled' was not declared. Should it be static?

From: kernel test robot
Date: Sat Mar 12 2022 - 08:38:35 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 68453767131a5deec1e8f9ac92a9042f929e585d
commit: ba2689234be92024e5635d30fe744f4853ad97db arm64: entry: Add vectors that have the bhb mitigation sequences
date: 3 weeks ago
config: arm64-randconfig-s032-20220311 (https://download.01.org/0day-ci/archive/20220312/202203122137.UnefPg5u-lkp@xxxxxxxxx/config)
compiler: aarch64-linux-gcc (GCC) 11.2.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.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ba2689234be92024e5635d30fe744f4853ad97db
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout ba2689234be92024e5635d30fe744f4853ad97db
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/kernel/

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


sparse warnings: (new ones prefixed by >>)
>> arch/arm64/kernel/proton-pack.c:783:14: sparse: sparse: symbol 'spectre_bhb_patch_fw_mitigation_enabled' was not declared. Should it be static?

vim +/spectre_bhb_patch_fw_mitigation_enabled +783 arch/arm64/kernel/proton-pack.c

773
774 static int ssbd_prctl_get(struct task_struct *task)
775 {
776 switch (spectre_v4_state) {
777 case SPECTRE_UNAFFECTED:
778 return PR_SPEC_NOT_AFFECTED;
779 case SPECTRE_MITIGATED:
780 if (spectre_v4_mitigations_on())
781 return PR_SPEC_NOT_AFFECTED;
782
> 783 if (spectre_v4_mitigations_dynamic())
784 break;
785
786 /* Mitigations are disabled, so we're vulnerable. */
787 fallthrough;
788 case SPECTRE_VULNERABLE:
789 fallthrough;
790 default:
791 return PR_SPEC_ENABLE;
792 }
793
794 /* Check the mitigation state for this task */
795 if (task_spec_ssb_force_disable(task))
796 return PR_SPEC_PRCTL | PR_SPEC_FORCE_DISABLE;
797
798 if (task_spec_ssb_noexec(task))
799 return PR_SPEC_PRCTL | PR_SPEC_DISABLE_NOEXEC;
800
801 if (task_spec_ssb_disable(task))
802 return PR_SPEC_PRCTL | PR_SPEC_DISABLE;
803
804 return PR_SPEC_PRCTL | PR_SPEC_ENABLE;
805 }
806

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