From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Borislav Petkov <bp@alien8.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:15:10 +0100 [thread overview]
Message-ID: <20181204121510.ebw4vb265lcepa2m@linutronix.de> (raw)
In-Reply-To: <20181203220841.GB4794@zn.tnic>
On 2018-12-03 23:08:41 [+0100], Borislav Petkov wrote:
> On Mon, Dec 03, 2018 at 10:12:19PM +0100, Ard Biesheuvel wrote:
> > > + * Using the FPU in hardirq is not allowed.
> >
> > According to the documentation in x86/kernel/fpu/core.c, this is not
> > true. So which one is accurate?
>
> I think you mean the irq from user mode... Yap, we do allow that.
>
> Sebastian?
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.
The FPU could be used in user-context surrounded by kernel_fpu_begin().
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
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().
> Thx.
Sebastian
next prev parent reply other threads:[~2018-12-04 12:15 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 [this message]
2018-12-04 12:33 ` Borislav Petkov
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=20181204121510.ebw4vb265lcepa2m@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=Jason@zx2c4.com \
--cc=ard.biesheuvel@linaro.org \
--cc=bp@alien8.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