summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/virt.h
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2021-02-08 12:57:13 +0300
committerWill Deacon <will@kernel.org>2021-02-08 15:51:26 +0300
commitf359182291c757cdf77bcd014c025d1ed6b87662 (patch)
tree88e93ba8771d6402f50b66cc0888543262f9870e /arch/arm64/include/asm/virt.h
parent8cc8a32415364e475c25277b507f06f67c47ca9a (diff)
downloadlinux-f359182291c757cdf77bcd014c025d1ed6b87662.tar.xz
arm64: Provide an 'upgrade to VHE' stub hypercall
As we are about to change the way a VHE system boots, let's provide the core helper, in the form of a stub hypercall that enables VHE and replicates the full EL1 context at EL2, thanks to EL1 and VHE-EL2 being extremely similar. On exception return, the kernel carries on at EL2. Fancy! Nothing calls this new hypercall yet, so no functional change. Signed-off-by: Marc Zyngier <maz@kernel.org> Acked-by: David Brazdil <dbrazdil@google.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Link: https://lore.kernel.org/r/20210208095732.3267263-5-maz@kernel.org Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/virt.h')
-rw-r--r--arch/arm64/include/asm/virt.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h
index ee6a48df89d9..7379f35ae2c6 100644
--- a/arch/arm64/include/asm/virt.h
+++ b/arch/arm64/include/asm/virt.h
@@ -35,8 +35,13 @@
*/
#define HVC_RESET_VECTORS 2
+/*
+ * HVC_VHE_RESTART - Upgrade the CPU from EL1 to EL2, if possible
+ */
+#define HVC_VHE_RESTART 3
+
/* Max number of HYP stub hypercalls */
-#define HVC_STUB_HCALL_NR 3
+#define HVC_STUB_HCALL_NR 4
/* Error returned when an invalid stub number is passed into x0 */
#define HVC_STUB_ERR 0xbadca11