aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoffer Dall <christoffer.dall@linaro.org>2016-09-01 07:16:03 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2016-09-08 06:53:00 -0400
commitcf0ba18a441410aeaf3ef97eead3a3fa5381f46f (patch)
treeec64816a26f174b4de6bbb76c756fdfc02dd6cdf
parent777c155772f9a234d72b9319325d8b6abd0c0e36 (diff)
KVM: arm/arm64: Get rid of exported aliases to static functions
When rewriting the assembly code to C code, it was useful to have exported aliases or static functions so that we could keep the existing common C code unmodified and at the same time rewrite arm64 from assembly to C code, and later do the arm part. Now when both are done, we really don't need this level of indirection anymore, and it's time to save a few lines and brain cells. Acked-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
-rw-r--r--arch/arm/kvm/hyp/switch.c4
-rw-r--r--arch/arm/kvm/hyp/tlb.c15
-rw-r--r--arch/arm64/kvm/hyp/debug-sr.c4
-rw-r--r--arch/arm64/kvm/hyp/switch.c4
-rw-r--r--arch/arm64/kvm/hyp/tlb.c13
-rw-r--r--arch/arm64/kvm/hyp/vgic-v3-sr.c4
6 files changed, 11 insertions, 33 deletions
diff --git a/arch/arm/kvm/hyp/switch.c b/arch/arm/kvm/hyp/switch.c
index b13caa90cd44..37b336549700 100644
--- a/arch/arm/kvm/hyp/switch.c
+++ b/arch/arm/kvm/hyp/switch.c
@@ -134,7 +134,7 @@ static bool __hyp_text __populate_fault_info(struct kvm_vcpu *vcpu)
134 return true; 134 return true;
135} 135}
136 136
137static int __hyp_text __guest_run(struct kvm_vcpu *vcpu) 137int __hyp_text __kvm_vcpu_run(struct kvm_vcpu *vcpu)
138{ 138{
139 struct kvm_cpu_context *host_ctxt; 139 struct kvm_cpu_context *host_ctxt;
140 struct kvm_cpu_context *guest_ctxt; 140 struct kvm_cpu_context *guest_ctxt;
@@ -191,8 +191,6 @@ again:
191 return exit_code; 191 return exit_code;
192} 192}
193 193
194__alias(__guest_run) int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
195
196static const char * const __hyp_panic_string[] = { 194static const char * const __hyp_panic_string[] = {
197 [ARM_EXCEPTION_RESET] = "\nHYP panic: RST PC:%08x CPSR:%08x", 195 [ARM_EXCEPTION_RESET] = "\nHYP panic: RST PC:%08x CPSR:%08x",
198 [ARM_EXCEPTION_UNDEFINED] = "\nHYP panic: UNDEF PC:%08x CPSR:%08x", 196 [ARM_EXCEPTION_UNDEFINED] = "\nHYP panic: UNDEF PC:%08x CPSR:%08x",
diff --git a/arch/arm/kvm/hyp/tlb.c b/arch/arm/kvm/hyp/tlb.c
index a2636001e616..729652854f90 100644
--- a/arch/arm/kvm/hyp/tlb.c
+++ b/arch/arm/kvm/hyp/tlb.c
@@ -34,7 +34,7 @@
34 * As v7 does not support flushing per IPA, just nuke the whole TLB 34 * As v7 does not support flushing per IPA, just nuke the whole TLB
35 * instead, ignoring the ipa value. 35 * instead, ignoring the ipa value.
36 */ 36 */
37static void __hyp_text __tlb_flush_vmid(struct kvm *kvm) 37void __hyp_text __kvm_tlb_flush_vmid(struct kvm *kvm)
38{ 38{
39 dsb(ishst); 39 dsb(ishst);
40 40
@@ -50,21 +50,14 @@ static void __hyp_text __tlb_flush_vmid(struct kvm *kvm)
50 write_sysreg(0, VTTBR); 50 write_sysreg(0, VTTBR);
51} 51}
52 52
53__alias(__tlb_flush_vmid) void __kvm_tlb_flush_vmid(struct kvm *kvm); 53void __hyp_text __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
54
55static void __hyp_text __tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
56{ 54{
57 __tlb_flush_vmid(kvm); 55 __kvm_tlb_flush_vmid(kvm);
58} 56}
59 57
60__alias(__tlb_flush_vmid_ipa) void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, 58void __hyp_text __kvm_flush_vm_context(void)
61 phys_addr_t ipa);
62
63static void __hyp_text __tlb_flush_vm_context(void)
64{ 59{
65 write_sysreg(0, TLBIALLNSNHIS); 60 write_sysreg(0, TLBIALLNSNHIS);
66 write_sysreg(0, ICIALLUIS); 61 write_sysreg(0, ICIALLUIS);
67 dsb(ish); 62 dsb(ish);
68} 63}
69
70__alias(__tlb_flush_vm_context) void __kvm_flush_vm_context(void);
diff --git a/arch/arm64/kvm/hyp/debug-sr.c b/arch/arm64/kvm/hyp/debug-sr.c
index 33342a776ec7..4ba5c9095d03 100644
--- a/arch/arm64/kvm/hyp/debug-sr.c
+++ b/arch/arm64/kvm/hyp/debug-sr.c
@@ -131,9 +131,7 @@ void __hyp_text __debug_cond_restore_host_state(struct kvm_vcpu *vcpu)
131 vcpu->arch.debug_flags &= ~KVM_ARM64_DEBUG_DIRTY; 131 vcpu->arch.debug_flags &= ~KVM_ARM64_DEBUG_DIRTY;
132} 132}
133 133
134static u32 __hyp_text __debug_read_mdcr_el2(void) 134u32 __hyp_text __kvm_get_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) u32 __kvm_get_mdcr_el2(void);
diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c
index 5a84b4562603..35d2e09ac695 100644
--- a/arch/arm64/kvm/hyp/switch.c
+++ b/arch/arm64/kvm/hyp/switch.c
@@ -232,7 +232,7 @@ static bool __hyp_text __populate_fault_info(struct kvm_vcpu *vcpu)
232 return true; 232 return true;
233} 233}
234 234
235static int __hyp_text __guest_run(struct kvm_vcpu *vcpu) 235int __hyp_text __kvm_vcpu_run(struct kvm_vcpu *vcpu)
236{ 236{
237 struct kvm_cpu_context *host_ctxt; 237 struct kvm_cpu_context *host_ctxt;
238 struct kvm_cpu_context *guest_ctxt; 238 struct kvm_cpu_context *guest_ctxt;
@@ -293,8 +293,6 @@ again:
293 return exit_code; 293 return exit_code;
294} 294}
295 295
296__alias(__guest_run) int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
297
298static const char __hyp_panic_string[] = "HYP panic:\nPS:%08llx PC:%016llx ESR:%08llx\nFAR:%016llx HPFAR:%016llx PAR:%016llx\nVCPU:%p\n"; 296static const char __hyp_panic_string[] = "HYP panic:\nPS:%08llx PC:%016llx ESR:%08llx\nFAR:%016llx HPFAR:%016llx PAR:%016llx\nVCPU:%p\n";
299 297
300static void __hyp_text __hyp_call_panic_nvhe(u64 spsr, u64 elr, u64 par) 298static void __hyp_text __hyp_call_panic_nvhe(u64 spsr, u64 elr, u64 par)
diff --git a/arch/arm64/kvm/hyp/tlb.c b/arch/arm64/kvm/hyp/tlb.c
index be8177cdd3bf..9cc0ea784ae6 100644
--- a/arch/arm64/kvm/hyp/tlb.c
+++ b/arch/arm64/kvm/hyp/tlb.c
@@ -17,7 +17,7 @@
17 17
18#include <asm/kvm_hyp.h> 18#include <asm/kvm_hyp.h>
19 19
20static void __hyp_text __tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa) 20void __hyp_text __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
21{ 21{
22 dsb(ishst); 22 dsb(ishst);
23 23
@@ -48,10 +48,7 @@ static 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) void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, 51void __hyp_text __kvm_tlb_flush_vmid(struct kvm *kvm)
52 phys_addr_t ipa);
53
54static void __hyp_text __tlb_flush_vmid(struct kvm *kvm)
55{ 52{
56 dsb(ishst); 53 dsb(ishst);
57 54
@@ -67,14 +64,10 @@ static void __hyp_text __tlb_flush_vmid(struct kvm *kvm)
67 write_sysreg(0, vttbr_el2); 64 write_sysreg(0, vttbr_el2);
68} 65}
69 66
70__alias(__tlb_flush_vmid) void __kvm_tlb_flush_vmid(struct kvm *kvm); 67void __hyp_text __kvm_flush_vm_context(void)
71
72static void __hyp_text __tlb_flush_vm_context(void)
73{ 68{
74 dsb(ishst); 69 dsb(ishst);
75 asm volatile("tlbi alle1is \n" 70 asm volatile("tlbi alle1is \n"
76 "ic ialluis ": : ); 71 "ic ialluis ": : );
77 dsb(ish); 72 dsb(ish);
78} 73}
79
80__alias(__tlb_flush_vm_context) void __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 5f8f80b4a224..ee1ea6303554 100644
--- a/arch/arm64/kvm/hyp/vgic-v3-sr.c
+++ b/arch/arm64/kvm/hyp/vgic-v3-sr.c
@@ -335,9 +335,7 @@ void __hyp_text __vgic_v3_init_lrs(void)
335 __gic_v3_set_lr(0, i); 335 __gic_v3_set_lr(0, i);
336} 336}
337 337
338static u64 __hyp_text __vgic_v3_read_ich_vtr_el2(void) 338u64 __hyp_text __vgic_v3_get_ich_vtr_el2(void)
339{ 339{
340 return read_gicreg(ICH_VTR_EL2); 340 return read_gicreg(ICH_VTR_EL2);
341} 341}
342
343__alias(__vgic_v3_read_ich_vtr_el2) u64 __vgic_v3_get_ich_vtr_el2(void);