From: Ingo Molnar <mingo@kernel.org>
To: Borislav Petkov <bp@alien8.de>
Cc: kernel test robot <ying.huang@linux.intel.com>,
Andy Lutomirski <luto@kernel.org>,
lkp@01.org, LKML <linux-kernel@vger.kernel.org>,
yu-cheng yu <yu-cheng.yu@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>,
Rik van Riel <riel@redhat.com>,
Quentin Casasnovas <quentin.casasnovas@oracle.com>,
Peter Zijlstra <peterz@infradead.org>,
Oleg Nesterov <oleg@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Fenghua Yu <fenghua.yu@intel.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Andy Lutomirski <luto@amacapital.net>
Subject: Re: [lkp] [x86/fpu] 58122bf1d8: WARNING: CPU: 0 PID: 1 at arch/x86/include/asm/fpu/internal.h:529 fpu__restore+0x28f/0x9ab()
Date: Sat, 27 Feb 2016 13:02:11 +0100 [thread overview]
Message-ID: <20160227120211.GA25164@gmail.com> (raw)
In-Reply-To: <20160226074940.GA28911@pd.tnic>
* Borislav Petkov <bp@alien8.de> wrote:
> From: Borislav Petkov <bp@suse.de>
> Date: Mon, 15 Feb 2016 19:50:33 +0100
> Subject: [PATCH] x86/FPU: Fix double FPU regs activation
>
> sys_sigreturn() calls fpu__restore_sig() with interrupts enabled. When
> restoring a 32-bit signal frame. And it can happen that we get preempted
> right after setting ->fpstate_active in a task's FPU.
>
> After we get preempted, we switch between tasks merrily and eventually
> are about to switch to that task above whose ->fpstate_active we
> set. We enter __switch_to() and do switch_fpu_prepare(). Our task gets
> ->fpregs_active set, we find ourselves back on the call stack below and
> especially in __fpu__restore_sig() which sets ->fpregs_active again.
>
> Leading to that whoops below.
>
> So let's enlarge the preemption-off region so that we set
> ->fpstate_active with preemption disabled and thus not trigger
> fpu.preload:
>
> switch_fpu_prepare
>
> ...
>
> fpu.preload = static_cpu_has(X86_FEATURE_FPU) &&
> new_fpu->fpstate_active &&
> ^^^^^^^^^^^^^^^^^^^^^^
>
> prematurely.
So I'm wondering, why did this commit:
58122bf1d856 x86/fpu: Default eagerfpu=on on all CPUs
trigger the warning, while it never triggered on CPUs that were already
eagerfpu=on for years?
There must be something we are still missing I think.
Thanks,
Ingo
next prev parent reply other threads:[~2016-02-27 12:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87d1rk9str.fsf@yhuang-dev.intel.com>
2016-02-26 7:49 ` [lkp] [x86/fpu] 58122bf1d8: WARNING: CPU: 0 PID: 1 at arch/x86/include/asm/fpu/internal.h:529 fpu__restore+0x28f/0x9ab() Borislav Petkov
2016-02-27 12:02 ` Ingo Molnar [this message]
2016-02-27 13:13 ` Borislav Petkov
2018-11-20 12:05 ` [tip:x86/urgent] x86/fpu: Disable bottom halves while loading FPU registers tip-bot for Sebastian Andrzej Siewior
2018-11-20 16:29 ` tip-bot for Sebastian Andrzej Siewior
2018-11-19 16:04 [PATCH v2] x86/fpu: Disable BH while while loading FPU registers in __fpu__restore_sig() Sebastian Andrzej Siewior
2018-11-19 17:02 ` Dave Hansen
2018-11-19 17:11 ` Sebastian Andrzej Siewior
2018-11-19 17:27 ` Borislav Petkov
2018-11-19 17:31 ` Sebastian Andrzej Siewior
2018-11-19 17:41 ` Borislav Petkov
2018-11-19 17:32 ` Dave Hansen
2018-11-19 18:10 ` Borislav Petkov
2018-11-20 10:26 ` [PATCH v3] " Sebastian Andrzej Siewior
[not found] ` <20181120132531.6E80C206BB@mail.kernel.org>
2018-11-20 18:34 ` [PATCH v2] " Borislav Petkov
[not found] ` <CAMU5Q=72mNG4ikXKpLK3=SiDK3dRXtCw7wpHZ2i==awrtvRwdg@mail.gmail.com>
2018-11-21 10:56 ` Borislav Petkov
[not found] ` <CAMU5Q=5LkypghWA=23YwscaXSx5yBv7LyW1WHbY_J_hQwryNpA@mail.gmail.com>
2018-11-21 12:54 ` Boris 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=20160227120211.GA25164@gmail.com \
--to=mingo@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@01.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=quentin.casasnovas@oracle.com \
--cc=riel@redhat.com \
--cc=sai.praneeth.prakhya@intel.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=ying.huang@linux.intel.com \
--cc=yu-cheng.yu@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).