On Tue, 2008-12-02 at 22:22 +0800, Han, Weidong wrote:
> For some common low level functions which will be also used by virtual
> machine usage, use domain_flush_cache instead of __iommu_flush_cache.
>
> Signed-off-by: Weidong Han <[EMAIL PROTECTED]>
> ---
> drivers/pci/intel-iommu.c | 40 ++++++++++++++++++++++++----------------
> 1 files changed, 24 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
> index 429aff4..b00a8f2 100644
> --- a/drivers/pci/intel-iommu.c
> +++ b/drivers/pci/intel-iommu.c
> @@ -200,6 +200,13 @@ static struct intel_iommu *domain_get_iommu(struct
> dmar_domain *domain)
> return NULL;
> }
>
> +static void domain_flush_cache(struct dmar_domain *domain,
> + void *addr, int size)
> +{
> + if (!domain->iommu_coherency)
> + clflush_cache_range(addr, size);
> +}
This is quite unfortunate; __iommu_flush_cache() is essentially
identical:
static inline void __iommu_flush_cache(
struct intel_iommu *iommu, void *addr, int size)
{
if (!ecap_coherent(iommu->ecap))
clflush_cache_range(addr, size);
}
Is there no way we can use a single function for both purposes?
Cheers,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html