From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, Peter Zijlstra <peterz@infradead.org>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev
Subject: [peterz-queue:x86/core 3/3] arch/x86/kernel/static_call.c:98 __static_call_transform() error: uninitialized symbol 'op'.
Date: Mon, 23 Jan 2023 15:02:54 +0300 [thread overview]
Message-ID: <Y853bqEhA5NDC3Ar@kadam> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/core
head: 700f4c6d925823018a2d09f92de5405065d2ffec
commit: 700f4c6d925823018a2d09f92de5405065d2ffec [3/3] x86/static_call: Add support for Jcc tail-calls
config: i386-randconfig-m021 (https://download.01.org/0day-ci/archive/20230121/202301211834.noGVyk06-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
smatch warnings:
arch/x86/kernel/static_call.c:98 __static_call_transform() error: uninitialized symbol 'op'.
vim +/op +98 arch/x86/kernel/static_call.c
c27c753ea6fd12 Thomas Gleixner 2022-07-12 53 static void __ref __static_call_transform(void *insn, enum insn_type type,
c27c753ea6fd12 Thomas Gleixner 2022-07-12 54 void *func, bool modinit)
e6d6c071f22de2 Josh Poimboeuf 2020-08-18 55 {
3f2a8fc4b15de1 Peter Zijlstra 2021-01-18 56 const void *emulate = NULL;
452cddbff74b6a Peter Zijlstra 2020-08-18 57 int size = CALL_INSN_SIZE;
452cddbff74b6a Peter Zijlstra 2020-08-18 58 const void *code;
700f4c6d925823 Peter Zijlstra 2023-01-20 59 u8 op, buf[6];
700f4c6d925823 Peter Zijlstra 2023-01-20 60
700f4c6d925823 Peter Zijlstra 2023-01-20 61 if ((type == JMP || type == RET) && (op = __is_Jcc(insn)))
700f4c6d925823 Peter Zijlstra 2023-01-20 62 type = JCC;
Smatch is concerned that type can start as "JCC".
452cddbff74b6a Peter Zijlstra 2020-08-18 63
452cddbff74b6a Peter Zijlstra 2020-08-18 64 switch (type) {
452cddbff74b6a Peter Zijlstra 2020-08-18 65 case CALL:
7825451fa4dc04 Peter Zijlstra 2022-09-15 66 func = callthunks_translate_call_dest(func);
452cddbff74b6a Peter Zijlstra 2020-08-18 67 code = text_gen_insn(CALL_INSN_OPCODE, insn, func);
3f2a8fc4b15de1 Peter Zijlstra 2021-01-18 68 if (func == &__static_call_return0) {
3f2a8fc4b15de1 Peter Zijlstra 2021-01-18 69 emulate = code;
3f2a8fc4b15de1 Peter Zijlstra 2021-01-18 70 code = &xor5rax;
3f2a8fc4b15de1 Peter Zijlstra 2021-01-18 71 }
3f2a8fc4b15de1 Peter Zijlstra 2021-01-18 72
452cddbff74b6a Peter Zijlstra 2020-08-18 73 break;
452cddbff74b6a Peter Zijlstra 2020-08-18 74
452cddbff74b6a Peter Zijlstra 2020-08-18 75 case NOP:
a89dfde3dc3c2d Peter Zijlstra 2021-03-12 76 code = x86_nops[5];
452cddbff74b6a Peter Zijlstra 2020-08-18 77 break;
452cddbff74b6a Peter Zijlstra 2020-08-18 78
452cddbff74b6a Peter Zijlstra 2020-08-18 79 case JMP:
452cddbff74b6a Peter Zijlstra 2020-08-18 80 code = text_gen_insn(JMP32_INSN_OPCODE, insn, func);
452cddbff74b6a Peter Zijlstra 2020-08-18 81 break;
452cddbff74b6a Peter Zijlstra 2020-08-18 82
452cddbff74b6a Peter Zijlstra 2020-08-18 83 case RET:
ee88d363d15617 Peter Zijlstra 2022-06-14 84 if (cpu_feature_enabled(X86_FEATURE_RETHUNK))
770ae1b709528a Peter Zijlstra 2022-09-15 85 code = text_gen_insn(JMP32_INSN_OPCODE, insn, x86_return_thunk);
ee88d363d15617 Peter Zijlstra 2022-06-14 86 else
e463a09af2f067 Peter Zijlstra 2021-12-04 87 code = &retinsn;
452cddbff74b6a Peter Zijlstra 2020-08-18 88 break;
700f4c6d925823 Peter Zijlstra 2023-01-20 89
700f4c6d925823 Peter Zijlstra 2023-01-20 90 case JCC:
700f4c6d925823 Peter Zijlstra 2023-01-20 91 if (!func) {
700f4c6d925823 Peter Zijlstra 2023-01-20 92 func = __static_call_return;
700f4c6d925823 Peter Zijlstra 2023-01-20 93 if (cpu_feature_enabled(X86_FEATURE_RETHUNK))
700f4c6d925823 Peter Zijlstra 2023-01-20 94 func = x86_return_thunk;
700f4c6d925823 Peter Zijlstra 2023-01-20 95 }
700f4c6d925823 Peter Zijlstra 2023-01-20 96
700f4c6d925823 Peter Zijlstra 2023-01-20 97 buf[0] = 0x0f;
700f4c6d925823 Peter Zijlstra 2023-01-20 @98 __text_gen_insn(buf+1, op, insn+1, func, 5);
700f4c6d925823 Peter Zijlstra 2023-01-20 99 code = buf;
700f4c6d925823 Peter Zijlstra 2023-01-20 100 size = 6;
700f4c6d925823 Peter Zijlstra 2023-01-20 101
700f4c6d925823 Peter Zijlstra 2023-01-20 102 break;
452cddbff74b6a Peter Zijlstra 2020-08-18 103 }
e6d6c071f22de2 Josh Poimboeuf 2020-08-18 104
452cddbff74b6a Peter Zijlstra 2020-08-18 105 if (memcmp(insn, code, size) == 0)
e6d6c071f22de2 Josh Poimboeuf 2020-08-18 106 return;
e6d6c071f22de2 Josh Poimboeuf 2020-08-18 107
c27c753ea6fd12 Thomas Gleixner 2022-07-12 108 if (system_state == SYSTEM_BOOTING || modinit)
a945c8345ec0de Peter Zijlstra 2020-08-18 109 return text_poke_early(insn, code, size);
a945c8345ec0de Peter Zijlstra 2020-08-18 110
3f2a8fc4b15de1 Peter Zijlstra 2021-01-18 111 text_poke_bp(insn, code, size, emulate);
e6d6c071f22de2 Josh Poimboeuf 2020-08-18 112 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next reply other threads:[~2023-01-23 12:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-23 12:02 Dan Carpenter [this message]
2023-01-23 15:23 ` [peterz-queue:x86/core 3/3] arch/x86/kernel/static_call.c:98 __static_call_transform() error: uninitialized symbol 'op' Peter Zijlstra
2023-01-23 15:46 ` Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2023-01-21 10:21 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y853bqEhA5NDC3Ar@kadam \
--to=error27@gmail.com \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.