Commit 3c5e8123 authored by Marc Zyngier's avatar Marc Zyngier

arm64: KVM: Move vector offsetting from hyp-init.S to kvm_get_hyp_vector

We currently provide the hyp-init code with a kernel VA, and expect
it to turn it into a HYP va by itself. As we're about to provide
the hypervisor with mappings that are not necessarily in the memory
range, let's move the kern_hyp_va macro to kvm_get_hyp_vector.

No functionnal change.
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent 6bb934af
...@@ -374,6 +374,7 @@ static inline void *kvm_get_hyp_vector(void) ...@@ -374,6 +374,7 @@ static inline void *kvm_get_hyp_vector(void)
vect = lm_alias(vect); vect = lm_alias(vect);
} }
vect = kern_hyp_va(vect);
return vect; return vect;
} }
...@@ -387,7 +388,7 @@ static inline int kvm_map_vectors(void) ...@@ -387,7 +388,7 @@ static inline int kvm_map_vectors(void)
#else #else
static inline void *kvm_get_hyp_vector(void) static inline void *kvm_get_hyp_vector(void)
{ {
return kvm_ksym_ref(__kvm_hyp_vector); return kern_hyp_va(kvm_ksym_ref(__kvm_hyp_vector));
} }
static inline int kvm_map_vectors(void) static inline int kvm_map_vectors(void)
......
...@@ -117,7 +117,6 @@ CPU_BE( orr x4, x4, #SCTLR_ELx_EE) ...@@ -117,7 +117,6 @@ CPU_BE( orr x4, x4, #SCTLR_ELx_EE)
/* Set the stack and new vectors */ /* Set the stack and new vectors */
kern_hyp_va x1 kern_hyp_va x1
mov sp, x1 mov sp, x1
kern_hyp_va x2
msr vbar_el2, x2 msr vbar_el2, x2
/* copy tpidr_el1 into tpidr_el2 for use by HYP */ /* copy tpidr_el1 into tpidr_el2 for use by HYP */
......
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