Commit 7d1bf4e0 authored by Marc Zyngier's avatar Marc Zyngier Committed by Christoffer Dall

ARM: hyp-stub: Implement HVC_RESET_VECTORS stub hypercall

Let's define a new stub hypercall that resets the HYP configuration
to its default: hyp-stub vectors, and MMU disabled.

Of course, for the hyp-stub itself, this is a trivial no-op.
Hypervisors will have a bit more work to do.
Tested-by: default avatarKeerthy <j-keerthy@ti.com>
Acked-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarChristoffer Dall <cdall@linaro.org>
parent 4c70cf07
...@@ -101,6 +101,9 @@ extern char __hyp_text_end[]; ...@@ -101,6 +101,9 @@ extern char __hyp_text_end[];
#define HVC_GET_VECTORS 0 #define HVC_GET_VECTORS 0
#define HVC_SET_VECTORS 1 #define HVC_SET_VECTORS 1
#define HVC_SOFT_RESTART 2 #define HVC_SOFT_RESTART 2
#define HVC_RESET_VECTORS 3
#define HVC_STUB_HCALL_NR 4
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
......
...@@ -216,7 +216,10 @@ __hyp_stub_do_trap: ...@@ -216,7 +216,10 @@ __hyp_stub_do_trap:
bne 1f bne 1f
bx r1 bx r1
1: ldr r0, =HVC_STUB_ERR 1: teq r0, #HVC_RESET_VECTORS
beq __hyp_stub_exit
ldr r0, =HVC_STUB_ERR
__hyp_stub_exit: __hyp_stub_exit:
__ERET __ERET
...@@ -264,6 +267,12 @@ ENTRY(__hyp_soft_restart) ...@@ -264,6 +267,12 @@ ENTRY(__hyp_soft_restart)
ret lr ret lr
ENDPROC(__hyp_soft_restart) ENDPROC(__hyp_soft_restart)
ENTRY(__hyp_reset_vectors)
mov r0, #HVC_RESET_VECTORS
__HVC(0)
ret lr
ENDPROC(__hyp_reset_vectors)
#ifndef ZIMAGE #ifndef ZIMAGE
.align 2 .align 2
.L__boot_cpu_mode_offset: .L__boot_cpu_mode_offset:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment