From: kernel test robot <lkp@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org
Subject: [tglx-devel:x86/fpu 42/78] arch/x86/kernel/fpu/core.c:372:11: warning: variable 'fpdst' is uninitialized when used here
Date: Tue, 12 Oct 2021 05:45:45 +0800 [thread overview]
Message-ID: <202110120539.L1C0khSE-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2994 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/fpu
head: cdb8206630ccd0c990e4af058d271f034dfd47de
commit: ec2658e1e6a67104db59576b35507b3cc4567dcb [42/78] x86/fpu: Use fpstate::size
config: i386-randconfig-r034-20211011 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 7ae8f392a1610992c9a925c867fd7238c70d3ce0)
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/tglx/devel.git/commit/?id=ec2658e1e6a67104db59576b35507b3cc4567dcb
git remote add tglx-devel https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git
git fetch --no-tags tglx-devel x86/fpu
git checkout ec2658e1e6a67104db59576b35507b3cc4567dcb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386
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/fpu/core.c:372:11: warning: variable 'fpdst' is uninitialized when used here [-Wuninitialized]
memcpy(&fpdst->regs, &fpsrc->regs, fpdst->size);
^~~~~
arch/x86/kernel/fpu/core.c:353:23: note: initialize the variable 'fpdst' to silence this warning
struct fpstate *fpdst, *fpsrc = current->thread.fpu.fpstate;
^
= NULL
1 warning generated.
vim +/fpdst +372 arch/x86/kernel/fpu/core.c
349
350 /* Clone current's FPU state on fork */
351 int fpu_clone(struct task_struct *dst_tsk)
352 {
353 struct fpstate *fpdst, *fpsrc = current->thread.fpu.fpstate;
354 struct fpu *src_fpu = ¤t->thread.fpu;
355 struct fpu *dst_fpu = &dst_tsk->thread.fpu;
356
357 /* The new task's FPU state cannot be valid in the hardware. */
358 dst_fpu->last_cpu = -1;
359
360 fpstate_reset(dst_fpu);
361
362 if (!cpu_feature_enabled(X86_FEATURE_FPU))
363 return 0;
364
365 /*
366 * If the FPU registers are not owned by current just memcpy() the
367 * state. Otherwise save the FPU registers directly into the
368 * child's FPU context, without any memory-to-memory copying.
369 */
370 fpregs_lock();
371 if (test_thread_flag(TIF_NEED_FPU_LOAD))
> 372 memcpy(&fpdst->regs, &fpsrc->regs, fpdst->size);
373 else
374 save_fpregs_to_fpstate(dst_fpu);
375 fpregs_unlock();
376
377 set_tsk_thread_flag(dst_tsk, TIF_NEED_FPU_LOAD);
378
379 trace_x86_fpu_copy_src(src_fpu);
380 trace_x86_fpu_copy_dst(dst_fpu);
381
382 return 0;
383 }
384
---
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: 39602 bytes --]
reply other threads:[~2021-10-11 21:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202110120539.L1C0khSE-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®