Commit 4adb1341 authored by Marc Zyngier's avatar Marc Zyngier Committed by Christoffer Dall

arm64: KVM: Convert __cpu_reset_hyp_mode to using __hyp_reset_vectors

We are now able to use the hyp stub to reset HYP mode. Time to
kiss __kvm_hyp_reset goodbye, and use __hyp_reset_vectors.
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Reviewed-by: default avatarJames Morse <james.morse@arm.com>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarChristoffer Dall <cdall@linaro.org>
parent 5fbe9a59
...@@ -47,7 +47,6 @@ struct kvm_vcpu; ...@@ -47,7 +47,6 @@ struct kvm_vcpu;
extern char __kvm_hyp_init[]; extern char __kvm_hyp_init[];
extern char __kvm_hyp_init_end[]; extern char __kvm_hyp_init_end[];
extern char __kvm_hyp_reset[];
extern char __kvm_hyp_vector[]; extern char __kvm_hyp_vector[];
......
...@@ -362,11 +362,10 @@ static inline void __cpu_init_hyp_mode(phys_addr_t pgd_ptr, ...@@ -362,11 +362,10 @@ static inline void __cpu_init_hyp_mode(phys_addr_t pgd_ptr,
__kvm_call_hyp((void *)pgd_ptr, hyp_stack_ptr, vector_ptr); __kvm_call_hyp((void *)pgd_ptr, hyp_stack_ptr, vector_ptr);
} }
void __kvm_hyp_teardown(void);
static inline void __cpu_reset_hyp_mode(unsigned long vector_ptr, static inline void __cpu_reset_hyp_mode(unsigned long vector_ptr,
phys_addr_t phys_idmap_start) phys_addr_t phys_idmap_start)
{ {
kvm_call_hyp(__kvm_hyp_teardown, phys_idmap_start); __hyp_reset_vectors();
} }
static inline void kvm_arch_hardware_unsetup(void) {} static inline void kvm_arch_hardware_unsetup(void) {}
......
...@@ -134,7 +134,6 @@ ENTRY(__kvm_handle_stub_hvc) ...@@ -134,7 +134,6 @@ ENTRY(__kvm_handle_stub_hvc)
/* /*
* Reset kvm back to the hyp stub. * Reset kvm back to the hyp stub.
*/ */
ENTRY(__kvm_hyp_reset)
/* We're now in idmap, disable MMU */ /* We're now in idmap, disable MMU */
mrs x0, sctlr_el2 mrs x0, sctlr_el2
ldr x1, =SCTLR_ELx_FLAGS ldr x1, =SCTLR_ELx_FLAGS
...@@ -152,7 +151,6 @@ ENTRY(__kvm_hyp_reset) ...@@ -152,7 +151,6 @@ ENTRY(__kvm_hyp_reset)
exit: exit:
eret eret
ENDPROC(__kvm_hyp_reset)
ENDPROC(__kvm_handle_stub_hvc) ENDPROC(__kvm_handle_stub_hvc)
.ltorg .ltorg
......
...@@ -53,21 +53,6 @@ ENTRY(__vhe_hyp_call) ...@@ -53,21 +53,6 @@ ENTRY(__vhe_hyp_call)
ret ret
ENDPROC(__vhe_hyp_call) ENDPROC(__vhe_hyp_call)
/*
* Compute the idmap address of __kvm_hyp_reset based on the idmap
* start passed as a parameter, and jump there.
*
* x0: HYP phys_idmap_start
*/
ENTRY(__kvm_hyp_teardown)
mov x4, x0
adr_l x3, __kvm_hyp_reset
/* insert __kvm_hyp_reset()s offset into phys_idmap_start */
bfi x4, x3, #0, #PAGE_SHIFT
br x4
ENDPROC(__kvm_hyp_teardown)
el1_sync: // Guest trapped into EL2 el1_sync: // Guest trapped into EL2
stp x0, x1, [sp, #-16]! stp x0, x1, [sp, #-16]!
......
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