public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Andi Kleen <ak@linux.intel.com>
Cc: kvm@vger.kernel.org
Subject: Re: qemu polling KVM_IRQ_LINE_STATUS when stopped
Date: Fri, 20 Oct 2017 18:51:22 -0400 (EDT)	[thread overview]
Message-ID: <1560363269.13828538.1508539882580.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20171020205026.GI5109@tassilo.jf.intel.com>



----- Original Message -----
> From: "Andi Kleen" <ak@linux.intel.com>
> To: "Paolo Bonzini" <pbonzini@redhat.com>
> Cc: kvm@vger.kernel.org
> Sent: Friday, October 20, 2017 10:50:26 PM
> Subject: Re: qemu polling KVM_IRQ_LINE_STATUS when stopped
> 
> On Fri, Oct 20, 2017 at 05:12:40PM +0200, Paolo Bonzini wrote:
> > On 20/10/2017 16:09, Andi Kleen wrote:
> > >> Unfortunately that's not possible in general.  Windows uses the periodic
> > >> timer to track wall time (!), so if you do that your clock is going to
> > >> be late when you resume the guest.
> > > 
> > > But when the guest cannot execute instructions
> > > it cannot see whatever the handler does.
> > > 
> > > So the handler could always catch up after stopping for longer,
> > > without making any difference.
> > 
> > You may be right... you should get the interrupt storm *after
> > continuing* the guest, but not while it's stopped.
> 
> Maybe be find to not have a storm, but only one. I belive real hardware
> cannot have a storm because only one interrupt can be pending at a time.

Real hardware also doesn't pause for an extended period of time, with
exceptions such as JTAG that aren't as prominent as pausing a virtual
machine.  This is just how Windows works: unless it's S3/S4, it updates
the time from RTC periodic timer ticks, and the frequency sometimes goes
up as much as 1024 or 2048 Hz (default being 64 Hz IIRC).

In fact, we have a lot of cruft in KVM just to track periodic timer
ticks that couldn't be delivered and retry again a little later.  Without
that, the smallest load on the host is enough for time to drift in
Windows guests.

Paolo

> The RTC driver should be able to figure it out from the actual time,
> and it already needs to handle it because this can happen for other
> reasons (e.g. a JTAG debugger)
> 
> -Andi
> 

  reply	other threads:[~2017-10-20 22:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 21:34 qemu polling KVM_IRQ_LINE_STATUS when stopped Andi Kleen
2017-10-18  7:47 ` Paolo Bonzini
2017-10-18 17:49   ` Andi Kleen
2017-10-18 19:24     ` Paolo Bonzini
2017-10-20  0:34       ` Andi Kleen
2017-10-20  8:32         ` Paolo Bonzini
2017-10-20 14:09           ` Andi Kleen
2017-10-20 15:12             ` Paolo Bonzini
2017-10-20 20:50               ` Andi Kleen
2017-10-20 22:51                 ` Paolo Bonzini [this message]
2020-06-25 14:26                   ` Kevin Locke
2020-06-25 16:28                     ` Andi Kleen
2020-06-25 18:41                     ` Paolo Bonzini
2020-06-25 18:56                       ` Kevin Locke
2020-06-25 19:17                         ` Paolo Bonzini
2020-06-25 20:10                           ` Kevin Locke
2020-06-26 15:14                       ` Kevin Locke

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=1560363269.13828538.1508539882580.JavaMail.zimbra@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    /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