Skip to content

Commit 7e90c8e

Browse files
Christoffer Dallchazy
authored andcommitted
KVM: arm/arm64: Get rid of kvm_timer_flush_hwstate
Now when both the vtimer and the ptimer when using both the in-kernel vgic emulation and a userspace IRQ chip are driven by the timer signals and at the vcpu load/put boundaries, instead of recomputing the timer state at every entry/exit to/from the guest, we can get entirely rid of the flush hwstate function. Signed-off-by: Christoffer Dall <cdall@linaro.org> Acked-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent bbdd52c commit 7e90c8e

3 files changed

Lines changed: 0 additions & 26 deletions

File tree

‎include/kvm/arm_arch_timer.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ int kvm_timer_hyp_init(void);
6666
int kvm_timer_enable(struct kvm_vcpu *vcpu);
6767
int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu);
6868
void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu);
69-
void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu);
7069
void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu);
7170
bool kvm_timer_should_notify_user(struct kvm_vcpu *vcpu);
7271
void kvm_timer_update_run(struct kvm_vcpu *vcpu);

‎virt/kvm/arm/arch_timer.c‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,6 @@ static void kvm_timer_update_state(struct kvm_vcpu *vcpu)
305305
struct arch_timer_context *vtimer = vcpu_vtimer(vcpu);
306306
struct arch_timer_context *ptimer = vcpu_ptimer(vcpu);
307307

308-
/*
309-
* If userspace modified the timer registers via SET_ONE_REG before
310-
* the vgic was initialized, we mustn't set the vtimer->irq.level value
311-
* because the guest would never see the interrupt. Instead wait
312-
* until we call this function from kvm_timer_flush_hwstate.
313-
*/
314308
if (unlikely(!timer->enabled))
315309
return;
316310

@@ -489,24 +483,6 @@ bool kvm_timer_should_notify_user(struct kvm_vcpu *vcpu)
489483
ptimer->irq.level != plevel;
490484
}
491485

492-
/**
493-
* kvm_timer_flush_hwstate - prepare timers before running the vcpu
494-
* @vcpu: The vcpu pointer
495-
*
496-
* Check if the virtual timer has expired while we were running in the host,
497-
* and inject an interrupt if that was the case, making sure the timer is
498-
* masked or disabled on the host so that we keep executing. Also schedule a
499-
* software timer for the physical timer if it is enabled.
500-
*/
501-
void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu)
502-
{
503-
struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
504-
struct arch_timer_context *ptimer = vcpu_ptimer(vcpu);
505-
506-
if (unlikely(!timer->enabled))
507-
return;
508-
}
509-
510486
void kvm_timer_vcpu_put(struct kvm_vcpu *vcpu)
511487
{
512488
struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;

‎virt/kvm/arm/arm.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,6 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
656656

657657
local_irq_disable();
658658

659-
kvm_timer_flush_hwstate(vcpu);
660659
kvm_vgic_flush_hwstate(vcpu);
661660

662661
/*

0 commit comments

Comments
 (0)