]> git.karo-electronics.de Git - linux-beck.git/commitdiff
intel-iommu mistakenly uses offset_pfn when caching mode is enabled
authorNadav Amit <nadav.amit@gmail.com>
Thu, 1 Apr 2010 10:24:35 +0000 (13:24 +0300)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 9 Apr 2010 14:38:47 +0000 (15:38 +0100)
intel_map_sg used offset_pfn which was set to zero when invalidating the IOTLB.
intel_map_sg now uses size variable for this matter.

Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/pci/intel-iommu.c

index a0ac7197ffddf55524583e86f6bc7980f1b5e7dc..341da41cde8bd86389e73fd88c4bfbfe8d93c896 100644 (file)
@@ -2860,7 +2860,6 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int ne
        struct dmar_domain *domain;
        size_t size = 0;
        int prot = 0;
-       size_t offset_pfn = 0;
        struct iova *iova = NULL;
        int ret;
        struct scatterlist *sg;
@@ -2914,7 +2913,7 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int ne
 
        /* it's a non-present to present mapping. Only flush if caching mode */
        if (cap_caching_mode(iommu->cap))
-               iommu_flush_iotlb_psi(iommu, 0, start_vpfn, offset_pfn);
+               iommu_flush_iotlb_psi(iommu, 0, start_vpfn, size);
        else
                iommu_flush_write_buffer(iommu);