From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: Jerome Forissier <jerome.forissier@linaro.org>
Subject: Re: [PATCH 1/2] hw/arm/boot: Set SME and SVE EL3 vector lengths when booting kernel
Date: Fri, 28 Oct 2022 06:22:49 +1000 [thread overview]
Message-ID: <cab2d7ec-cd0f-a086-3d66-2ce143363a15@linaro.org> (raw)
In-Reply-To: <20221027140207.413084-2-peter.maydell@linaro.org>
On 10/28/22 00:02, Peter Maydell wrote:
> When we direct boot a kernel on a CPU which emulates EL3, we need
> to set up the EL3 system registers as the Linux kernel documentation
> specifies:
> https://www.kernel.org/doc/Documentation/arm64/booting.rst
>
> For SVE and SME this includes:
> - ZCR_EL3.LEN must be initialised to the same value for all CPUs the
> kernel is executed on.
> - SMCR_EL3.LEN must be initialised to the same value for all CPUs the
> kernel will execute on.
>
> Although we are technically compliant with this, the "same value" we
> currently use by default is the reset value of 0. This will end up
> forcing the guest kernel's SVE and SME vector length to be only the
> smallest supported length.
>
> Initialize the vector length fields to their maximum possible value,
> which is 0xf. If the implementation doesn't actually support that
> vector length then the effective vector length will be constrained
> down to the maximum supported value at point of use.
>
> This allows the guest to use all the vector lengths the emulated CPU
> supports (by programming the _EL2 and _EL1 versions of these
> registers.)
>
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
> ---
> hw/arm/boot.c | 2 ++
> 1 file changed, 2 insertions(+)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
next prev parent reply other threads:[~2022-10-27 20:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-27 14:02 [PATCH 0/2] hw/arm/boot.c: Set EL3 HXen, vector lengths when direct booting kernel Peter Maydell
2022-10-27 14:02 ` [PATCH 1/2] hw/arm/boot: Set SME and SVE EL3 vector lengths when " Peter Maydell
2022-10-27 20:22 ` Richard Henderson [this message]
2022-10-27 14:02 ` [PATCH 2/2] hw/arm/boot: Set SCR_EL3.HXEn " Peter Maydell
2022-10-27 20:23 ` Richard Henderson
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=cab2d7ec-cd0f-a086-3d66-2ce143363a15@linaro.org \
--to=richard.henderson@linaro.org \
--cc=jerome.forissier@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).