From: Keir Fraser Subject: Re: [PATCH 3/4] VMX: Add posted interrupt supporting Date: Tue, 09 Apr 2013 09:14:38 +0100 Message-ID: References: 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: "Zhang, Yang Z" , "xen-devel@lists.xen.org" Cc: "Zhang, Xiantao" , "JBeulich@suse.com" List-Id: xen-devel@lists.xenproject.org On 09/04/2013 08:58, "Zhang, Yang Z" wrote: > If posted interrupt arrived after vmx_intr_assit() and before vmentry, then > the interrupt cannot be inject to guest in time. But pending virtual interrupts are picked up during vmentry aren't they? So if the IPI occurs before vmentry, why is there a race? Isn't the only purpose of __vmx_deliver_posted_interrupt() to ensure that the pending virtual interrupts of the given vcpu get scanned/handled by the appropriate processor? -- Keir > vmx_asm_do_vmentry: > call vmx_intr_assist > call nvmx_switch_guest > ASSERT_NOT_IN_ATOMIC > <---------if posted interrupt arrived here and > we don't set softirq, then the interrupt will be delay until next vmentry. > GET_CURRENT(%rbx) > cli > > mov VCPU_processor(%rbx),%eax > shl $IRQSTAT_shift,%eax > lea irq_stat+IRQSTAT_softirq_pending(%rip),%rdx > cmpl $0,(%rdx,%rax,1) > jnz .Lvmx_process_softirqs > > Actually, the posted interrupt is same with a normal vcpu kick IPI, except > that if cpu received it in non-root mode, it will not cause vmext. So we must > follow the vcpu_kick logic.