diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2007-11-23 16:39:45 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2007-11-23 16:39:45 +0000 |
commit | 29c4a80b7449ea5d95a74d38c87b5c471102ce7d (patch) | |
tree | af96368432a3acde4dd1d3bb0be2456a51f249d3 /xen/arch/x86/hvm/irq.c | |
parent | 9ebc5c7ea6e855d71d75b985c4a9ed6cc9f353e2 (diff) | |
download | xen-29c4a80b7449ea5d95a74d38c87b5c471102ce7d.tar.gz xen-29c4a80b7449ea5d95a74d38c87b5c471102ce7d.tar.bz2 xen-29c4a80b7449ea5d95a74d38c87b5c471102ce7d.zip |
vt-d: Fix ISA IRQ alias issue
When assign multiple devices to guest which uses PIC, ISA IRQ alias
may occur. This patch splits ISA IRQ and GSI eoi function. In ISA IRQ
eoi function, searches all assigned mirqs and does eoi for the
corresponding mirqs which match the eoi ISA IRQ. Therefore fix ISA IRQ
alias issue.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Diffstat (limited to 'xen/arch/x86/hvm/irq.c')
-rw-r--r-- | xen/arch/x86/hvm/irq.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c index ecff77f01f..de21d0f357 100644 --- a/xen/arch/x86/hvm/irq.c +++ b/xen/arch/x86/hvm/irq.c @@ -181,6 +181,7 @@ void hvm_set_pci_link_route(struct domain *d, u8 link, u8 isa_irq) { struct hvm_irq *hvm_irq = &d->arch.hvm_domain.irq; u8 old_isa_irq; + int i; ASSERT((link <= 3) && (isa_irq <= 15)); @@ -192,12 +193,16 @@ void hvm_set_pci_link_route(struct domain *d, u8 link, u8 isa_irq) hvm_irq->pci_link.route[link] = isa_irq; /* PCI pass-through fixup. */ - if ( hvm_irq->dpci && hvm_irq->dpci->link[link].valid ) + if ( hvm_irq->dpci ) { - hvm_irq->dpci->girq[isa_irq] = hvm_irq->dpci->link[link]; - if ( hvm_irq->dpci->girq[old_isa_irq].device == - hvm_irq->dpci->link[link].device ) - hvm_irq->dpci->girq[old_isa_irq].valid = 0; + if ( old_isa_irq ) + clear_bit(old_isa_irq, &hvm_irq->dpci->isairq_map); + + for ( i = 0; i < NR_LINK; i++ ) + if ( test_bit(i, &hvm_irq->dpci->link_map) && + hvm_irq->pci_link.route[i] ) + set_bit(hvm_irq->pci_link.route[i], + &hvm_irq->dpci->isairq_map); } if ( hvm_irq->pci_link_assert_count[link] == 0 ) |