ia64/xen-unstable

changeset 17833:54c6fc432763

AMD IOMMU: Enable MSI for hvm guest
Signed-off-by: Wei Wang <wei.wang2@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Jun 11 15:18:26 2008 +0100 (2008-06-11)
parents 7c771f0a24f3
children 0331bfd8b5d2
files xen/arch/x86/hvm/svm/intr.c
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/intr.c	Wed Jun 11 11:35:35 2008 +0100
     1.2 +++ b/xen/arch/x86/hvm/svm/intr.c	Wed Jun 11 15:18:26 2008 +0100
     1.3 @@ -100,6 +100,12 @@ static void enable_intr_window(struct vc
     1.4      vmcb->general1_intercepts |= GENERAL1_INTERCEPT_VINTR;
     1.5  }
     1.6  
     1.7 +extern int vmsi_deliver(struct domain *d, int pirq);
     1.8 +static int hvm_pci_msi_assert(struct domain *d, int pirq)
     1.9 +{
    1.10 +    return vmsi_deliver(d, pirq);
    1.11 +}
    1.12 +
    1.13  static void svm_dirq_assist(struct vcpu *v)
    1.14  {
    1.15      unsigned int irq;
    1.16 @@ -118,7 +124,13 @@ static void svm_dirq_assist(struct vcpu 
    1.17          if ( !test_and_clear_bit(irq, &hvm_irq_dpci->dirq_mask) )
    1.18              continue;
    1.19  
    1.20 -        stop_timer(&hvm_irq_dpci->hvm_timer[irq_to_vector(irq)]);
    1.21 +        if ( test_bit(_HVM_IRQ_DPCI_MSI, &hvm_irq_dpci->mirq[irq].flags) )
    1.22 +        {
    1.23 +            hvm_pci_msi_assert(d, irq);
    1.24 +            continue;
    1.25 +        }
    1.26 +
    1.27 +        stop_timer(&hvm_irq_dpci->hvm_timer[domain_irq_to_vector(d, irq)]);
    1.28  
    1.29          list_for_each_entry ( digl, &hvm_irq_dpci->mirq[irq].digl_list, list )
    1.30          {
    1.31 @@ -137,7 +149,7 @@ static void svm_dirq_assist(struct vcpu 
    1.32           * guest will never deal with the irq, then the physical interrupt line
    1.33           * will never be deasserted.
    1.34           */
    1.35 -        set_timer(&hvm_irq_dpci->hvm_timer[irq_to_vector(irq)],
    1.36 +        set_timer(&hvm_irq_dpci->hvm_timer[domain_irq_to_vector(d, irq)],
    1.37                    NOW() + PT_IRQ_TIME_OUT);
    1.38      }
    1.39  }