Exports iommu_set_entry to the rest of xen. Signed-off-by: Jean Guyader --- diff -r 93ae9939b4a5 xen/drivers/passthrough/iommu.c --- a/xen/drivers/passthrough/iommu.c Mon Nov 15 11:52:14 2010 +0000 +++ b/xen/drivers/passthrough/iommu.c Mon Nov 15 11:53:59 2010 +0000 @@ -418,6 +418,23 @@ ops->suspend(); } +int iommu_set_entry(struct domain *d, unsigned long gfn, unsigned long mfn, + unsigned int flags, int map) +{ + const struct iommu_ops *ops = iommu_get_ops(); + if ( iommu_enabled ) + return ops->set_entry(d, gfn, mfn, flags, map); + return -1; +} + +int iommu_flush_iotlb(struct domain *d, unsigned long gfn, unsigned int nr) +{ + const struct iommu_ops *ops = iommu_get_ops(); + if ( iommu_enabled ) + return ops->flush_iotlb(d, gfn, nr); + return -1; +} + /* * Local variables: * mode: C diff -r 93ae9939b4a5 xen/drivers/passthrough/vtd/iommu.c --- a/xen/drivers/passthrough/vtd/iommu.c Mon Nov 15 11:52:14 2010 +0000 +++ b/xen/drivers/passthrough/vtd/iommu.c Mon Nov 15 11:53:59 2010 +0000 @@ -2197,6 +2197,8 @@ .read_msi_from_ire = msi_msg_read_remap_rte, .suspend = vtd_suspend, .resume = vtd_resume, + .set_entry = intel_iommu_set_entry, + .flush_iotlb = intel_iommu_flush_iotlb }; /* diff -r 93ae9939b4a5 xen/include/xen/iommu.h --- a/xen/include/xen/iommu.h Mon Nov 15 11:52:14 2010 +0000 +++ b/xen/include/xen/iommu.h Mon Nov 15 11:53:59 2010 +0000 @@ -84,6 +84,10 @@ unsigned int flags); int iommu_unmap_page(struct domain *d, unsigned long gfn); +int iommu_set_entry(struct domain *d, unsigned long gfn, unsigned long mfn, + unsigned int flags, int map); +int iommu_flush_iotlb(struct domain *d, unsigned long gfn, unsigned int nr); + void iommu_domain_teardown(struct domain *d); int hvm_do_IRQ_dpci(struct domain *d, unsigned int irq); int dpci_ioport_intercept(ioreq_t *p); @@ -130,6 +134,9 @@ unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg); void (*suspend)(void); void (*resume)(void); + int (*set_entry)(struct domain *d, unsigned long gfn, unsigned long mfn, + unsigned int flags, int map); + int (*flush_iotlb)(struct domain *d, unsigned long gfn, unsigned int nr); }; void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, unsigned int value);