Skip to content

Commit cf0ba18

Browse files
committed
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 <[email protected]> Signed-off-by: Christoffer Dall <[email protected]>
1 parent 777c155 commit cf0ba18

File tree

6 files changed

+11
-33
lines changed

6 files changed

+11
-33
lines changed

arch/arm/kvm/hyp/switch.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static bool __hyp_text __populate_fault_info(struct kvm_vcpu *vcpu)
134134
return true;
135135
}
136136

137-
static int __hyp_text __guest_run(struct kvm_vcpu *vcpu)
137+
int __hyp_text __kvm_vcpu_run(struct kvm_vcpu *vcpu)
138138
{
139139
struct kvm_cpu_context *host_ctxt;
140140
struct kvm_cpu_context *guest_ctxt;
@@ -191,8 +191,6 @@ static int __hyp_text __guest_run(struct kvm_vcpu *vcpu)
191191
return exit_code;
192192
}
193193

194-
__alias(__guest_run) int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
195-
196194
static const char * const __hyp_panic_string[] = {
197195
[ARM_EXCEPTION_RESET] = "\nHYP panic: RST PC:%08x CPSR:%08x",
198196
[ARM_EXCEPTION_UNDEFINED] = "\nHYP panic: UNDEF PC:%08x CPSR:%08x",

arch/arm/kvm/hyp/tlb.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* As v7 does not support flushing per IPA, just nuke the whole TLB
3535
* instead, ignoring the ipa value.
3636
*/
37-
static void __hyp_text __tlb_flush_vmid(struct kvm *kvm)
37+
void __hyp_text __kvm_tlb_flush_vmid(struct kvm *kvm)
3838
{
3939
dsb(ishst);
4040

@@ -50,21 +50,14 @@ static void __hyp_text __tlb_flush_vmid(struct kvm *kvm)
5050
write_sysreg(0, VTTBR);
5151
}
5252

53-
__alias(__tlb_flush_vmid) void __kvm_tlb_flush_vmid(struct kvm *kvm);
54-
55-
static void __hyp_text __tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
53+
void __hyp_text __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
5654
{
57-
__tlb_flush_vmid(kvm);
55+
__kvm_tlb_flush_vmid(kvm);
5856
}
5957

60-
__alias(__tlb_flush_vmid_ipa) void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm,
61-
phys_addr_t ipa);
62-
63-
static void __hyp_text __tlb_flush_vm_context(void)
58+
void __hyp_text __kvm_flush_vm_context(void)
6459
{
6560
write_sysreg(0, TLBIALLNSNHIS);
6661
write_sysreg(0, ICIALLUIS);
6762
dsb(ish);
6863
}
69-
70-
__alias(__tlb_flush_vm_context) void __kvm_flush_vm_context(void);

arch/arm64/kvm/hyp/debug-sr.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ void __hyp_text __debug_cond_restore_host_state(struct kvm_vcpu *vcpu)
131131
vcpu->arch.debug_flags &= ~KVM_ARM64_DEBUG_DIRTY;
132132
}
133133

134-
static u32 __hyp_text __debug_read_mdcr_el2(void)
134+
u32 __hyp_text __kvm_get_mdcr_el2(void)
135135
{
136136
return read_sysreg(mdcr_el2);
137137
}
138-
139-
__alias(__debug_read_mdcr_el2) u32 __kvm_get_mdcr_el2(void);

arch/arm64/kvm/hyp/switch.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ static bool __hyp_text __populate_fault_info(struct kvm_vcpu *vcpu)
232232
return true;
233233
}
234234

235-
static int __hyp_text __guest_run(struct kvm_vcpu *vcpu)
235+
int __hyp_text __kvm_vcpu_run(struct kvm_vcpu *vcpu)
236236
{
237237
struct kvm_cpu_context *host_ctxt;
238238
struct kvm_cpu_context *guest_ctxt;
@@ -293,8 +293,6 @@ static int __hyp_text __guest_run(struct kvm_vcpu *vcpu)
293293
return exit_code;
294294
}
295295

296-
__alias(__guest_run) int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
297-
298296
static const char __hyp_panic_string[] = "HYP panic:\nPS:%08llx PC:%016llx ESR:%08llx\nFAR:%016llx HPFAR:%016llx PAR:%016llx\nVCPU:%p\n";
299297

300298
static void __hyp_text __hyp_call_panic_nvhe(u64 spsr, u64 elr, u64 par)

arch/arm64/kvm/hyp/tlb.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include <asm/kvm_hyp.h>
1919

20-
static void __hyp_text __tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
20+
void __hyp_text __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
2121
{
2222
dsb(ishst);
2323

@@ -48,10 +48,7 @@ static void __hyp_text __tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
4848
write_sysreg(0, vttbr_el2);
4949
}
5050

51-
__alias(__tlb_flush_vmid_ipa) void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm,
52-
phys_addr_t ipa);
53-
54-
static void __hyp_text __tlb_flush_vmid(struct kvm *kvm)
51+
void __hyp_text __kvm_tlb_flush_vmid(struct kvm *kvm)
5552
{
5653
dsb(ishst);
5754

@@ -67,14 +64,10 @@ static void __hyp_text __tlb_flush_vmid(struct kvm *kvm)
6764
write_sysreg(0, vttbr_el2);
6865
}
6966

70-
__alias(__tlb_flush_vmid) void __kvm_tlb_flush_vmid(struct kvm *kvm);
71-
72-
static void __hyp_text __tlb_flush_vm_context(void)
67+
void __hyp_text __kvm_flush_vm_context(void)
7368
{
7469
dsb(ishst);
7570
asm volatile("tlbi alle1is \n"
7671
"ic ialluis ": : );
7772
dsb(ish);
7873
}
79-
80-
__alias(__tlb_flush_vm_context) void __kvm_flush_vm_context(void);

arch/arm64/kvm/hyp/vgic-v3-sr.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,7 @@ void __hyp_text __vgic_v3_init_lrs(void)
335335
__gic_v3_set_lr(0, i);
336336
}
337337

338-
static u64 __hyp_text __vgic_v3_read_ich_vtr_el2(void)
338+
u64 __hyp_text __vgic_v3_get_ich_vtr_el2(void)
339339
{
340340
return read_gicreg(ICH_VTR_EL2);
341341
}
342-
343-
__alias(__vgic_v3_read_ich_vtr_el2) u64 __vgic_v3_get_ich_vtr_el2(void);

0 commit comments

Comments
 (0)