From: Will Deacon <will@kernel.org>
To: Yicong Yang <yangyicong@huawei.com>
Cc: catalin.marinas@arm.com, maz@kernel.org, oliver.upton@linux.dev,
corbet@lwn.net, linux-arm-kernel@lists.infradead.org,
kvmarm@lists.linux.dev, linux-kselftest@vger.kernel.org,
linux-doc@vger.kernel.org, joey.gouly@arm.com,
suzuki.poulose@arm.com, yuzenghui@huawei.com, shuah@kernel.org,
jonathan.cameron@huawei.com,
shameerali.kolothum.thodi@huawei.com, linuxarm@huawei.com,
prime.zeng@hisilicon.com, xuwei5@huawei.com,
yangyicong@hisilicon.com, tangchengchang@huawei.com,
wangzhou1@hisilicon.com
Subject: Re: [PATCH v4 4/7] arm64: Provide basic EL2 setup for FEAT_{LS64, LS64_V} usage at EL0/1
Date: Mon, 8 Sep 2025 12:48:52 +0100 [thread overview]
Message-ID: <aL7CpFHAQ2mX2E2U@willie-the-truck> (raw)
In-Reply-To: <20250715081356.12442-5-yangyicong@huawei.com>
On Tue, Jul 15, 2025 at 04:13:53PM +0800, Yicong Yang wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
>
> Instructions introduced by FEAT_{LS64, LS64_V} is controlled by
> HCRX_EL2.{EnALS, EnASR}. Configure all of these to allow usage
> at EL0/1.
>
> This doesn't mean these instructions are always available in
> EL0/1 if provided. The hypervisor still have the control at
> runtime.
>
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
> ---
> arch/arm64/include/asm/el2_setup.h | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/include/asm/el2_setup.h b/arch/arm64/include/asm/el2_setup.h
> index 9f38340d24c2..46e085af7c98 100644
> --- a/arch/arm64/include/asm/el2_setup.h
> +++ b/arch/arm64/include/asm/el2_setup.h
> @@ -57,9 +57,19 @@
> /* Enable GCS if supported */
> mrs_s x1, SYS_ID_AA64PFR1_EL1
> ubfx x1, x1, #ID_AA64PFR1_EL1_GCS_SHIFT, #4
> - cbz x1, .Lset_hcrx_\@
> + cbz x1, .Lskip_gcs_hcrx_\@
> orr x0, x0, #HCRX_EL2_GCSEn
>
> +.Lskip_gcs_hcrx_\@:
> + /* Enable LS64, LS64_V if supported */
> + mrs_s x1, SYS_ID_AA64ISAR1_EL1
> + ubfx x1, x1, #ID_AA64ISAR1_EL1_LS64_SHIFT, #4
> + cbz x1, .Lset_hcrx_\@
> + orr x0, x0, #HCRX_EL2_EnALS
> + cmp x1, #ID_AA64ISAR1_EL1_LS64_LS64_V
> + b.lt .Lset_hcrx_\@
> + orr x0, x0, #HCRX_EL2_EnASR
> +
Acked-by: Will Deacon <will@kernel.org>
Will
next prev parent reply other threads:[~2025-09-08 12:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-15 8:13 [PATCH v4 0/7] Add support for FEAT_{LS64, LS64_V} and related tests Yicong Yang
2025-07-15 8:13 ` [PATCH v4 1/7] KVM: arm64: Add exit to userspace on {LD,ST}64B* outside of memslots Yicong Yang
2025-07-15 8:13 ` [PATCH v4 2/7] KVM: arm64: Add documentation for KVM_EXIT_ARM_LDST64B Yicong Yang
2025-07-15 8:13 ` [PATCH v4 3/7] KVM: arm64: Handle DABT caused by LS64* instructions on unsupported memory Yicong Yang
2025-07-15 8:13 ` [PATCH v4 4/7] arm64: Provide basic EL2 setup for FEAT_{LS64, LS64_V} usage at EL0/1 Yicong Yang
2025-09-08 11:48 ` Will Deacon [this message]
2025-07-15 8:13 ` [PATCH v4 5/7] arm64: Add support for FEAT_{LS64, LS64_V} Yicong Yang
2025-09-08 12:01 ` Will Deacon
2025-09-09 1:48 ` Yicong Yang
2025-09-11 15:50 ` Will Deacon
2025-09-12 13:47 ` Jonathan Cameron
2025-09-15 8:29 ` Yicong Yang
2025-09-16 14:56 ` Catalin Marinas
2025-09-17 3:51 ` Yicong Yang
2025-09-17 4:00 ` Yicong Yang
2025-09-17 14:20 ` Catalin Marinas
2025-09-18 9:09 ` Yicong Yang
2025-07-15 8:13 ` [PATCH v4 6/7] KVM: arm64: Enable FEAT_{LS64, LS64_V} in the supported guest Yicong Yang
2025-07-15 8:13 ` [PATCH v4 7/7] kselftest/arm64: Add HWCAP test for FEAT_{LS64, LS64_V} Yicong Yang
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=aL7CpFHAQ2mX2E2U@willie-the-truck \
--to=will@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=joey.gouly@arm.com \
--cc=jonathan.cameron@huawei.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=prime.zeng@hisilicon.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=shuah@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=tangchengchang@huawei.com \
--cc=wangzhou1@hisilicon.com \
--cc=xuwei5@huawei.com \
--cc=yangyicong@hisilicon.com \
--cc=yangyicong@huawei.com \
--cc=yuzenghui@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox