ARM: KVM: Convert __cpu_reset_hyp_mode to using __hyp_reset_vectors
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 3 Apr 2017 18:37:56 +0000 (19:37 +0100)
committerChristoffer Dall <cdall@linaro.org>
Sun, 9 Apr 2017 14:49:30 +0000 (07:49 -0700)
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.

Tested-by: Keerthy <j-keerthy@ti.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
arch/arm/include/asm/kvm_asm.h
arch/arm/include/asm/kvm_host.h
arch/arm/kvm/init.S

index dd16044b34b6135bf272e75fc0ae96dc3525060f..eae11b3e98fc7068687b809d3ee2a78e233c6e31 100644 (file)
@@ -72,8 +72,6 @@ extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
 
 extern void __init_stage2_translation(void);
 
-extern void __kvm_hyp_reset(unsigned long);
-
 extern u64 __vgic_v3_get_ich_vtr_el2(void);
 extern u64 __vgic_v3_read_vmcr(void);
 extern void __vgic_v3_write_vmcr(u32 vmcr);
index 31ee468ce667dee8a219f775f1106714879088c2..adea3075318584de6271849f5c34fc7d5ddc08aa 100644 (file)
@@ -273,7 +273,7 @@ static inline void __cpu_init_stage2(void)
 static inline void __cpu_reset_hyp_mode(unsigned long vector_ptr,
                                        phys_addr_t phys_idmap_start)
 {
-       kvm_call_hyp((void *)virt_to_idmap(__kvm_hyp_reset), vector_ptr);
+       __hyp_reset_vectors();
 }
 
 static inline int kvm_arch_dev_ioctl_check_extension(struct kvm *kvm, long ext)
index d6b2f496fa136139ad714ab2820131ae9c528fad..fb336090ee9c63fcf2bf69fe9c24abcfdc125f41 100644 (file)
@@ -129,7 +129,6 @@ ENTRY(__kvm_handle_stub_hvc)
 
 1:     cmp     r0, #HVC_RESET_VECTORS
        bne     1f
-ENTRY(__kvm_hyp_reset)
        /* We're now in idmap, disable MMU */
        mrc     p15, 4, r1, c1, c0, 0   @ HSCTLR
        ldr     r0, =(HSCTLR_M | HSCTLR_A | HSCTLR_C | HSCTLR_I)
@@ -151,7 +150,6 @@ ENTRY(__kvm_hyp_reset)
 exit:
        eret
 ENDPROC(__kvm_handle_stub_hvc)
-ENDPROC(__kvm_hyp_reset)
 
        .ltorg