From: Andrew Jones <andrew.jones@linux.dev>
To: Joey Gouly <joey.gouly@arm.com>
Cc: kvm@vger.kernel.org, alexandru.elisei@arm.com,
eric.auger@redhat.com, maz@kernel.org, kvmarm@lists.linux.dev,
Oliver Upton <oliver.upton@linux.dev>
Subject: Re: [kvm-unit-tests PATCH v4 01/11] arm64: set SCTLR_EL1 to a known value for secondary cores
Date: Thu, 4 Dec 2025 09:58:06 -0600 [thread overview]
Message-ID: <20251204-9af4476a5331949ba55baee8@orel> (raw)
In-Reply-To: <20251204142338.132483-2-joey.gouly@arm.com>
On Thu, Dec 04, 2025 at 02:23:28PM +0000, Joey Gouly wrote:
> This ensures that primary and secondary cores will have the same values for
> SCTLR_EL1.
This almost deserves
Fixes: 10b65ce77ae7 ("arm64: Configure SCTLR_EL1 at boot")
>
> Signed-off-by: Joey Gouly <joey.gouly@arm.com>
> ---
> arm/cstart64.S | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arm/cstart64.S b/arm/cstart64.S
> index 014c9c7b..dcdd1516 100644
> --- a/arm/cstart64.S
> +++ b/arm/cstart64.S
> @@ -185,6 +185,11 @@ get_mmu_off:
>
> .globl secondary_entry
> secondary_entry:
> + /* set SCTLR_EL1 to a known value */
> + ldr x0, =INIT_SCTLR_EL1_MMU_OFF
> + msr sctlr_el1, x0
> + isb
It's indeed good practice to always follow msr with isb. In the past we've
been lazy and allowed subsequent msr writes before issuing the isb when we
knew it'd be issued before it's necessary, e.g. the cpacr_el1 write which
piggybacks on the isb in exceptions_init. But, since that's fragile, I
like the isb here and would even like to see the isb added to cpacr_el1,
and anywhere else we're currently neglecting it, done with a separate
patch.
> +
> /* enable FP/ASIMD and SVE */
> mov x0, #(3 << 20)
> orr x0, x0, #(3 << 16)
> --
> 2.25.1
>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Thanks,
drew
next prev parent reply other threads:[~2025-12-04 15:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-04 14:23 [kvm-unit-tests PATCH v4 00/11] arm64: EL2 support Joey Gouly
2025-12-04 14:23 ` [kvm-unit-tests PATCH v4 01/11] arm64: set SCTLR_EL1 to a known value for secondary cores Joey Gouly
2025-12-04 15:58 ` Andrew Jones [this message]
2025-12-04 14:23 ` [kvm-unit-tests PATCH v4 02/11] arm64: drop to EL1 if booted at EL2 Joey Gouly
2025-12-04 14:23 ` [kvm-unit-tests PATCH v4 03/11] arm64: efi: initialise SCTLR_ELx fully Joey Gouly
2025-12-04 14:23 ` [kvm-unit-tests PATCH v4 04/11] arm64: efi: initialise the EL Joey Gouly
2025-12-04 14:23 ` [kvm-unit-tests PATCH v4 05/11] arm64: timer: use hypervisor timers when at EL2 Joey Gouly
2025-12-04 14:23 ` [kvm-unit-tests PATCH v4 06/11] arm64: micro-bench: fix timer IRQ Joey Gouly
2025-12-04 14:23 ` [kvm-unit-tests PATCH v4 07/11] arm64: micro-bench: use smc when at EL2 Joey Gouly
2025-12-04 14:23 ` [kvm-unit-tests PATCH v4 08/11] arm64: selftest: update test for running " Joey Gouly
2025-12-04 17:09 ` Andrew Jones
2025-12-04 14:23 ` [kvm-unit-tests PATCH v4 09/11] arm64: pmu: count EL2 cycles Joey Gouly
2025-12-04 14:23 ` [kvm-unit-tests PATCH v4 10/11] arm64: run at EL2 if supported Joey Gouly
2025-12-04 14:23 ` [kvm-unit-tests PATCH v4 11/11] arm64: add EL2 environment variable Joey Gouly
2025-12-04 17:17 ` Andrew Jones
2025-12-12 16:03 ` Joey Gouly
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=20251204-9af4476a5331949ba55baee8@orel \
--to=andrew.jones@linux.dev \
--cc=alexandru.elisei@arm.com \
--cc=eric.auger@redhat.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
/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