From: Mark Brown <broonie@kernel.org>
To: Dave Martin <Dave.Martin@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/6] arm64/signal: Consistently invalidate the in register FP state in restore
Date: Tue, 3 Dec 2024 16:53:11 +0000 [thread overview]
Message-ID: <f9e297ab-8325-4b48-b8fc-21486ff48cd2@sirena.org.uk> (raw)
In-Reply-To: <Z08k6QsYRzO8+O4t@e133380.arm.com>
[-- Attachment #1: Type: text/plain, Size: 1754 bytes --]
On Tue, Dec 03, 2024 at 03:34:01PM +0000, Dave Martin wrote:
> On Tue, Dec 03, 2024 at 12:45:56PM +0000, Mark Brown wrote:
> > When restoring the SVE and SME specific floating point register states we
> > flush the task floating point state, marking the hardware state as stale so
> > that preemption does not result in us saving register state from the signal
Now I think about it again this should probably be dropped from the
series, or at least ordered after the reenablement.
> > + * thread floating point state with preemption enabled, so
> > + * protection is needed to prevent a racing context switch
> > + * from writing stale registers back over the new data. Mark
> > + * the register floating point state as invalid and unbind the
> > + * task from the CPU to force a reload before we return to
> > + * userspace. fpsimd_flush_task_state() has a check for FP
> > + * support.
> > + */
> Maybe add a comment in fpsimd_flush_task_state() about why the
> system_supports_fpsimd() check is important? It's not obvious there
> why we should ever be calling that function on non-FPSIMD systems.
There already is a comment in there about it?
> But would it be a good idea to stick a
> WARN_ON(!test_thread_flag(TIF_FOREIGN_FPSTATE)) at the start of the
> functions that rely on this?
As I mentioned in reply to one of your other messages I want to just gut
the whole API here and replace it with get/put functions for the state
which would include the get/put functions making sure they're paired
with each other.
Please delete unneeded context from mails when replying. Doing this
makes it much easier to find your reply in the message, helping ensure
it won't be missed by people scrolling through the irrelevant quoted
material.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2024-12-03 16:53 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-03 12:45 [PATCH 0/6] arm64/sme: Collected SME fixes Mark Brown
2024-12-03 12:45 ` [PATCH 1/6] arm64/sme: Flush foreign register state in do_sme_acc() Mark Brown
2024-12-03 15:32 ` Dave Martin
2024-12-03 16:00 ` Mark Brown
2024-12-03 17:00 ` Dave Martin
2024-12-03 17:24 ` Mark Brown
2024-12-04 11:33 ` Dave Martin
2024-12-03 12:45 ` [PATCH 2/6] arm64/fp: Don't corrupt FPMR when streaming mode changes Mark Brown
2024-12-03 12:45 ` [PATCH 3/6] arm64/ptrace: Zero FPMR on streaming mode entry/exit Mark Brown
2024-12-03 12:45 ` [PATCH 4/6] arm64/signal: Consistently invalidate the in register FP state in restore Mark Brown
2024-12-03 15:34 ` Dave Martin
2024-12-03 16:53 ` Mark Brown [this message]
2024-12-03 17:06 ` Dave Martin
2024-12-03 12:45 ` [PATCH 5/6] arm64/signal: Avoid corruption of SME state when entering signal handler Mark Brown
2024-12-03 15:33 ` Dave Martin
2024-12-03 16:12 ` Mark Brown
2024-12-03 17:10 ` Dave Martin
2024-12-03 12:45 ` [PATCH 6/6] arm64/sme: Reenable SME Mark Brown
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=f9e297ab-8325-4b48-b8fc-21486ff48cd2@sirena.org.uk \
--to=broonie@kernel.org \
--cc=Dave.Martin@arm.com \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=will@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
all inboxes | Powered by JetHome®