Re: [PATCH v2 5/5] KVM: VMX: Handle preemption timer fastpath
From: Paolo Bonzini
Date: Thu Apr 23 2020 - 05:40:32 EST
On 23/04/20 11:01, Wanpeng Li wrote:
> +bool kvm_lapic_expired_hv_timer_fast(struct kvm_vcpu *vcpu)
> +{
> + struct kvm_lapic *apic = vcpu->arch.apic;
> + struct kvm_timer *ktimer = &apic->lapic_timer;
> +
> + if (!apic_lvtt_tscdeadline(apic) ||
> + !ktimer->hv_timer_in_use ||
> + atomic_read(&ktimer->pending))
> + return 0;
> +
> + WARN_ON(swait_active(&vcpu->wq));
> + cancel_hv_timer(apic);
> +
> + ktimer->expired_tscdeadline = ktimer->tscdeadline;
> + kvm_inject_apic_timer_irqs_fast(vcpu);
> +
> + return 1;
> +}
> +EXPORT_SYMBOL_GPL(kvm_lapic_expired_hv_timer_fast);
Please re-evaluate if this is needed (or which parts are needed) after
cleaning up patch 4. Anyway again---this is already better, I don't
like the duplicated code but at least I can understand what's going on.
Paolo