diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2012-10-05 10:10:44 -0400 |
---|---|---|
committer | Christoffer Dall <cdall@cs.columbia.edu> | 2013-03-06 18:48:44 -0500 |
commit | e7858c58d52237a4519e2fdb1ce8f2d9805ce0ce (patch) | |
tree | 551887bf4a54ce5d91de84da75a79a3baac8522b /arch/arm/kvm | |
parent | 629dc446a49a1c3b4f31a3fdc2c814a7db6c6199 (diff) |
ARM: KVM: move hyp init to kvm_host.h
Make the split of the pgd_ptr an implementation specific thing
by moving the init call to an inline function.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r-- | arch/arm/kvm/arm.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index de783ee8c341..3c7c50a6a286 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c | |||
@@ -813,7 +813,6 @@ long kvm_arch_vm_ioctl(struct file *filp, | |||
813 | static void cpu_init_hyp_mode(void *vector) | 813 | static void cpu_init_hyp_mode(void *vector) |
814 | { | 814 | { |
815 | unsigned long long pgd_ptr; | 815 | unsigned long long pgd_ptr; |
816 | unsigned long pgd_low, pgd_high; | ||
817 | unsigned long hyp_stack_ptr; | 816 | unsigned long hyp_stack_ptr; |
818 | unsigned long stack_page; | 817 | unsigned long stack_page; |
819 | unsigned long vector_ptr; | 818 | unsigned long vector_ptr; |
@@ -822,20 +821,11 @@ static void cpu_init_hyp_mode(void *vector) | |||
822 | __hyp_set_vectors((unsigned long)vector); | 821 | __hyp_set_vectors((unsigned long)vector); |
823 | 822 | ||
824 | pgd_ptr = (unsigned long long)kvm_mmu_get_httbr(); | 823 | pgd_ptr = (unsigned long long)kvm_mmu_get_httbr(); |
825 | pgd_low = (pgd_ptr & ((1ULL << 32) - 1)); | ||
826 | pgd_high = (pgd_ptr >> 32ULL); | ||
827 | stack_page = __get_cpu_var(kvm_arm_hyp_stack_page); | 824 | stack_page = __get_cpu_var(kvm_arm_hyp_stack_page); |
828 | hyp_stack_ptr = stack_page + PAGE_SIZE; | 825 | hyp_stack_ptr = stack_page + PAGE_SIZE; |
829 | vector_ptr = (unsigned long)__kvm_hyp_vector; | 826 | vector_ptr = (unsigned long)__kvm_hyp_vector; |
830 | 827 | ||
831 | /* | 828 | __cpu_init_hyp_mode(pgd_ptr, hyp_stack_ptr, vector_ptr); |
832 | * Call initialization code, and switch to the full blown | ||
833 | * HYP code. The init code doesn't need to preserve these registers as | ||
834 | * r1-r3 and r12 are already callee save according to the AAPCS. | ||
835 | * Note that we slightly misuse the prototype by casing the pgd_low to | ||
836 | * a void *. | ||
837 | */ | ||
838 | kvm_call_hyp((void *)pgd_low, pgd_high, hyp_stack_ptr, vector_ptr); | ||
839 | } | 829 | } |
840 | 830 | ||
841 | /** | 831 | /** |