lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190412163741.wq2iq44bnvcbne3a@linutronix.de>
Date:   Fri, 12 Apr 2019 18:37:41 +0200
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     Borislav Petkov <bp@...en8.de>
Cc:     linux-kernel@...r.kernel.org, x86@...nel.org,
        Andy Lutomirski <luto@...nel.org>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Radim Krčmář <rkrcmar@...hat.com>,
        kvm@...r.kernel.org, "Jason A. Donenfeld" <Jason@...c4.com>,
        Rik van Riel <riel@...riel.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>
Subject: Re: [PATCH 23/27] x86/fpu: Defer FPU state load until return to
 userspace

On 2019-04-12 18:22:13 [+0200], Borislav Petkov wrote:
> On Fri, Apr 12, 2019 at 05:24:37PM +0200, Sebastian Andrzej Siewior wrote:
> > Isn't it called from fpu__clear()?
> 
> $ git grep trace_x86_fpu_activate_state
> $
> 
> all 23 patches applied. Grepping the later patches doesn't give
> trace_x86_fpu_activate_state() either.
> 
> > > Shouldn't it be called below, before fpregs_activate() because
> > > fpregs_activate() does trace_x86_fpu_regs_activated()?
> > 
> > Why? fpu__initialize() wipes the FPU state and starts from zero.
> > fpregs_mark_activate() on the other hand marks this FPU context is
> > currently active.
> 
> Well, then the naming still needs adjusting.
> 
> "trace_x86_fpu_activate_state" reads to me like the state is being
> activated here, at the call site. And fpregs_mark_activate() marks which
> *fpu is the active one.

bah. You are referring to trace_x86_fpu_activate_state. I parsed this as
fpu__initialize(). Sorry for that.

trace_x86_fpu_activate_state is unused and we should do something about
it.  Adding it to fpregs_mark_activate() seems to make sense.
We we also have this:
 fpregs_mark_activate()
   fpregs_activate()
      trace_x86_fpu_regs_activated()

(as you mentioned) so we would always record both trace points.
Therefore I would suggest to remove it.
Maybe we could add a new one to __fpregs_load_activate() one in case we
avoid loading registers because of fpregs_state_valid(). This might make
sense.

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ