]> git.karo-electronics.de Git - linux-beck.git/commitdiff
arm64: KVM: Add compatibility aliases
authorMarc Zyngier <marc.zyngier@arm.com>
Sun, 25 Oct 2015 13:58:00 +0000 (13:58 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Mon, 14 Dec 2015 11:30:42 +0000 (11:30 +0000)
So far, we've implemented the new world switch with a completely
different namespace, so that we could have both implementation
compiled in.

Let's take things one step further by adding weak aliases that
have the same names as the original implementation. The weak
attributes allows the new implementation to be overriden by the
old one, and everything still work.

At a later point, we'll be able to simply drop the old code, and
everything will hopefully keep working, thanks to the aliases we
have just added. This also saves us repainting all the callers.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm64/kvm/hyp/debug-sr.c
arch/arm64/kvm/hyp/hyp-entry.S
arch/arm64/kvm/hyp/switch.c
arch/arm64/kvm/hyp/tlb.c
arch/arm64/kvm/hyp/vgic-v3-sr.c

index 7848322deed66ca3f4c1363987544c8208a56ecf..d071f4591a6c490598883a0b7bca345ca285440f 100644 (file)
@@ -135,3 +135,6 @@ u32 __hyp_text __debug_read_mdcr_el2(void)
 {
        return read_sysreg(mdcr_el2);
 }
+
+__alias(__debug_read_mdcr_el2)
+u32 __weak __kvm_get_mdcr_el2(void);
index 8e58a3ba6139a2196e2d7ae08d3919549e970b0e..10d6d2a5390e628c2fcb986525f0da180855146f 100644 (file)
@@ -189,6 +189,8 @@ ENDPROC(\label)
 
        .align 11
 
+       .weak   __kvm_hyp_vector
+ENTRY(__kvm_hyp_vector)
 ENTRY(__hyp_vector)
        ventry  el2t_sync_invalid               // Synchronous EL2t
        ventry  el2t_irq_invalid                // IRQ EL2t
@@ -210,3 +212,4 @@ ENTRY(__hyp_vector)
        ventry  el1_fiq_invalid                 // FIQ 32-bit EL1
        ventry  el1_error_invalid               // Error 32-bit EL1
 ENDPROC(__hyp_vector)
+ENDPROC(__kvm_hyp_vector)
index b012870a92e7a81226fd80c388963b2ec9c2be8f..7457ae4db86efd78d9d14daeec2a31d67b5f120f 100644 (file)
@@ -142,6 +142,9 @@ int __hyp_text __guest_run(struct kvm_vcpu *vcpu)
        return exit_code;
 }
 
+__alias(__guest_run)
+int __weak __kvm_vcpu_run(struct kvm_vcpu *vcpu);
+
 static const char __hyp_panic_string[] = "HYP panic:\nPS:%08llx PC:%016llx ESR:%08llx\nFAR:%016llx HPFAR:%016llx PAR:%016llx\nVCPU:%p\n";
 
 void __hyp_text __noreturn __hyp_panic(void)
index 6fcb93a03659bbe24ded45430c75fb0898638b95..5f815cf53a9a0310a716e3a709a420633a11642e 100644 (file)
@@ -48,6 +48,9 @@ void __hyp_text __tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
        write_sysreg(0, vttbr_el2);
 }
 
+__alias(__tlb_flush_vmid_ipa)
+void __weak __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
+
 void __hyp_text __tlb_flush_vmid(struct kvm *kvm)
 {
        dsb(ishst);
@@ -64,6 +67,9 @@ void __hyp_text __tlb_flush_vmid(struct kvm *kvm)
        write_sysreg(0, vttbr_el2);
 }
 
+__alias(__tlb_flush_vmid)
+void __weak __kvm_tlb_flush_vmid(struct kvm *kvm);
+
 void __hyp_text __tlb_flush_vm_context(void)
 {
        dsb(ishst);
@@ -71,3 +77,6 @@ void __hyp_text __tlb_flush_vm_context(void)
                     "ic ialluis          ": : );
        dsb(ish);
 }
+
+__alias(__tlb_flush_vm_context)
+void __weak __kvm_flush_vm_context(void);
index 78d05f3cccfc2087d5bf715a0a261f67e82f7cdd..a76945874d5d908f54c20ff1346f5570de66a870 100644 (file)
@@ -224,3 +224,6 @@ u64 __hyp_text __vgic_v3_read_ich_vtr_el2(void)
 {
        return read_gicreg(ICH_VTR_EL2);
 }
+
+__alias(__vgic_v3_read_ich_vtr_el2)
+u64 __weak __vgic_v3_get_ich_vtr_el2(void);