[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c0177f20d14bd607b8293a802bb16782fae5113d.camel@intel.com>
Date: Wed, 29 Apr 2020 09:09:12 -0700
From: Yu-cheng Yu <yu-cheng.yu@...el.com>
To: Borislav Petkov <bp@...en8.de>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Tony Luck <tony.luck@...el.com>,
Andy Lutomirski <luto@...nel.org>,
Rik van Riel <riel@...riel.com>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Fenghua Yu <fenghua.yu@...el.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v3 05/10] x86/fpu/xstate: Define new functions for
clearing fpregs and xstates
On Wed, 2020-04-29 at 11:27 +0200, Borislav Petkov wrote:
> On Sat, Mar 28, 2020 at 09:43:02AM -0700, Yu-cheng Yu wrote:
> > @@ -318,18 +313,40 @@ static inline void copy_init_fpstate_to_fpregs(void)
> > * Called by sys_execve(), by the signal handler code and by various
> > * error paths.
> > */
> > -void fpu__clear(struct fpu *fpu)
> > +static void fpu__clear(struct fpu *fpu, int clear_user_only)
>
> I said:
>
> "fpu__clear(struct fpu *fpu, bool user_only)"
> ^^^^^^^^^^^^^^
>
> you made it
>
> ..., int clear_user_only)
>
> Why?
>
> If you agree with the review comment, then please do it as suggested. If
> you don't, then say why you don't.
>
> Why would you do something in-between?
>
> > {
> > - WARN_ON_FPU(fpu != ¤t->thread.fpu); /* Almost certainly an anomaly */
>
> Why are you moving this into the callers when *both* do it?
>
> > + if (static_cpu_has(X86_FEATURE_FPU)) {
>
> Flip this logic:
>
> if (!static_cpu_has(X86_FEATURE_FPU)) {
> fpu__drop(fpu);
> fpu__initialize(fpu);
> return;
> }
>
> fpregs_lock();
> ...
>
> to save an indentation level and make the important case more readable
> and locking more prominent.
All fixed.
Thanks,
Yu-cheng
Powered by blists - more mailing lists