aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2015-10-25 09:58:00 -0400
committerMarc Zyngier <marc.zyngier@arm.com>2015-12-14 06:30:42 -0500
commit044ac37d1281fc7b59d5dce4fe979a99369e95f2 (patch)
treedfe0f4cfd2860af11ac6825ba16b082e87a6031e /arch/arm64/kvm
parent53fd5b6487e4438049a5da5e36dfb8edcf1fd789 (diff)
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: Marc Zyngier <marc.zyngier@arm.com> Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm64/kvm')
-rw-r--r--arch/arm64/kvm/hyp/debug-sr.c3
-rw-r--r--arch/arm64/kvm/hyp/hyp-entry.S3
-rw-r--r--arch/arm64/kvm/hyp/switch.c3
-rw-r--r--arch/arm64/kvm/hyp/tlb.c9
-rw-r--r--arch/arm64/kvm/hyp/vgic-v3-sr.c3
5 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm64/kvm/hyp/debug-sr.c b/arch/arm64/kvm/hyp/debug-sr.c
index 7848322deed6..d071f4591a6c 100644
--- a/arch/arm64/kvm/hyp/debug-sr.c
+++ b/arch/arm64/kvm/hyp/debug-sr.c
@@ -135,3 +135,6 @@ u32 __hyp_text __debug_read_mdcr_el2(void)
135{ 135{
136 return read_sysreg(mdcr_el2); 136 return read_sysreg(mdcr_el2);
137} 137}
138
139__alias(__debug_read_mdcr_el2)
140u32 __weak __kvm_get_mdcr_el2(void);
diff --git a/arch/arm64/kvm/hyp/hyp-entry.S b/arch/arm64/kvm/hyp/hyp-entry.S
index 8e58a3ba6139..10d6d2a5390e 100644
--- a/arch/arm64/kvm/hyp/hyp-entry.S
+++ b/arch/arm64/kvm/hyp/hyp-entry.S
@@ -189,6 +189,8 @@ ENDPROC(\label)
189 189
190 .align 11 190 .align 11
191 191
192 .weak __kvm_hyp_vector
193ENTRY(__kvm_hyp_vector)
192ENTRY(__hyp_vector) 194ENTRY(__hyp_vector)
193 ventry el2t_sync_invalid // Synchronous EL2t 195 ventry el2t_sync_invalid // Synchronous EL2t
194 ventry el2t_irq_invalid // IRQ EL2t 196 ventry el2t_irq_invalid // IRQ EL2t
@@ -210,3 +212,4 @@ ENTRY(__hyp_vector)
210 ventry el1_fiq_invalid // FIQ 32-bit EL1 212 ventry el1_fiq_invalid // FIQ 32-bit EL1
211 ventry el1_error_invalid // Error 32-bit EL1 213 ventry el1_error_invalid // Error 32-bit EL1
212ENDPROC(__hyp_vector) 214ENDPROC(__hyp_vector)
215ENDPROC(__kvm_hyp_vector)
diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c
index b012870a92e7..7457ae4db86e 100644
--- a/arch/arm64/kvm/hyp/switch.c
+++ b/arch/arm64/kvm/hyp/switch.c
@@ -142,6 +142,9 @@ int __hyp_text __guest_run(struct kvm_vcpu *vcpu)
142 return exit_code; 142 return exit_code;
143} 143}
144 144
145__alias(__guest_run)
146int __weak __kvm_vcpu_run(struct kvm_vcpu *vcpu);
147
145static const char __hyp_panic_string[] = "HYP panic:\nPS:%08llx PC:%016llx ESR:%08llx\nFAR:%016llx HPFAR:%016llx PAR:%016llx\nVCPU:%p\n"; 148static const char __hyp_panic_string[] = "HYP panic:\nPS:%08llx PC:%016llx ESR:%08llx\nFAR:%016llx HPFAR:%016llx PAR:%016llx\nVCPU:%p\n";
146 149
147void __hyp_text __noreturn __hyp_panic(void) 150void __hyp_text __noreturn __hyp_panic(void)
diff --git a/arch/arm64/kvm/hyp/tlb.c b/arch/arm64/kvm/hyp/tlb.c
index 6fcb93a03659..5f815cf53a9a 100644
--- a/arch/arm64/kvm/hyp/tlb.c
+++ b/arch/arm64/kvm/hyp/tlb.c
@@ -48,6 +48,9 @@ void __hyp_text __tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
48 write_sysreg(0, vttbr_el2); 48 write_sysreg(0, vttbr_el2);
49} 49}
50 50
51__alias(__tlb_flush_vmid_ipa)
52void __weak __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
53
51void __hyp_text __tlb_flush_vmid(struct kvm *kvm) 54void __hyp_text __tlb_flush_vmid(struct kvm *kvm)
52{ 55{
53 dsb(ishst); 56 dsb(ishst);
@@ -64,6 +67,9 @@ void __hyp_text __tlb_flush_vmid(struct kvm *kvm)
64 write_sysreg(0, vttbr_el2); 67 write_sysreg(0, vttbr_el2);
65} 68}
66 69
70__alias(__tlb_flush_vmid)
71void __weak __kvm_tlb_flush_vmid(struct kvm *kvm);
72
67void __hyp_text __tlb_flush_vm_context(void) 73void __hyp_text __tlb_flush_vm_context(void)
68{ 74{
69 dsb(ishst); 75 dsb(ishst);
@@ -71,3 +77,6 @@ void __hyp_text __tlb_flush_vm_context(void)
71 "ic ialluis ": : ); 77 "ic ialluis ": : );
72 dsb(ish); 78 dsb(ish);
73} 79}
80
81__alias(__tlb_flush_vm_context)
82void __weak __kvm_flush_vm_context(void);
diff --git a/arch/arm64/kvm/hyp/vgic-v3-sr.c b/arch/arm64/kvm/hyp/vgic-v3-sr.c
index 78d05f3cccfc..a76945874d5d 100644
--- a/arch/arm64/kvm/hyp/vgic-v3-sr.c
+++ b/arch/arm64/kvm/hyp/vgic-v3-sr.c
@@ -224,3 +224,6 @@ u64 __hyp_text __vgic_v3_read_ich_vtr_el2(void)
224{ 224{
225 return read_gicreg(ICH_VTR_EL2); 225 return read_gicreg(ICH_VTR_EL2);
226} 226}
227
228__alias(__vgic_v3_read_ich_vtr_el2)
229u64 __weak __vgic_v3_get_ich_vtr_el2(void);