tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git objtool/core head: 3fabba3d8d2d50b06b3d699f4b9f86a7de0aae4a commit: 82ad1ab5ed7967a58506353f98d28e91b16d782c [42/43] bpf,x86: Respect X86_FEATURE_RETPOLINE* config: i386-randconfig-a003-20211019 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project b37efed957ed0a0193d80020aefd55cb587dfc1f) 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/peterz/queue.git/commit/?id=82ad1ab5ed7967a58506353f98d28e91b16d782c git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git git fetch --no-tags peterz-queue objtool/core git checkout 82ad1ab5ed7967a58506353f98d28e91b16d782c # 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=i386 SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): arch/x86/net/bpf_jit_comp32.c:209:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:237:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:288:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:321:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:369:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:438:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:485:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:527:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:601:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:700:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:734:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:787:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:840:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:893:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:941:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:990:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:1038:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:1115:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:1248:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ >> arch/x86/net/bpf_jit_comp32.c:1367:20: error: use of undeclared identifier '__x86_indirect_thunk_edx' EMIT1_off32(0xE9, __x86_indirect_thunk_edx - (ip + 5)); ^ arch/x86/net/bpf_jit_comp32.c:1383:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:1401:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int cnt = 0; ^ arch/x86/net/bpf_jit_comp32.c:1562:9: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int i, cnt = 0, first_stack_regno, last_stack_regno; ^ arch/x86/net/bpf_jit_comp32.c:1655:9: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int i, cnt = 0; ^ 23 warnings and 1 error generated. vim +/__x86_indirect_thunk_edx +1367 arch/x86/net/bpf_jit_comp32.c 1269 1270 /* 1271 * Generate the following code: 1272 * ... bpf_tail_call(void *ctx, struct bpf_array *array, u64 index) ... 1273 * if (index >= array->map.max_entries) 1274 * goto out; 1275 * if (++tail_call_cnt > MAX_TAIL_CALL_CNT) 1276 * goto out; 1277 * prog = array->ptrs[index]; 1278 * if (prog == NULL) 1279 * goto out; 1280 * goto *(prog->bpf_func + prologue_size); 1281 * out: 1282 */ 1283 static void emit_bpf_tail_call(u8 **pprog, u8 *ip) 1284 { 1285 u8 *prog = *pprog; 1286 int cnt = 0; 1287 const u8 *r1 = bpf2ia32[BPF_REG_1]; 1288 const u8 *r2 = bpf2ia32[BPF_REG_2]; 1289 const u8 *r3 = bpf2ia32[BPF_REG_3]; 1290 const u8 *tcc = bpf2ia32[TCALL_CNT]; 1291 u32 lo, hi; 1292 static int jmp_label1 = -1; 1293 1294 /* 1295 * if (index >= array->map.max_entries) 1296 * goto out; 1297 */ 1298 /* mov eax,dword ptr [ebp+off] */ 1299 EMIT3(0x8B, add_2reg(0x40, IA32_EBP, IA32_EAX), STACK_VAR(r2[0])); 1300 /* mov edx,dword ptr [ebp+off] */ 1301 EMIT3(0x8B, add_2reg(0x40, IA32_EBP, IA32_EDX), STACK_VAR(r3[0])); 1302 1303 /* cmp dword ptr [eax+off],edx */ 1304 EMIT3(0x39, add_2reg(0x40, IA32_EAX, IA32_EDX), 1305 offsetof(struct bpf_array, map.max_entries)); 1306 /* jbe out */ 1307 EMIT2(IA32_JBE, jmp_label(jmp_label1, 2)); 1308 1309 /* 1310 * if (tail_call_cnt > MAX_TAIL_CALL_CNT) 1311 * goto out; 1312 */ 1313 lo = (u32)MAX_TAIL_CALL_CNT; 1314 hi = (u32)((u64)MAX_TAIL_CALL_CNT >> 32); 1315 EMIT3(0x8B, add_2reg(0x40, IA32_EBP, IA32_ECX), STACK_VAR(tcc[0])); 1316 EMIT3(0x8B, add_2reg(0x40, IA32_EBP, IA32_EBX), STACK_VAR(tcc[1])); 1317 1318 /* cmp edx,hi */ 1319 EMIT3(0x83, add_1reg(0xF8, IA32_EBX), hi); 1320 EMIT2(IA32_JNE, 3); 1321 /* cmp ecx,lo */ 1322 EMIT3(0x83, add_1reg(0xF8, IA32_ECX), lo); 1323 1324 /* ja out */ 1325 EMIT2(IA32_JAE, jmp_label(jmp_label1, 2)); 1326 1327 /* add eax,0x1 */ 1328 EMIT3(0x83, add_1reg(0xC0, IA32_ECX), 0x01); 1329 /* adc ebx,0x0 */ 1330 EMIT3(0x83, add_1reg(0xD0, IA32_EBX), 0x00); 1331 1332 /* mov dword ptr [ebp+off],eax */ 1333 EMIT3(0x89, add_2reg(0x40, IA32_EBP, IA32_ECX), STACK_VAR(tcc[0])); 1334 /* mov dword ptr [ebp+off],edx */ 1335 EMIT3(0x89, add_2reg(0x40, IA32_EBP, IA32_EBX), STACK_VAR(tcc[1])); 1336 1337 /* prog = array->ptrs[index]; */ 1338 /* mov edx, [eax + edx * 4 + offsetof(...)] */ 1339 EMIT3_off32(0x8B, 0x94, 0x90, offsetof(struct bpf_array, ptrs)); 1340 1341 /* 1342 * if (prog == NULL) 1343 * goto out; 1344 */ 1345 /* test edx,edx */ 1346 EMIT2(0x85, add_2reg(0xC0, IA32_EDX, IA32_EDX)); 1347 /* je out */ 1348 EMIT2(IA32_JE, jmp_label(jmp_label1, 2)); 1349 1350 /* goto *(prog->bpf_func + prologue_size); */ 1351 /* mov edx, dword ptr [edx + 32] */ 1352 EMIT3(0x8B, add_2reg(0x40, IA32_EDX, IA32_EDX), 1353 offsetof(struct bpf_prog, bpf_func)); 1354 /* add edx,prologue_size */ 1355 EMIT3(0x83, add_1reg(0xC0, IA32_EDX), PROLOGUE_SIZE); 1356 1357 /* mov eax,dword ptr [ebp+off] */ 1358 EMIT3(0x8B, add_2reg(0x40, IA32_EBP, IA32_EAX), STACK_VAR(r1[0])); 1359 1360 /* 1361 * Now we're ready to jump into next BPF program: 1362 * eax == ctx (1st arg) 1363 * edx == prog->bpf_func + prologue_size 1364 */ 1365 #ifdef CONFIG_RETPOLINE 1366 ip += prog - *pprog; > 1367 EMIT1_off32(0xE9, __x86_indirect_thunk_edx - (ip + 5)); 1368 #else 1369 EMIT2(0xFF, 0xE2); 1370 #endif 1371 1372 if (jmp_label1 == -1) 1373 jmp_label1 = cnt; 1374 1375 /* out: */ 1376 *pprog = prog; 1377 } 1378 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org