From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH] x86/hvm: implement save/restore for posted interrupts Date: Wed, 16 Jul 2014 16:28:44 +0200 Message-ID: <20140716142844.GA13820@aepfle.de> References: <1404400159-27346-1-git-send-email-olaf@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline 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: "Tian, Kevin" Cc: Keir Fraser , "Nakajima, Jun" , "Dong, Eddie" , "xen-devel@lists.xen.org" , "Xu, Dongxiao" , Jan Beulich , "Zhang, Yang Z" List-Id: xen-devel@lists.xenproject.org On Wed, Jul 09, Tian, Kevin wrote: > > From: Zhang, Yang Z > > > +++ b/xen/arch/x86/hvm/vlapic.c > > > @@ -1179,6 +1179,8 @@ static int lapic_save_regs(struct domain *d, > > > hvm_domain_context_t *h) > > > > > > for_each_vcpu ( d, v ) > > > { > > > + if ( hvm_funcs.sync_pir_to_irr ) > > > + hvm_funcs.sync_pir_to_irr(v); > > > s = vcpu_vlapic(v); > > > if ( (rc = hvm_save_entry(LAPIC_REGS, v->vcpu_id, h, s->regs)) != > > 0 ) > > > break; > > > @@ -1230,6 +1232,8 @@ static int lapic_load_regs(struct domain *d, > > > hvm_domain_context_t *h) > > > if ( hvm_load_entry(LAPIC_REGS, h, s->regs) != 0 ) > > > return -EINVAL; > > > > > > + if ( hvm_funcs.sync_irr_to_pir ) > > > + hvm_funcs.sync_irr_to_pir(v); > > This is redundant. Interrupt pending in irr will be injected to guest correctly, so > > there is no need to sync it to pir. > agree. pending irr has to be injected somewhere after restore, and at that point > irr->pir has already been covered. otherwise it'd be a more general issue. > could you try whether only adding sync_pir_to_irr is enough? It continues to fail if I change just lapic_save_regs. Olaf