Hi James, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 576e61cea1e4b66f52f164dee0edbe4b1c999997 commit: 228a26b912287934789023b4132ba76065d9491c arm64: Use the clearbhb instruction in mitigations date: 8 months ago config: arm64-alldefconfig compiler: aarch64-linux-gcc (GCC) 12.1.0 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 # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=228a26b912287934789023b4132ba76065d9491c git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 228a26b912287934789023b4132ba76065d9491c # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/kernel/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): arch/arm64/kernel/proton-pack.c:564:13: warning: no previous prototype for 'spectre_v4_patch_fw_mitigation_enable' [-Wmissing-prototypes] 564 | void __init spectre_v4_patch_fw_mitigation_enable(struct alt_instr *alt, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kernel/proton-pack.c:584:13: warning: no previous prototype for 'smccc_patch_fw_mitigation_conduit' [-Wmissing-prototypes] 584 | void __init smccc_patch_fw_mitigation_conduit(struct alt_instr *alt, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kernel/proton-pack.c:1048:14: warning: no previous prototype for 'spectre_bhb_patch_loop_mitigation_enable' [-Wmissing-prototypes] 1048 | void noinstr spectre_bhb_patch_loop_mitigation_enable(struct alt_instr *alt, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kernel/proton-pack.c:1059:14: warning: no previous prototype for 'spectre_bhb_patch_fw_mitigation_enabled' [-Wmissing-prototypes] 1059 | void noinstr spectre_bhb_patch_fw_mitigation_enabled(struct alt_instr *alt, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kernel/proton-pack.c:1070:14: warning: no previous prototype for 'spectre_bhb_patch_loop_iter' [-Wmissing-prototypes] 1070 | void noinstr spectre_bhb_patch_loop_iter(struct alt_instr *alt, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kernel/proton-pack.c:1091:14: warning: no previous prototype for 'spectre_bhb_patch_wa3' [-Wmissing-prototypes] 1091 | void noinstr spectre_bhb_patch_wa3(struct alt_instr *alt, | ^~~~~~~~~~~~~~~~~~~~~ >> arch/arm64/kernel/proton-pack.c:1117:13: warning: no previous prototype for 'spectre_bhb_patch_clearbhb' [-Wmissing-prototypes] 1117 | void __init spectre_bhb_patch_clearbhb(struct alt_instr *alt, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ vim +/spectre_bhb_patch_clearbhb +1117 arch/arm64/kernel/proton-pack.c 1057 1058 /* Patched to NOP when enabled */ > 1059 void noinstr spectre_bhb_patch_fw_mitigation_enabled(struct alt_instr *alt, 1060 __le32 *origptr, 1061 __le32 *updptr, int nr_inst) 1062 { 1063 BUG_ON(nr_inst != 1); 1064 1065 if (test_bit(BHB_FW, &system_bhb_mitigations)) 1066 *updptr++ = cpu_to_le32(aarch64_insn_gen_nop()); 1067 } 1068 1069 /* Patched to correct the immediate */ 1070 void noinstr spectre_bhb_patch_loop_iter(struct alt_instr *alt, 1071 __le32 *origptr, __le32 *updptr, int nr_inst) 1072 { 1073 u8 rd; 1074 u32 insn; 1075 u16 loop_count = spectre_bhb_loop_affected(SCOPE_SYSTEM); 1076 1077 BUG_ON(nr_inst != 1); /* MOV -> MOV */ 1078 1079 if (!IS_ENABLED(CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY)) 1080 return; 1081 1082 insn = le32_to_cpu(*origptr); 1083 rd = aarch64_insn_decode_register(AARCH64_INSN_REGTYPE_RD, insn); 1084 insn = aarch64_insn_gen_movewide(rd, loop_count, 0, 1085 AARCH64_INSN_VARIANT_64BIT, 1086 AARCH64_INSN_MOVEWIDE_ZERO); 1087 *updptr++ = cpu_to_le32(insn); 1088 } 1089 1090 /* Patched to mov WA3 when supported */ 1091 void noinstr spectre_bhb_patch_wa3(struct alt_instr *alt, 1092 __le32 *origptr, __le32 *updptr, int nr_inst) 1093 { 1094 u8 rd; 1095 u32 insn; 1096 1097 BUG_ON(nr_inst != 1); /* MOV -> MOV */ 1098 1099 if (!IS_ENABLED(CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY) || 1100 !test_bit(BHB_FW, &system_bhb_mitigations)) 1101 return; 1102 1103 insn = le32_to_cpu(*origptr); 1104 rd = aarch64_insn_decode_register(AARCH64_INSN_REGTYPE_RD, insn); 1105 1106 insn = aarch64_insn_gen_logical_immediate(AARCH64_INSN_LOGIC_ORR, 1107 AARCH64_INSN_VARIANT_32BIT, 1108 AARCH64_INSN_REG_ZR, rd, 1109 ARM_SMCCC_ARCH_WORKAROUND_3); 1110 if (WARN_ON_ONCE(insn == AARCH64_BREAK_FAULT)) 1111 return; 1112 1113 *updptr++ = cpu_to_le32(insn); 1114 } 1115 1116 /* Patched to NOP when not supported */ > 1117 void __init spectre_bhb_patch_clearbhb(struct alt_instr *alt, -- 0-DAY CI Kernel Test Service https://01.org/lkp