From: Will Deacon <will@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] arm64/signal: Clean up SVE/SME feature checking inconsistency
Date: Fri, 24 Jun 2022 17:57:04 +0100 [thread overview]
Message-ID: <20220624165704.GA19442@willie-the-truck> (raw)
In-Reply-To: <20220624134415.343417-1-broonie@kernel.org>
On Fri, Jun 24, 2022 at 02:44:14PM +0100, Mark Brown wrote:
> Currently when restoring signal state we check to see if SVE is supported
> in restore_sigframe() but check to see if SVE is supported inside
> restore_sve_fpsimd_context(). This makes no real difference since SVE is
> always supported in systems with SME but looks a bit untidy and makes
> things slightly harder to follow, move the SVE check next to the SME one
> in restore_sve_fpsimd_context().
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>
> v2:
> - Add a stub restore_sve_fpsimd_context() to hopefully fix an
> allnoconfig issue, I can't reproduce locally.
>
> arch/arm64/kernel/signal.c | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
> index b0980fbb6bc7..6b6a79806e82 100644
> --- a/arch/arm64/kernel/signal.c
> +++ b/arch/arm64/kernel/signal.c
> @@ -280,6 +280,9 @@ static int restore_sve_fpsimd_context(struct user_ctxs *user)
>
> vl = task_get_sme_vl(current);
> } else {
> + if (!system_supports_sve())
> + return -EINVAL;
> +
> vl = task_get_sve_vl(current);
> }
>
> @@ -342,9 +345,13 @@ static int restore_sve_fpsimd_context(struct user_ctxs *user)
>
> #else /* ! CONFIG_ARM64_SVE */
>
> -/* Turn any non-optimised out attempts to use these into a link error: */
> +static int restore_sve_fpsimd_context(struct user_ctxs *user)
> +{
> + return 0;
> +}
Given that this should never be called, should we return an error instead
of 0 (or possibly even WARN/BUG)?
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2022-06-24 16:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 13:44 [PATCH v2] arm64/signal: Clean up SVE/SME feature checking inconsistency Mark Brown
2022-06-24 16:57 ` Will Deacon [this message]
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=20220624165704.GA19442@willie-the-truck \
--to=will@kernel.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.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