From: kernel test robot <lkp@intel.com>
To: Borislav Petkov <bp@alien8.de>,
Andy Lutomirski <luto@amacapital.net>,
Masami Hiramatsu <mhiramat@kernel.org>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
X86 ML <x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 11/19] x86/sev-es: Convert to insn_decode()
Date: Fri, 25 Dec 2020 18:50:33 +0800 [thread overview]
Message-ID: <202012251838.G6eufP3Q-lkp@intel.com> (raw)
In-Reply-To: <20201223174233.28638-12-bp@alien8.de>
[-- Attachment #1: Type: text/plain, Size: 5246 bytes --]
Hi Borislav,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.10 next-20201223]
[cannot apply to tip/perf/core tip/x86/core luto/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Borislav-Petkov/x86-insn-Add-an-insn_decode-API/20201224-014846
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 614cb5894306cfa2c7d9b6168182876ff5948735
config: x86_64-randconfig-a016-20201223 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/9cc93591504c88c42ab10903fc69062fc1461ed0
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Borislav-Petkov/x86-insn-Add-an-insn_decode-API/20201224-014846
git checkout 9cc93591504c88c42ab10903fc69062fc1461ed0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> arch/x86/kernel/sev-es.c:258:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (!insn_decode_regs(&ctxt->insn, ctxt->regs, buffer, res))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/kernel/sev-es.c:272:6: note: uninitialized use occurs here
if (ret < 0)
^~~
arch/x86/kernel/sev-es.c:258:3: note: remove the 'if' if its condition is always true
if (!insn_decode_regs(&ctxt->insn, ctxt->regs, buffer, res))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/kernel/sev-es.c:247:14: note: initialize the variable 'ret' to silence this warning
int res, ret;
^
= 0
1 warning generated.
vim +258 arch/x86/kernel/sev-es.c
f980f9c31a923e9 Joerg Roedel 2020-09-07 243
f980f9c31a923e9 Joerg Roedel 2020-09-07 244 static enum es_result vc_decode_insn(struct es_em_ctxt *ctxt)
f980f9c31a923e9 Joerg Roedel 2020-09-07 245 {
f980f9c31a923e9 Joerg Roedel 2020-09-07 246 char buffer[MAX_INSN_SIZE];
9cc93591504c88c Borislav Petkov 2020-12-23 247 int res, ret;
f980f9c31a923e9 Joerg Roedel 2020-09-07 248
5e3427a7bc432ed Joerg Roedel 2020-09-07 249 if (user_mode(ctxt->regs)) {
5e3427a7bc432ed Joerg Roedel 2020-09-07 250 res = insn_fetch_from_user(ctxt->regs, buffer);
5e3427a7bc432ed Joerg Roedel 2020-09-07 251 if (!res) {
5e3427a7bc432ed Joerg Roedel 2020-09-07 252 ctxt->fi.vector = X86_TRAP_PF;
5e3427a7bc432ed Joerg Roedel 2020-09-07 253 ctxt->fi.error_code = X86_PF_INSTR | X86_PF_USER;
5e3427a7bc432ed Joerg Roedel 2020-09-07 254 ctxt->fi.cr2 = ctxt->regs->ip;
5e3427a7bc432ed Joerg Roedel 2020-09-07 255 return ES_EXCEPTION;
5e3427a7bc432ed Joerg Roedel 2020-09-07 256 }
5e3427a7bc432ed Joerg Roedel 2020-09-07 257
63d702bf108e3ad Borislav Petkov 2020-12-23 @258 if (!insn_decode_regs(&ctxt->insn, ctxt->regs, buffer, res))
5e3427a7bc432ed Joerg Roedel 2020-09-07 259 return ES_DECODE_FAILED;
5e3427a7bc432ed Joerg Roedel 2020-09-07 260 } else {
f980f9c31a923e9 Joerg Roedel 2020-09-07 261 res = vc_fetch_insn_kernel(ctxt, buffer);
5e3427a7bc432ed Joerg Roedel 2020-09-07 262 if (res) {
f980f9c31a923e9 Joerg Roedel 2020-09-07 263 ctxt->fi.vector = X86_TRAP_PF;
5e3427a7bc432ed Joerg Roedel 2020-09-07 264 ctxt->fi.error_code = X86_PF_INSTR;
f980f9c31a923e9 Joerg Roedel 2020-09-07 265 ctxt->fi.cr2 = ctxt->regs->ip;
f980f9c31a923e9 Joerg Roedel 2020-09-07 266 return ES_EXCEPTION;
f980f9c31a923e9 Joerg Roedel 2020-09-07 267 }
f980f9c31a923e9 Joerg Roedel 2020-09-07 268
9cc93591504c88c Borislav Petkov 2020-12-23 269 ret = insn_decode(&ctxt->insn, buffer, MAX_INSN_SIZE - res, INSN_MODE_64);
5e3427a7bc432ed Joerg Roedel 2020-09-07 270 }
f980f9c31a923e9 Joerg Roedel 2020-09-07 271
9cc93591504c88c Borislav Petkov 2020-12-23 272 if (ret < 0)
9cc93591504c88c Borislav Petkov 2020-12-23 273 return ES_DECODE_FAILED;
9cc93591504c88c Borislav Petkov 2020-12-23 274 else
9cc93591504c88c Borislav Petkov 2020-12-23 275 return ES_OK;
f980f9c31a923e9 Joerg Roedel 2020-09-07 276 }
f980f9c31a923e9 Joerg Roedel 2020-09-07 277
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27692 bytes --]
next prev parent reply other threads:[~2020-12-25 10:57 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-23 17:42 [PATCH v1 00/19] x86/insn: Add an insn_decode() API Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 01/19] x86/insn: Rename insn_decode() to insn_decode_regs() Borislav Petkov
2020-12-28 17:16 ` Sean Christopherson
2020-12-29 19:36 ` Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 02/19] x86/insn: Add @buf_len param to insn_init() kernel-doc comment Borislav Petkov
2020-12-28 1:44 ` Masami Hiramatsu
2020-12-23 17:42 ` [PATCH v1 03/19] x86/insn: Add an insn_decode() API Borislav Petkov
2020-12-28 1:15 ` Masami Hiramatsu
2020-12-29 20:06 ` Borislav Petkov
2020-12-30 9:00 ` Masami Hiramatsu
2020-12-30 9:28 ` Borislav Petkov
2021-01-06 5:21 ` Masami Hiramatsu
2021-01-08 18:59 ` Borislav Petkov
2021-01-12 11:34 ` Masami Hiramatsu
2021-01-13 18:06 ` Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 04/19] x86/insn-eval: Handle return values from the decoder Borislav Petkov
2020-12-28 18:51 ` Sean Christopherson
2020-12-28 19:06 ` Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 05/19] x86/boot/compressed/sev-es: Convert to insn_decode() Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 06/19] perf/x86/intel/ds: Check insn_get_length() retval Borislav Petkov
2021-01-04 13:19 ` Peter Zijlstra
2021-01-19 10:40 ` Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 07/19] perf/x86/intel/ds: Check return values of insn decoder functions Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 08/19] x86/alternative: Use insn_decode() Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 09/19] x86/mce: Convert to insn_decode() Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 10/19] x86/kprobes: " Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 11/19] x86/sev-es: " Borislav Petkov
2020-12-25 10:50 ` kernel test robot [this message]
2020-12-25 12:33 ` Borislav Petkov
2020-12-28 19:15 ` Sean Christopherson
2021-01-21 16:58 ` Borislav Petkov
2021-01-21 22:35 ` Sean Christopherson
2020-12-23 17:42 ` [PATCH v1 12/19] x86/traps: " Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 13/19] x86/uprobes: " Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 14/19] x86/tools/insn_decoder_test: " Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 15/19] tools/objtool: " Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 16/19] x86/tools/insn_sanity: " Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 17/19] tools/perf: " Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 18/19] x86/insn: Remove kernel_insn_init() Borislav Petkov
2020-12-23 17:42 ` [PATCH v1 19/19] x86/insn: Make insn_complete() static Borislav Petkov
2020-12-27 15:26 ` [PATCH v1 00/19] x86/insn: Add an insn_decode() API Tom Lendacky
2021-02-03 12:00 ` Borislav Petkov
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=202012251838.G6eufP3Q-lkp@intel.com \
--to=lkp@intel.com \
--cc=bp@alien8.de \
--cc=clang-built-linux@googlegroups.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mhiramat@kernel.org \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome