public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: "Zhang, Yang Z" <yang.z.zhang@intel.com>,
	Avi Kivity <avi.kivity@gmail.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting
Date: Mon, 25 Feb 2013 11:00:22 -0300	[thread overview]
Message-ID: <20130225140021.GC2057@amt.cnet> (raw)
In-Reply-To: <20130225133419.GH21422@redhat.com>

On Mon, Feb 25, 2013 at 03:34:19PM +0200, Gleb Natapov wrote:
> On Mon, Feb 25, 2013 at 11:13:25AM +0000, Zhang, Yang Z wrote:
> > Gleb Natapov wrote on 2013-02-25:
> > > On Mon, Feb 25, 2013 at 11:04:25AM +0000, Zhang, Yang Z wrote:
> > >> Gleb Natapov wrote on 2013-02-25:
> > >>> On Mon, Feb 25, 2013 at 08:42:52AM +0000, Zhang, Yang Z wrote:
> > >>>> Avi Kivity wrote on 2013-02-25:
> > >>>>> I didn't really follow, but is the root cause the need to keep track
> > >>>>> of interrupt coalescing?  If so we can recommend that users use
> > >>>>> KVM_IRQ_LINE when coalescing is unneeded, and move interrupt
> > >>>>> injection with irq coalescing support to vcpu context.
> > >>>> So we can hide the capability KVM_CAP_IRQ_INJECT_STATUS when posted
> > >>> interrupt is enabled to force users doesn't to use
> > >>> KVM_IRQ_LINE_STATUS. Does this acceptable?
> > >>>> 
> > >>>> The only case in KVM that need to know the interrupt injection status is
> > > vlapic
> > >>> timer. But since vlapic timer and vcpu are always in same pcpu, so there is no
> > >>> problem.
> > >>>> 
> > >>> Not really. The primary user of this interface is RTC interrupt
> > >>> re-injection for Windows guests.
> > >> So without KVM_IRQ_LINE_STATUS capability, RTC cannot work well?
> > >> 
> > > Windows guests may experience timedrift under CPU overcommit scenario.
> > Ok, I see. Seems we are stuck. :(
> > Do you have any suggestion to solve or workaround current problem?
> > 
> I see a couple of possible solutions:
> 1. Do what Avi said. Make KVM_IRQ_LINE_STATUS be synchronous. Cons:
> current QEMU uses KVM_IRQ_LINE_STATUS always and it means that it
> will be slow on newer kernels

Can add a capability to QEMU and enable APICv selectively only 
in newer QEMU, which can issue KVM_IRQ_LINE_STATUS on target vcpu
only when necessary (and KVM_IRQ_LINE otherwise).

Even a lock serializing injection is not safe because ON bit is cleared
before XCHG(PIR, 0). Must do something heavier (such as running on
target vcpu context).

> 2. Make KVM_IRQ_LINE_STATUS report coalescing only when vcpu is not
> running during injection. This assumes that if vcpu is running and does
> not process interrupt it is guest fault and the same can happen on real
> HW too. Coalescing when vcpu is not running though is the result of CPU
> overcommit and should be reported. Cons interface definition is kind of
> murky.
> 3. Do not report KVM_IRQ_LINE_STATUS capability and move RTC to use EOI
> notifiers for interrupt reinjection. This requires us to add interface
> for reporting EOI to userspace. This is not in the scope of this
> patchset. Cons: need to introduce new interface (and the one that will
> not work on AMD BTW)

Breaks older userspace?
> 
> Other ideas?

Can HW write a 'finished' bit after 6 in the reserved area? Suppose its
not a KVM-specific problem?


  reply	other threads:[~2013-02-25 14:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-22 13:42 [PATCH v4 0/2] KVM: VMX: Add Posted Interrupt supporting Yang Zhang
2013-02-22 13:42 ` [PATCH v4 1/2] KVM: VMX: enable acknowledge interupt on vmexit Yang Zhang
2013-02-22 13:42 ` [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting Yang Zhang
2013-02-23 13:43   ` Marcelo Tosatti
2013-02-23 14:05     ` Zhang, Yang Z
2013-02-23 14:35       ` Gleb Natapov
2013-02-23 14:48         ` Marcelo Tosatti
2013-02-23 15:31           ` Gleb Natapov
2013-02-23 17:05             ` Marcelo Tosatti
2013-02-23 19:42               ` Gleb Natapov
2013-02-23 19:52                 ` Marcelo Tosatti
2013-02-23 19:59                   ` Gleb Natapov
2013-02-24 13:55                 ` Zhang, Yang Z
2013-02-24 14:19                   ` Gleb Natapov
2013-02-24 14:26                     ` Zhang, Yang Z
2013-02-24 14:39                       ` Gleb Natapov
2013-02-24 18:08                     ` Marcelo Tosatti
2013-02-24 18:59                       ` Avi Kivity
2013-02-25  8:42                         ` Zhang, Yang Z
2013-02-25 11:01                           ` Gleb Natapov
2013-02-25 11:04                             ` Zhang, Yang Z
2013-02-25 11:07                               ` Gleb Natapov
2013-02-25 11:13                                 ` Zhang, Yang Z
2013-02-25 12:49                                   ` Marcelo Tosatti
2013-02-25 12:52                                     ` Zhang, Yang Z
2013-02-25 13:34                                   ` Gleb Natapov
2013-02-25 14:00                                     ` Marcelo Tosatti [this message]
2013-02-25 14:17                                       ` Marcelo Tosatti
2013-02-25 17:40                                         ` Gleb Natapov
2013-02-25 22:29                                           ` Marcelo Tosatti
2013-02-25 16:50                                     ` Avi Kivity
2013-02-25 17:43                                       ` Gleb Natapov
2013-02-25 18:56                                         ` Avi Kivity
2013-02-25 19:01                                           ` Gleb Natapov
2013-02-26  8:12                                             ` Gleb Natapov
2013-02-26 16:13                                               ` Avi Kivity
2013-02-24 17:44                   ` Marcelo Tosatti
2013-02-25  7:24                     ` Zhang, Yang Z
2013-02-23 14:44       ` Marcelo Tosatti
2013-02-23 15:16         ` Zhang, Yang Z
2013-02-23 16:50           ` Marcelo Tosatti
2013-02-24 13:17             ` Zhang, Yang Z
2013-02-24 17:39               ` Marcelo Tosatti
2013-02-25  6:55                 ` Zhang, Yang Z
2013-02-25 13:01                   ` Marcelo Tosatti
2013-02-25 14:32                     ` Zhang, Yang Z

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=20130225140021.GC2057@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=avi.kivity@gmail.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=xiantao.zhang@intel.com \
    --cc=yang.z.zhang@intel.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