* [jpoimboe:static-call-null-4 11/11] arch/x86/kernel/alternative.c:613:23: warning: variable 'dest' set but not used
@ 2023-03-22 8:44 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-03-22 8:44 UTC (permalink / raw)
To: Josh Poimboeuf; +Cc: oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git static-call-null-4
head: 67517470624490a1d82c0b3a5e744a72d325b4af
commit: 67517470624490a1d82c0b3a5e744a72d325b4af [11/11] static_call: Remove DEFINE_STATIC_CALL_RET0()
config: x86_64-randconfig-a011 (https://download.01.org/0day-ci/archive/20230322/202303221651.Q540blBW-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git/commit/?id=67517470624490a1d82c0b3a5e744a72d325b4af
git remote add jpoimboe https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git
git fetch --no-tags jpoimboe static-call-null-4
git checkout 67517470624490a1d82c0b3a5e744a72d325b4af
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/kernel/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303221651.Q540blBW-lkp@intel.com/
All warnings (new ones prefixed by >>):
arch/x86/kernel/alternative.c: In function 'apply_returns':
>> arch/x86/kernel/alternative.c:613:23: warning: variable 'dest' set but not used [-Wunused-but-set-variable]
613 | void *dest = NULL, *addr = (void *)s + *s;
| ^~~~
vim +/dest +613 arch/x86/kernel/alternative.c
15e67227c49a57 Peter Zijlstra 2022-06-14 607
15e67227c49a57 Peter Zijlstra 2022-06-14 608 void __init_or_module noinline apply_returns(s32 *start, s32 *end)
15e67227c49a57 Peter Zijlstra 2022-06-14 609 {
15e67227c49a57 Peter Zijlstra 2022-06-14 610 s32 *s;
15e67227c49a57 Peter Zijlstra 2022-06-14 611
15e67227c49a57 Peter Zijlstra 2022-06-14 612 for (s = start; s < end; s++) {
ee88d363d15617 Peter Zijlstra 2022-06-14 @613 void *dest = NULL, *addr = (void *)s + *s;
15e67227c49a57 Peter Zijlstra 2022-06-14 614 struct insn insn;
15e67227c49a57 Peter Zijlstra 2022-06-14 615 int len, ret;
15e67227c49a57 Peter Zijlstra 2022-06-14 616 u8 bytes[16];
ee88d363d15617 Peter Zijlstra 2022-06-14 617 u8 op;
15e67227c49a57 Peter Zijlstra 2022-06-14 618
15e67227c49a57 Peter Zijlstra 2022-06-14 619 ret = insn_decode_kernel(&insn, addr);
15e67227c49a57 Peter Zijlstra 2022-06-14 620 if (WARN_ON_ONCE(ret < 0))
15e67227c49a57 Peter Zijlstra 2022-06-14 621 continue;
15e67227c49a57 Peter Zijlstra 2022-06-14 622
ee88d363d15617 Peter Zijlstra 2022-06-14 623 op = insn.opcode.bytes[0];
ee88d363d15617 Peter Zijlstra 2022-06-14 624 if (op == JMP32_INSN_OPCODE)
ee88d363d15617 Peter Zijlstra 2022-06-14 625 dest = addr + insn.length + insn.immediate.value;
ee88d363d15617 Peter Zijlstra 2022-06-14 626
15e67227c49a57 Peter Zijlstra 2022-06-14 627 DPRINTK("return thunk at: %pS (%px) len: %d to: %pS",
15e67227c49a57 Peter Zijlstra 2022-06-14 628 addr, addr, insn.length,
15e67227c49a57 Peter Zijlstra 2022-06-14 629 addr + insn.length + insn.immediate.value);
15e67227c49a57 Peter Zijlstra 2022-06-14 630
15e67227c49a57 Peter Zijlstra 2022-06-14 631 len = patch_return(addr, &insn, bytes);
15e67227c49a57 Peter Zijlstra 2022-06-14 632 if (len == insn.length) {
15e67227c49a57 Peter Zijlstra 2022-06-14 633 DUMP_BYTES(((u8*)addr), len, "%px: orig: ", addr);
15e67227c49a57 Peter Zijlstra 2022-06-14 634 DUMP_BYTES(((u8*)bytes), len, "%px: repl: ", addr);
15e67227c49a57 Peter Zijlstra 2022-06-14 635 text_poke_early(addr, bytes, len);
15e67227c49a57 Peter Zijlstra 2022-06-14 636 }
15e67227c49a57 Peter Zijlstra 2022-06-14 637 }
15e67227c49a57 Peter Zijlstra 2022-06-14 638 }
f43b9876e857c7 Peter Zijlstra 2022-06-27 639 #else
f43b9876e857c7 Peter Zijlstra 2022-06-27 640 void __init_or_module noinline apply_returns(s32 *start, s32 *end) { }
f43b9876e857c7 Peter Zijlstra 2022-06-27 641 #endif /* CONFIG_RETHUNK */
f43b9876e857c7 Peter Zijlstra 2022-06-27 642
:::::: The code at line 613 was first introduced by commit
:::::: ee88d363d15617ff50ac24fab0ffec11113b2aeb x86,static_call: Use alternative RET encoding
:::::: TO: Peter Zijlstra <peterz@infradead.org>
:::::: CC: Borislav Petkov <bp@suse.de>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-22 8:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-22 8:44 [jpoimboe:static-call-null-4 11/11] arch/x86/kernel/alternative.c:613:23: warning: variable 'dest' set but not used kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).