arm/arm64: KVM: Add hook for C-based stage2 init
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 1 Feb 2016 17:54:35 +0000 (17:54 +0000)
committerAlex Shi <alex.shi@linaro.org>
Thu, 10 Nov 2016 07:43:57 +0000 (15:43 +0800)
As we're about to move the stage2 init to C code, introduce some
C hooks that will later be populated with arch-specific implementations.

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
(cherry picked from commit 35a2491a624af1fa7ab6990639f5246cd5f12592)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
arch/arm/include/asm/kvm_host.h
arch/arm/kvm/arm.c
arch/arm64/include/asm/kvm_host.h

index 6692982c9b575db476bc12a37e2d69b27c00d9fb..945bfa5e7752057a0161461ceda83843e98788fa 100644 (file)
@@ -214,6 +214,10 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
        kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
 }
 
+static inline void __cpu_init_stage2(void)
+{
+}
+
 static inline int kvm_arch_dev_ioctl_check_extension(long ext)
 {
        return 0;
index b936475489b5583cfaed68ff518180aeadd3335a..30c9f7b4250557c0567dcb01ae6478fff3b2d32f 100644 (file)
@@ -982,6 +982,7 @@ static void cpu_init_hyp_mode(void *dummy)
        vector_ptr = (unsigned long)__kvm_hyp_vector;
 
        __cpu_init_hyp_mode(boot_pgd_ptr, pgd_ptr, hyp_stack_ptr, vector_ptr);
+       __cpu_init_stage2();
 
        kvm_arm_init_debug();
 }
index 975db147b43ecb52aad9e4cdfba589babfee76a8..1b37b5d5092fc4dd53a9f186f5ec70df96dc0f26 100644 (file)
@@ -326,6 +326,10 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
                     hyp_stack_ptr, vector_ptr);
 }
 
+static inline void __cpu_init_stage2(void)
+{
+}
+
 static inline void kvm_arch_hardware_disable(void) {}
 static inline void kvm_arch_hardware_unsetup(void) {}
 static inline void kvm_arch_sync_events(struct kvm *kvm) {}