From 0d3f767f4cd5a30909b8c9d76e15e10a45d7a05d Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Mon, 14 Jul 2014 17:54:49 +0200 Subject: [PATCH] Revert "VT-d: drop redundant calls to invalidate_sync()" This reverts commit dd6d87a4fcc8350c752e389abb3bcd8479c37555. The call tree iommu_flush_iec_index() -> __iommu_flush_iec() already invokes invalidate_sync(). Removing the superfluous instances at once allows the function to become static. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Acked-by: Yang Zhang --- xen/drivers/passthrough/vtd/extern.h | 1 + xen/drivers/passthrough/vtd/intremap.c | 2 ++ xen/drivers/passthrough/vtd/qinval.c | 2 +- 3 files changed, 4 insertions(+), 1 deletions(-) diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h index 5524dba..92ec343 100644 --- a/xen/drivers/passthrough/vtd/extern.h +++ b/xen/drivers/passthrough/vtd/extern.h @@ -42,6 +42,7 @@ void iommu_flush_cache_page(void *addr, unsigned long npages); int iommu_alloc(struct acpi_drhd_unit *drhd); void iommu_free(struct acpi_drhd_unit *drhd); +int invalidate_sync(struct iommu *iommu); int iommu_flush_iec_global(struct iommu *iommu); int iommu_flush_iec_index(struct iommu *iommu, u8 im, u16 iidx); void clear_fault_bits(struct iommu *iommu); diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c index 0333686..07c6dac 100644 --- a/xen/drivers/passthrough/vtd/intremap.c +++ b/xen/drivers/passthrough/vtd/intremap.c @@ -358,6 +358,7 @@ static int ioapic_rte_to_remap_entry(struct iommu *iommu, memcpy(iremap_entry, &new_ire, sizeof(struct iremap_entry)); iommu_flush_cache_entry(iremap_entry, sizeof(struct iremap_entry)); iommu_flush_iec_index(iommu, 0, index); + invalidate_sync(iommu); unmap_vtd_domain_page(iremap_entries); spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags); @@ -642,6 +643,7 @@ static int msi_msg_to_remap_entry( memcpy(iremap_entry, &new_ire, sizeof(struct iremap_entry)); iommu_flush_cache_entry(iremap_entry, sizeof(struct iremap_entry)); iommu_flush_iec_index(iommu, 0, index); + invalidate_sync(iommu); unmap_vtd_domain_page(iremap_entries); spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags); diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c index 4603020..deee376 100644 --- a/xen/drivers/passthrough/vtd/qinval.c +++ b/xen/drivers/passthrough/vtd/qinval.c @@ -181,7 +181,7 @@ static int queue_invalidate_wait(struct iommu *iommu, return -EOPNOTSUPP; } -static int invalidate_sync(struct iommu *iommu) +int invalidate_sync(struct iommu *iommu) { struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu); -- 1.7.7.5 (Apple Git-26)