From: Borislav Petkov <bp@alien8.de>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: "Ard Biesheuvel" <ard.biesheuvel@linaro.org>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
"Ingo Molnar" <mingo@redhat.com>,
"the arch/x86 maintainers" <x86@kernel.org>,
nstange@suse.de, "Rik van Riel" <riel@surriel.com>,
"KVM devel mailing list" <kvm@vger.kernel.org>,
"Jason A. Donenfeld" <Jason@zx2c4.com>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Ingo Molnar" <mingo@kernel.org>,
"Radim Krčmář" <rkrcmar@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Andy Lutomirski" <luto@kernel.org>,
"Borislav Petkov" <bp@suse.de>,
linux-efi <linux-efi@vger.kernel.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
linux-tip-commits@vger.kernel.org
Subject: Re: [tip:x86/fpu] x86/fpu: Don't export __kernel_fpu_{begin,end}()
Date: Tue, 4 Dec 2018 13:33:55 +0100 [thread overview]
Message-ID: <20181204123355.GD11803@zn.tnic> (raw)
In-Reply-To: <20181204121510.ebw4vb265lcepa2m@linutronix.de>
On Tue, Dec 04, 2018 at 01:15:10PM +0100, Sebastian Andrzej Siewior wrote:
> Do you refer to
> | * - by IRQ context code to potentially use the FPU
> | * if it's unused.
>
> ? It is possible to use the FPU in IRQ context.
I mean interrupted_user_mode() where we apparently can use the FPU when
handling an IRQ from user mode.
> The FPU could be used in user-context surrounded by kernel_fpu_begin().
Right, that.
> This only disables preemption so an IRQ could interrupt it. This IRQ
> could then use the FPU or raise a SoftIRQ which would use it.
> Therefore on x86 it is required to check with irq_fpu_usable() if the
Yes, and the check that thing does is:
return !in_interrupt() ||
interrupted_user_mode() || ...
so you're either *not* in interrupt, or you've gotten the IRQ while in
user mode.
> FPU can be used. If the FPU can not be used, you have to implement
> fallback code.
>
> With the "restore FPU on return to userland" series we need to modify
> the FPU in a few places. The softirq and preemption is disabled. I
> didn't find any in-IRQ users.
> Going forward I would like to remove the in-IRQ part and
> irq_fpu_usable() and disable softirq as part of kernel_fpu_begin().
Right, and we should document all those new conditions prominently so
that people are aware.
Thx.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
next prev parent reply other threads:[~2018-12-04 12:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20181129150210.2k4mawt37ow6c2vq@linutronix.de>
2018-12-03 21:04 ` [tip:x86/fpu] x86/fpu: Don't export __kernel_fpu_{begin,end}() tip-bot for Sebastian Andrzej Siewior
2018-12-03 21:12 ` Ard Biesheuvel
2018-12-03 22:08 ` Borislav Petkov
2018-12-04 11:39 ` Borislav Petkov
2018-12-04 12:15 ` Sebastian Andrzej Siewior
2018-12-04 12:33 ` Borislav Petkov [this message]
2018-12-04 11:45 ` tip-bot for Sebastian Andrzej Siewior
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=20181204123355.GD11803@zn.tnic \
--to=bp@alien8.de \
--cc=Jason@zx2c4.com \
--cc=ard.biesheuvel@linaro.org \
--cc=bigeasy@linutronix.de \
--cc=bp@suse.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=nstange@suse.de \
--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