Isaku Yamahata
2009-Mar-03 03:02 UTC
[Xen-devel] [PATCH] hvm: passthrough MSI-X: fix ia64 link and MSI-X clean up
hvm: passthrough MSI-X: fix ia64 link and MSI-X clean up This patch fixes the ia64 link error and some clean up of MSI-X code. - add ia64 dummy function to link - fix unmatched prototype - add error check Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> diff --git a/xen/arch/ia64/vmx/vmx_interrupt.c b/xen/arch/ia64/vmx/vmx_interrupt.c --- a/xen/arch/ia64/vmx/vmx_interrupt.c +++ b/xen/arch/ia64/vmx/vmx_interrupt.c @@ -154,3 +154,14 @@ void hvm_isa_irq_deassert(struct domain { /* dummy */ } + +int msixtbl_pt_register(struct domain *d, int pirq, uint64_t gtable) +{ + /* dummy */ + return -ENOSYS; +} + +void msixtbl_pt_unregister(struct domain *d, int pirq) +{ + /* dummy */ +} diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -58,9 +58,6 @@ static void pt_irq_time_out(void *data) pirq_guest_eoi(irq_map->dom, machine_gsi); } -extern int msixtbl_pt_register(struct domain *d, int pirq, uint64_t gtable); -extern int msixtbl_pt_unregister(struct domain *d, int pirq); - int pt_irq_create_bind_vtd( struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind) { @@ -108,6 +105,12 @@ int pt_irq_create_bind_vtd( hvm_irq_dpci->msi_gvec_pirq[pt_irq_bind->u.msi.gvec] = pirq; /* bind after hvm_irq_dpci is setup to avoid race with irq handler*/ rc = pirq_guest_bind(d->vcpu[0], pirq, 0); + if ( rc == 0 && pt_irq_bind->u.msi.gtable ) + { + rc = msixtbl_pt_register(d, pirq, pt_irq_bind->u.msi.gtable); + if ( unlikely(rc) ) + pirq_guest_unbind(d, pirq); + } if ( unlikely(rc) ) { hvm_irq_dpci->msi_gvec_pirq[pt_irq_bind->u.msi.gvec] = 0; @@ -118,8 +121,6 @@ int pt_irq_create_bind_vtd( spin_unlock(&d->event_lock); return rc; } - if ( pt_irq_bind->u.msi.gtable ) - msixtbl_pt_register(d, pirq, pt_irq_bind->u.msi.gtable); } else if (hvm_irq_dpci->mirq[pirq].gmsi.gvec != pt_irq_bind->u.msi.gvec ||hvm_irq_dpci->msi_gvec_pirq[pt_irq_bind->u.msi.gvec] != pirq) diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h --- a/xen/include/xen/pci.h +++ b/xen/include/xen/pci.h @@ -85,4 +85,7 @@ void pci_conf_write32( int pci_find_cap_offset(u8 bus, u8 dev, u8 func, u8 cap); int pci_find_next_cap(u8 bus, unsigned int devfn, u8 pos, int cap); +int msixtbl_pt_register(struct domain *d, int pirq, uint64_t gtable); +void msixtbl_pt_unregister(struct domain *d, int pirq); + #endif /* __XEN_PCI_H__ */ -- yamahata _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel