Commit 044ac37d authored by Marc Zyngier's avatar Marc Zyngier
Browse files

arm64: KVM: Add compatibility aliases

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: default avatarMarc Zyngier <>
Acked-by: default avatarChristoffer Dall <>
parent 53fd5b64
......@@ -135,3 +135,6 @@ u32 __hyp_text __debug_read_mdcr_el2(void)
return read_sysreg(mdcr_el2);
u32 __weak __kvm_get_mdcr_el2(void);
......@@ -189,6 +189,8 @@ ENDPROC(\label)
.align 11
.weak __kvm_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
......@@ -142,6 +142,9 @@ int __hyp_text __guest_run(struct kvm_vcpu *vcpu)
return exit_code;
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)
......@@ -48,6 +48,9 @@ void __hyp_text __tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
write_sysreg(0, vttbr_el2);
void __weak __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
void __hyp_text __tlb_flush_vmid(struct kvm *kvm)
......@@ -64,6 +67,9 @@ void __hyp_text __tlb_flush_vmid(struct kvm *kvm)
write_sysreg(0, vttbr_el2);
void __weak __kvm_tlb_flush_vmid(struct kvm *kvm);
void __hyp_text __tlb_flush_vm_context(void)
......@@ -71,3 +77,6 @@ void __hyp_text __tlb_flush_vm_context(void)
"ic ialluis ": : );
void __weak __kvm_flush_vm_context(void);
......@@ -224,3 +224,6 @@ u64 __hyp_text __vgic_v3_read_ich_vtr_el2(void)
return read_gicreg(ICH_VTR_EL2);
u64 __weak __vgic_v3_get_ich_vtr_el2(void);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment