[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANRm+CyyKwFoSns31gK=_v0j1VQrOwDhgTqWZOLZS9iGZeC3Gw@mail.gmail.com>
Date: Thu, 23 Apr 2020 17:56:51 +0800
From: Wanpeng Li <kernellwp@...il.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kvm <kvm@...r.kernel.org>,
Sean Christopherson <sean.j.christopherson@...el.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Haiwei Li <lihaiwei@...cent.com>
Subject: Re: [PATCH v2 5/5] KVM: VMX: Handle preemption timer fastpath
On Thu, 23 Apr 2020 at 17:40, Paolo Bonzini <pbonzini@...hat.com> wrote:
>
> 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.
Except the apic_lvtt_tscdeadline(apic) check, others are duplicated,
what do you think about apic_lvtt_tscdeadline(apic) check?
Wanpeng
Powered by blists - more mailing lists