Skip to content

Commit 9502888

Browse files
Marc ZyngierAlex Shi
authored andcommitted
arm/arm64: KVM: Add hook for C-based stage2 init
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>
1 parent 6a85245 commit 9502888

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

arch/arm/include/asm/kvm_host.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
214214
kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
215215
}
216216

217+
static inline void __cpu_init_stage2(void)
218+
{
219+
}
220+
217221
static inline int kvm_arch_dev_ioctl_check_extension(long ext)
218222
{
219223
return 0;

arch/arm/kvm/arm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,7 @@ static void cpu_init_hyp_mode(void *dummy)
982982
vector_ptr = (unsigned long)__kvm_hyp_vector;
983983

984984
__cpu_init_hyp_mode(boot_pgd_ptr, pgd_ptr, hyp_stack_ptr, vector_ptr);
985+
__cpu_init_stage2();
985986

986987
kvm_arm_init_debug();
987988
}

arch/arm64/include/asm/kvm_host.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
326326
hyp_stack_ptr, vector_ptr);
327327
}
328328

329+
static inline void __cpu_init_stage2(void)
330+
{
331+
}
332+
329333
static inline void kvm_arch_hardware_disable(void) {}
330334
static inline void kvm_arch_hardware_unsetup(void) {}
331335
static inline void kvm_arch_sync_events(struct kvm *kvm) {}

0 commit comments

Comments
 (0)