From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v7 15/17] vmx: VT-d posted-interrupt core logic handling Date: Tue, 22 Sep 2015 15:28:12 +0100 Message-ID: <5601657C.7060806@citrix.com> References: <55FFCB67.3050900@citrix.com> <1442842304.2691.67.camel@citrix.com> <1442844706.2691.79.camel@citrix.com> <560130BD.6090700@citrix.com> <56013185.4070200@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Wu, Feng" , Dario Faggioli Cc: "Tian, Kevin" , Keir Fraser , George Dunlap , Andrew Cooper , "xen-devel@lists.xen.org" , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 09/22/2015 02:25 PM, Wu, Feng wrote: >>> But if we want to avoid spurious PI interrupts when running idle, then >>> yes, we need *some* kind of a hook on the lazy context switch path. >>> >>> /me does some more thinking... >> >> To be honest, since we'll be get spurious PI interrupts in the >> hypervisor all the time anyway, I'm inclined at the moment not to worry >> to much about this case. > > Why do you say "we'll be get spurious PI interrupts in the hypervisor all the time"? > > And could you please share what is your concern to handle this case to avoid > such spurious PI interrupts? Thanks! So please correct me if I'm wrong in my understanding: * When a vcpu is in runstate "running", with PI enabled, you have the PI vector set to "posted_interrupt_vector", SN=0. * When in this state in non-root mode, PI interrupts result in an interrupt being delivered directly to the guest. * When in this state in root mode, PI interrupts result in a posted_interrupt_vector interrupt being delivered to Xen. Is that the case? So basically, if the PI happens to come in when the guest is making a hypercall, or the guest is doing any other number of things that involve the hypervisor, then Xen will get a "spurious" PI interrupt -- spurious because there's nothing Xen actually needs to do about it; the guest interrupt will be delivered the next time we do a VMENTER. So spurious PI interrupts are already going to happen from time to time -- they're not really that big of a deal. Having them happen when a VM is running a tasklet or idle waiting for qemu isn't such a big deal either. -George