[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190426165013.mdgd2ocmdgkhja7n@linutronix.de>
Date: Fri, 26 Apr 2019 18:50:14 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Dave Hansen <dave.hansen@...el.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org, jannh@...gle.com,
riel@...riel.com, mingo@...hat.com, bp@...e.de, Jason@...c4.com,
luto@...nel.org, tglx@...utronix.de, rkrcmar@...hat.com,
mingo@...nel.org, hpa@...or.com, kvm@...r.kernel.org,
pbonzini@...hat.com, kurt.kanzenbach@...utronix.de
Subject: Re: [RFC PATCH] x86/fpu: Don't unconditionally add
XFEATURE_MASK_FPSSE on sigentry
On 2019-04-26 09:33:28 [-0700], Dave Hansen wrote:
> On 4/26/19 12:26 AM, Sebastian Andrzej Siewior wrote:
> >> That's just a guess, though.
> >>
> >> If we care, I think we should just use XSAVE instead of XSAVEOPT and
> >> trying to reconstruct the init state in software.
> > We can't use XSAVE directly in the slowpath. We need to reconstruct the
> > init state. We have the mxcsr quirk. We would need just to extend it and
> > set the FP area to init state if the FP state is missing like we do in
> > fpstate_sanitize_xstate().
>
> Can you remind me why we can't use XSAVE directly in the slow path?
Where to?
In the fastpath we XSAVE directly to task's stack. We are in the
slowpath because this failed. Task's FPU-state is using compacted form.
So we use this as source and copy_to_user() to task's stack.
I don't think we can XSAVE to task's FPU-state because the compacted
form may need less memory than the non-compacted form.
Currently I'm leaning towards cleaning the FP area so we behave like
XSAVE does. Independently of that, I would like to revert that commit.
Based on the comment and patch description it does not say that it fixes
a real problem. It *may* fix something.
Sebastian
Powered by blists - more mailing lists