Skip to content

Commit dea58da

Browse files
Yicong Yangwilldeacon
authored andcommitted
arm64: Provide basic EL2 setup for FEAT_{LS64, LS64_V} usage at EL0/1
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. Acked-by: Will Deacon <will@kernel.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Oliver Upton <oupton@kernel.org> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com> Signed-off-by: Will Deacon <will@kernel.org>
1 parent 2937aee commit dea58da

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

arch/arm64/include/asm/el2_setup.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,19 @@
8383
/* Enable GCS if supported */
8484
mrs_s x1, SYS_ID_AA64PFR1_EL1
8585
ubfx x1, x1, #ID_AA64PFR1_EL1_GCS_SHIFT, #4
86-
cbz x1, .Lset_hcrx_\@
86+
cbz x1, .Lskip_gcs_hcrx_\@
8787
orr x0, x0, #HCRX_EL2_GCSEn
8888

89+
.Lskip_gcs_hcrx_\@:
90+
/* Enable LS64, LS64_V if supported */
91+
mrs_s x1, SYS_ID_AA64ISAR1_EL1
92+
ubfx x1, x1, #ID_AA64ISAR1_EL1_LS64_SHIFT, #4
93+
cbz x1, .Lset_hcrx_\@
94+
orr x0, x0, #HCRX_EL2_EnALS
95+
cmp x1, #ID_AA64ISAR1_EL1_LS64_LS64_V
96+
b.lt .Lset_hcrx_\@
97+
orr x0, x0, #HCRX_EL2_EnASR
98+
8999
.Lset_hcrx_\@:
90100
msr_s SYS_HCRX_EL2, x0
91101
.Lskip_hcrx_\@:

0 commit comments

Comments
 (0)