From: Catalin Marinas <catalin.marinas@arm.com>
To: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>, Julien Grall <julien@xen.org>,
Zhang Lei <zhang.lei@jp.fujitsu.com>,
Dave Martin <Dave.Martin@arm.com>,
Daniel Kiss <Daniel.Kiss@arm.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64/sve: Rework SVE access trap to convert state in registers
Date: Thu, 8 Apr 2021 17:43:27 +0100 [thread overview]
Message-ID: <20210408164327.GB7676@arm.com> (raw)
In-Reply-To: <20210407124806.GC5510@sirena.org.uk>
On Wed, Apr 07, 2021 at 01:48:06PM +0100, Mark Brown wrote:
> On Wed, Apr 07, 2021 at 12:45:12PM +0100, Catalin Marinas wrote:
> > The other case is TIF_FOREIGN_FPSTATE being set in do_sve_acc(). Since
> > we never return to user with this flag set, when can we actually hit the
> > 'else' path in your patch?
>
> We'd have to have been preempted between entering the kernel and
> actually handling the access trap, I can't think of a scenario where
> that would happen but it seemed easier to have the code to handle it
> than to make absolutely sure that there was no possible case that I was
> missing. I think we should have the detection code either way in case
> it does end up happening somehow but it could be changed to use
> WARN_ON_ONCE() or something instead of silently handling it?
If we get preempted before do_sve_acc() (and that's possible as the
interrupts are enabled), if the interrupted thread wakes up on another
CPU it will have TIF_FOREIGN_FPSTATE set so that it retrieves the new
state.
So the patch looks fine to me.
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-04-08 16:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-12 19:03 [PATCH] arm64/sve: Rework SVE access trap to convert state in registers Mark Brown
2021-04-07 11:45 ` Catalin Marinas
2021-04-07 12:48 ` Mark Brown
2021-04-07 15:55 ` Mark Brown
2021-04-08 16:43 ` Catalin Marinas [this message]
2021-04-08 18:00 ` Catalin Marinas
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=20210408164327.GB7676@arm.com \
--to=catalin.marinas@arm.com \
--cc=Daniel.Kiss@arm.com \
--cc=Dave.Martin@arm.com \
--cc=broonie@kernel.org \
--cc=julien@xen.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=will@kernel.org \
--cc=zhang.lei@jp.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.