Skip to content

Commit c6fe89f

Browse files
author
Marc Zyngier
committed
KVM: arm64: Simplify __kvm_timer_set_cntvoff implementation
Now that this function isn't constrained by the 32bit PCS, let's simplify it by taking a single 64bit offset instead of two 32bit parameters. Signed-off-by: Marc Zyngier <[email protected]>
1 parent 25357de commit c6fe89f

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

arch/arm64/include/asm/kvm_asm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
6464
extern void __kvm_tlb_flush_vmid(struct kvm *kvm);
6565
extern void __kvm_tlb_flush_local_vmid(struct kvm_vcpu *vcpu);
6666

67-
extern void __kvm_timer_set_cntvoff(u32 cntvoff_low, u32 cntvoff_high);
67+
extern void __kvm_timer_set_cntvoff(u64 cntvoff);
6868

6969
extern int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu);
7070

arch/arm64/kvm/arch_timer.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -451,17 +451,7 @@ static void timer_restore_state(struct arch_timer_context *ctx)
451451

452452
static void set_cntvoff(u64 cntvoff)
453453
{
454-
u32 low = lower_32_bits(cntvoff);
455-
u32 high = upper_32_bits(cntvoff);
456-
457-
/*
458-
* Since kvm_call_hyp doesn't fully support the ARM PCS especially on
459-
* 32-bit systems, but rather passes register by register shifted one
460-
* place (we put the function address in r0/x0), we cannot simply pass
461-
* a 64-bit value as an argument, but have to split the value in two
462-
* 32-bit halves.
463-
*/
464-
kvm_call_hyp(__kvm_timer_set_cntvoff, low, high);
454+
kvm_call_hyp(__kvm_timer_set_cntvoff, cntvoff);
465455
}
466456

467457
static inline void set_timer_irq_phys_active(struct arch_timer_context *ctx, bool active)

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010

1111
#include <asm/kvm_hyp.h>
1212

13-
void __hyp_text __kvm_timer_set_cntvoff(u32 cntvoff_low, u32 cntvoff_high)
13+
void __hyp_text __kvm_timer_set_cntvoff(u64 cntvoff)
1414
{
15-
u64 cntvoff = (u64)cntvoff_high << 32 | cntvoff_low;
1615
write_sysreg(cntvoff, cntvoff_el2);
1716
}
1817

0 commit comments

Comments
 (0)