[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 6 Jun 2019 13:33:10 +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>,
Radim Krčmář <rkrcmar@...hat.com>
Subject: Re: [PATCH 2/3] KVM: LAPIC: lapic timer is injected by posted interrupt
On Wed, 5 Jun 2019 at 20:30, Paolo Bonzini <pbonzini@...hat.com> wrote:
>
> On 05/06/19 12:09, Wanpeng Li wrote:
> > +static void apic_timer_expired_pi(struct kvm_lapic *apic)
> > +{
> > + struct kvm_timer *ktimer = &apic->lapic_timer;
> > +
> > + kvm_apic_local_deliver(apic, APIC_LVTT);
> > + if (apic_lvtt_tscdeadline(apic))
> > + ktimer->tscdeadline = 0;
> > + if (apic_lvtt_oneshot(apic)) {
> > + ktimer->tscdeadline = 0;
> > + ktimer->target_expiration = 0;
> > + }
> > +}
>
> Please rename this function to kvm_apic_inject_pending_timer_irqs and
> call it from kvm_inject_apic_timer_irqs.
>
> Then apic_timer_expired can just do
>
> if (atomic_read(&apic->lapic_timer.pending))
> return;
>
> + if (unlikely(posted_interrupt_inject_timer(apic->vcpu))) {
> + kvm_apic_inject_pending_timer_irqs(apic);
> + return;
> + }
Do it in v2.
Regards,
Wanpeng Li
Powered by blists - more mailing lists