Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [boot-wrapper PATCH] aarch64: enable access to HCRX_EL2
@ 2022-09-27 14:23 Kristina Martsenko
  2022-09-30 13:25 ` Mark Rutland
  0 siblings, 1 reply; 2+ messages in thread
From: Kristina Martsenko @ 2022-09-27 14:23 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Mark Rutland

Allow EL2 to access the HCRX_EL2 register which provides hypervisor
controls similarly to HCR_EL2.

Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
---
 arch/aarch64/include/asm/cpu.h | 3 +++
 arch/aarch64/init.c            | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/arch/aarch64/include/asm/cpu.h b/arch/aarch64/include/asm/cpu.h
index 69dfcd5..d063948 100644
--- a/arch/aarch64/include/asm/cpu.h
+++ b/arch/aarch64/include/asm/cpu.h
@@ -49,6 +49,7 @@
 #define SCR_EL3_FGTEN			BIT(27)
 #define SCR_EL3_ECVEN			BIT(28)
 #define SCR_EL3_TME			BIT(34)
+#define SCR_EL3_HXEn			BIT(38)
 #define SCR_EL3_EnTP2			BIT(41)
 
 #define HCR_EL2_RES1			BIT(1)
@@ -70,6 +71,8 @@
 #define ID_AA64MMFR0_EL1_FGT		BITS(59, 56)
 #define ID_AA64MMFR0_EL1_ECV		BITS(63, 60)
 
+#define ID_AA64MMFR1_EL1_HCX		BITS(43, 40)
+
 #define ID_AA64PFR1_EL1_MTE		BITS(11, 8)
 #define ID_AA64PFR1_EL1_SME		BITS(27, 24)
 #define ID_AA64PFR0_EL1_SVE		BITS(35, 32)
diff --git a/arch/aarch64/init.c b/arch/aarch64/init.c
index db73b58..471e234 100644
--- a/arch/aarch64/init.c
+++ b/arch/aarch64/init.c
@@ -61,6 +61,9 @@ void cpu_init_el3(void)
 	if (mrs_field(ID_AA64MMFR0_EL1, ECV) >= 2)
 		scr |= SCR_EL3_ECVEN;
 
+	if (mrs_field(ID_AA64MMFR1_EL1, HCX))
+		scr |= SCR_EL3_HXEn;
+
 	if (mrs_field(ID_AA64PFR1_EL1, MTE) >= 2)
 		scr |= SCR_EL3_ATA;
 

base-commit: 6a0fc40035f9bb581054eb26fbac3c659cfa99b2
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-30 13:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-27 14:23 [boot-wrapper PATCH] aarch64: enable access to HCRX_EL2 Kristina Martsenko
2022-09-30 13:25 ` Mark Rutland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox