From: Marcelo Tosatti <mtosatti@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Alan Jenkins <alan.christopher.jenkins@gmail.com>,
kvm-devel <kvm@vger.kernel.org>
Subject: Re: [PATCH v2] KVM: x86: reset lapic_timer.expired_tscdeadline at SET_LAPIC time
Date: Tue, 21 Jun 2016 08:35:34 -0300 [thread overview]
Message-ID: <20160621113531.GA11032@amt.cnet> (raw)
In-Reply-To: <d5ddfaf7-6343-ab0f-190d-e8feba98983a@redhat.com>
On Tue, Jun 21, 2016 at 09:50:54AM +0200, Paolo Bonzini wrote:
>
>
> On 20/06/2016 15:05, Marcelo Tosatti wrote:
> >
> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> > index ea306ad..89be6e9 100644
> > --- a/arch/x86/kvm/x86.c
> > +++ b/arch/x86/kvm/x86.c
> > @@ -2991,6 +2991,7 @@ static int kvm_vcpu_ioctl_set_lapic(struct kvm_vcpu *vcpu,
> > {
> > kvm_apic_post_state_restore(vcpu, s);
> > update_cr8_intercept(vcpu);
> > + vcpu->arch.apic->lapic_timer.expired_tscdeadline = 0;
> >
>
> I think this is not correct. You have programmed the host timer to an
> early value when kvm_apic_post_state_restore called start_apic_timer.
>
> I think that:
>
> 1) post_state_restore should cancel the timer and clear
> lapic_timer.pending before writing the registers, not afterwards.
> lapic_timer.expired_tscdeadline can be cleared at the same time.
>
> 2) kvm_write_tsc should do the same and restart the timer afterwards.
>
> Thanks,
>
> Paolo
Actually, the max should deal with the problem Alan is having with
vmload as well (one delay of tenths of microseconds, or 0, per vmload
should be irrelevant).
next prev parent reply other threads:[~2016-06-21 11:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-17 23:41 KVM: x86: reset lapic_timer.expired_tscdeadline at SET_LAPIC time Marcelo Tosatti
2016-06-18 13:43 ` Alan Jenkins
2016-06-20 13:05 ` [PATCH v2] " Marcelo Tosatti
2016-06-20 15:22 ` Alan Jenkins
[not found] ` <87bb5b7c-ab8c-7bb4-b01d-f535eb716522@gmail.com>
2016-06-21 1:31 ` Marcelo Tosatti
2016-06-21 7:50 ` Paolo Bonzini
2016-06-21 11:35 ` Marcelo Tosatti [this message]
2016-06-21 11:37 ` Paolo Bonzini
2016-06-20 13:11 ` Marcelo Tosatti
2016-06-20 15:22 ` Alan Jenkins
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=20160621113531.GA11032@amt.cnet \
--to=mtosatti@redhat.com \
--cc=alan.christopher.jenkins@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@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