From: Greg KH <gregkh@linuxfoundation.org>
To: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org, Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: [PATCH 6.1.y] arm64/ptrace: Don't enable SVE when setting streaming SVE
Date: Wed, 9 Aug 2023 11:07:42 +0200 [thread overview]
Message-ID: <2023080934-doorstep-afraid-cb52@gregkh> (raw)
In-Reply-To: <20230807195634.309031-1-broonie@kernel.org>
On Mon, Aug 07, 2023 at 08:56:33PM +0100, Mark Brown wrote:
> Systems which implement SME without also implementing SVE are
> architecturally valid but were not initially supported by the kernel,
> unfortunately we missed one issue in the ptrace code.
>
> The SVE register setting code is shared between SVE and streaming mode
> SVE. When we set full SVE register state we currently enable TIF_SVE
> unconditionally, in the case where streaming SVE is being configured on a
> system that supports vanilla SVE this is not an issue since we always
> initialise enough state for both vector lengths but on a system which only
> support SME it will result in us attempting to restore the SVE vector
> length after having set streaming SVE registers.
>
> Fix this by making the enabling of SVE conditional on setting SVE vector
> state. If we set streaming SVE state and SVE was not already enabled this
> will result in a SVE access trap on next use of normal SVE, this will cause
> us to flush our register state but this is fine since the only way to
> trigger a SVE access trap would be to exit streaming mode which will cause
> the in register state to be flushed anyway.
>
> Fixes: e12310a0d30f ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Cc: stable@vger.kernel.org
> Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-ssve-no-sve-v1-1-49df214bfb3e@kernel.org
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> (cherry picked from commit 045aecdfcb2e060db142d83a0f4082380c465d2c)
> [Fix up backport -- broonie]
> Signed-off-by: Mark Brown <broonie@kernel.org>
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2023-08-09 9:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-07 7:07 FAILED: patch "[PATCH] arm64/ptrace: Don't enable SVE when setting streaming SVE" failed to apply to 6.1-stable tree gregkh
2023-08-07 19:56 ` [PATCH 6.1.y] arm64/ptrace: Don't enable SVE when setting streaming SVE Mark Brown
2023-08-09 9:07 ` Greg KH [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=2023080934-doorstep-afraid-cb52@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=stable@vger.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