[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/hvm: implement save/restore for posted interrupts



> From: Zhang, Yang Z
> Sent: Wednesday, July 09, 2014 4:25 AM
> 
> Olaf Hering wrote on 2014-07-03:
> > Saving and restoring a PVonHVM guest on a host which has the VMX "Posted
> > Interrupt Processing" feature enabled will fail because the xen-platform-pci
> > device does not receive interrupts anymore after restore. The reason is that
> > the IRQs are not maintained in APIC_IRR, but in a separate PIR array. This
> info
> > is lost during the save operation.
> >
> > Syncing the PIR state into IRR during save, and restoring the state later 
> > will
> fix
> > 'xm save/restore' of a PVonHVM guest.
> >
> > Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
> > ---
> >
> > Jan suggested to use the TMR flag to set 'trig' for vlapic_set_irq.
> > We are not sure if thats the correct approach, instead of forcing trig=1.
> > Comments are welcome.
> >
> >
> >  xen/arch/x86/hvm/vlapic.c        |  4 ++++
> >  xen/arch/x86/hvm/vmx/vmx.c       | 14 ++++++++++++++
> >  xen/include/asm-x86/hvm/hvm.h    |  1 +
> >  xen/include/asm-x86/hvm/vlapic.h |  2 ++
> >  4 files changed, 21 insertions(+)
> >
> > diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c index
> > cd7e872..7201544 100644
> > --- a/xen/arch/x86/hvm/vlapic.c
> > +++ 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?

Thanks
Kevin

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.