linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wanpeng Li <kernellwp@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kvm <kvm@vger.kernel.org>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH 2/3] KVM: LAPIC: lapic timer is injected by posted interrupt
Date: Thu, 6 Jun 2019 13:33:10 +0800	[thread overview]
Message-ID: <CANRm+Cyzf_P_npJMBDbHN1g+GDfKsNR23bNWXMuUCtFq_caQnQ@mail.gmail.com> (raw)
In-Reply-To: <16c54182-7198-f476-080b-5876cd871e42@redhat.com>

On Wed, 5 Jun 2019 at 20:30, Paolo Bonzini <pbonzini@redhat.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

  reply	other threads:[~2019-06-06  5:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05 10:09 [PATCH 0/3] KVM: LAPIC: Implement Exitless Timer Wanpeng Li
2019-06-05 10:09 ` [PATCH 1/3] KVM: LAPIC: Make lapic timer unpinned when timer is injected by posted-interrupt Wanpeng Li
2019-06-05 13:04   ` Paolo Bonzini
2019-06-06  5:44     ` Wanpeng Li
2019-06-05 10:09 ` [PATCH 2/3] KVM: LAPIC: lapic timer is injected by posted interrupt Wanpeng Li
2019-06-05 12:30   ` Paolo Bonzini
2019-06-06  5:33     ` Wanpeng Li [this message]
2019-06-05 10:09 ` [PATCH 3/3] KVM: LAPIC: Ignore timer migration when lapic timer is injected by posted-interrupt Wanpeng Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANRm+Cyzf_P_npJMBDbHN1g+GDfKsNR23bNWXMuUCtFq_caQnQ@mail.gmail.com \
    --to=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).