ia64/xen-unstable

changeset 15715:e1435c1f3382

hvm: Fix save/restore when callback_via line is routed through a PCI
INTx wire.
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Aug 06 11:08:57 2007 +0100 (2007-08-06)
parents fd20c1333e3e
children b82e6818fb31
files xen/arch/x86/hvm/irq.c
line diff
     1.1 --- a/xen/arch/x86/hvm/irq.c	Mon Aug 06 10:13:34 2007 +0100
     1.2 +++ b/xen/arch/x86/hvm/irq.c	Mon Aug 06 11:08:57 2007 +0100
     1.3 @@ -395,9 +395,33 @@ static void irq_dump(struct domain *d)
     1.4  static int irq_save_pci(struct domain *d, hvm_domain_context_t *h)
     1.5  {
     1.6      struct hvm_irq *hvm_irq = &d->arch.hvm_domain.irq;
     1.7 +    unsigned int asserted, pdev, pintx;
     1.8 +    int rc;
     1.9 +
    1.10 +    spin_lock(&d->arch.hvm_domain.irq_lock);
    1.11 +
    1.12 +    pdev  = hvm_irq->callback_via.pci.dev;
    1.13 +    pintx = hvm_irq->callback_via.pci.intx;
    1.14 +    asserted = (hvm_irq->callback_via_asserted &&
    1.15 +                (hvm_irq->callback_via_type == HVMIRQ_callback_pci_intx));
    1.16 +
    1.17 +    /*
    1.18 +     * Deassert virtual interrupt via PCI INTx line. The virtual interrupt
    1.19 +     * status is not save/restored, so the INTx line must be deasserted in
    1.20 +     * the restore context.
    1.21 +     */
    1.22 +    if ( asserted )
    1.23 +        __hvm_pci_intx_deassert(d, pdev, pintx);
    1.24  
    1.25      /* Save PCI IRQ lines */
    1.26 -    return ( hvm_save_entry(PCI_IRQ, 0, h, &hvm_irq->pci_intx) );
    1.27 +    rc = hvm_save_entry(PCI_IRQ, 0, h, &hvm_irq->pci_intx);
    1.28 +
    1.29 +    if ( asserted )
    1.30 +        __hvm_pci_intx_assert(d, pdev, pintx);    
    1.31 +
    1.32 +    spin_unlock(&d->arch.hvm_domain.irq_lock);
    1.33 +
    1.34 +    return rc;
    1.35  }
    1.36  
    1.37  static int irq_save_isa(struct domain *d, hvm_domain_context_t *h)