From: Peter Zijlstra <peterz@infradead.org>
To: Russell King - ARM Linux <linux@armlinux.org.uk>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Mark Rutland <mark.rutland@arm.com>,
linux-rt-users@vger.kernel.org, ard.biesheuvel@linaro.org,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
linux-kernel@vger.kernel.org,
Steven Rostedt <rostedt@goodmis.org>,
tglx@linutronix.de, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH RT] arm*: disable NEON in kernel mode
Date: Fri, 1 Dec 2017 18:39:43 +0100 [thread overview]
Message-ID: <20171201173943.5mnr7zkr4axxgpfx@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20171201173120.GL10595@n2100.armlinux.org.uk>
On Fri, Dec 01, 2017 at 05:31:20PM +0000, Russell King - ARM Linux wrote:
> On Fri, Dec 01, 2017 at 06:14:58PM +0100, Peter Zijlstra wrote:
> > Well, PREEMPT cares about that too.
>
> Preempt may care, but it's the hit you take to use neon in the kernel.
> The neon register set shares with the FPU, so preempting during that
> path means that the normal FPU register saving would corrupt the
> already saved user FPU context - and even worse would result in the
> kernel's crypto function register contents being leaked to userspace.
Same thing on x86.
> If you care about preempt deeply, the only solution is to avoid using
> kernel mode neon.
Not quite, you can write the code such that it drops out of neon mode
regularly to allow preemption.
So setup a crypto block, enter neon, transform the block, drop out of
neon, rinse repeat.
next prev parent reply other threads:[~2017-12-01 17:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-30 14:22 [PATCH RT] crypto: limit more FPU-enabled sections Sebastian Andrzej Siewior
2017-11-30 14:30 ` Sebastian Andrzej Siewior
2017-12-01 10:43 ` [PATCH RT] arm*: disable NEON in kernel mode Sebastian Andrzej Siewior
2017-12-01 13:45 ` Sebastian Andrzej Siewior
2017-12-01 14:18 ` Mark Rutland
2017-12-01 14:36 ` Sebastian Andrzej Siewior
2017-12-01 15:03 ` Ard Biesheuvel
2017-12-01 17:58 ` Dave Martin
2017-12-01 18:08 ` Russell King - ARM Linux
2017-12-01 18:24 ` Dave Martin
2017-12-01 19:20 ` Ard Biesheuvel
2017-12-04 9:21 ` Sebastian Andrzej Siewior
2017-12-01 17:14 ` Peter Zijlstra
2017-12-01 17:31 ` Russell King - ARM Linux
2017-12-01 17:39 ` Peter Zijlstra [this message]
2017-11-30 15:19 ` [PATCH RT] crypto: limit more FPU-enabled sections Steven Rostedt
2017-11-30 15:22 ` Sebastian Andrzej Siewior
2017-12-01 10:44 ` [PATCH RT v2] " Sebastian Andrzej Siewior
2017-12-01 11:32 ` Peter Zijlstra
2017-12-01 13:32 ` Sebastian Andrzej Siewior
2017-12-01 13:44 ` Peter Zijlstra
2017-12-01 13:50 ` Sebastian Andrzej Siewior
2017-12-01 14:03 ` [PATCH RT v3] " Sebastian Andrzej Siewior
2017-11-30 15:29 ` [PATCH RT] " Steven Rostedt
2017-11-30 15:41 ` Sebastian Andrzej Siewior
2017-11-30 16:18 ` Steven Rostedt
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=20171201173943.5mnr7zkr4axxgpfx@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ard.biesheuvel@linaro.org \
--cc=bigeasy@linutronix.de \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mark.rutland@arm.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=will.deacon@arm.com \
/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;
as well as URLs for NNTP newsgroup(s).