mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org, jannh@google.com,
	riel@surriel.com, mingo@redhat.com, bp@suse.de, Jason@zx2c4.com,
	luto@kernel.org, tglx@linutronix.de, rkrcmar@redhat.com,
	mingo@kernel.org, hpa@zytor.com, kvm@vger.kernel.org,
	pbonzini@redhat.com, kurt.kanzenbach@linutronix.de
Subject: Re: [RFC PATCH] x86/fpu: Don't unconditionally add XFEATURE_MASK_FPSSE on sigentry
Date: Fri, 26 Apr 2019 13:44:14 -0700	[thread overview]
Message-ID: <87871e60-4e64-2355-11b4-6201cab8bf75@intel.com> (raw)
In-Reply-To: <20190426200509.3q5ngl44o64q2lg2@linutronix.de>

On 4/26/19 1:05 PM, Sebastian Andrzej Siewior wrote:
> 
> copy_fpstate_to_sigframe()
>  |
>  copy_fpregs_to_sigframe() fails.
>  |
>  using_compacted_format()

Aw, crud.  I was looking at Linus's tree.  Sorry about that.  In Linus's
tree, if copy_fpregs_to_sigframe() fails, we just return from
copy_fpstate_to_sigframe() immediately.  In other words, either XSAVE
works, and we don't have this issue, or XSAVE fails and we don't do the
fixup code in question.

I'll say it again, though: I think we should be using the XSAVE
instruction to save this state.  If we need to map some pages in order
to make XSAVE work, then I think we should bring some pages in and we
can do *that* in the slow path.  We can even do that without taking page
faults by just calling get_user_pages() for instance.

Or, the slow path could be to fpregs_unlock(), zero the user area
(taking and handling page faults), then fpregs_lock() and retry the
copy_fpregs_to_sigframe().

  reply	other threads:[~2019-04-26 20:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-25 17:35 Sebastian Andrzej Siewior
2019-04-25 21:13 ` Dave Hansen
2019-04-26  7:26   ` Sebastian Andrzej Siewior
2019-04-26 16:33     ` Dave Hansen
2019-04-26 16:50       ` Sebastian Andrzej Siewior
2019-04-26 19:04         ` Dave Hansen
2019-04-26 20:05           ` Sebastian Andrzej Siewior
2019-04-26 20:44             ` Dave Hansen [this message]
2019-04-29 16:39               ` [PATCH] x86/fpu: Fault-in user stack if copy_fpstate_to_sigframe() fails Sebastian Andrzej Siewior
2019-04-29 18:52                 ` [tip:x86/fpu] " tip-bot for Sebastian Andrzej Siewior
2019-04-30 14:20                   ` Dave Hansen

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=87871e60-4e64-2355-11b4-6201cab8bf75@intel.com \
    --to=dave.hansen@intel.com \
    --cc=Jason@zx2c4.com \
    --cc=bigeasy@linutronix.de \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=jannh@google.com \
    --cc=kurt.kanzenbach@linutronix.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=riel@surriel.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

Powered by JetHome