[PATCH 3/5] iommu/amd: Hold the domain lock when calling __unmap_single

2019-09-10 Thread Filippo Sironi via iommu
. Signed-off-by: Filippo Sironi --- drivers/iommu/amd_iommu.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 8e3664821b3c..d4f25767622e 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -2508,6 +2508,7

[PATCH 2/5] iommu/amd: Hold the domain lock when calling __map_single

2019-09-10 Thread Filippo Sironi
__map_single makes several calls to __domain_flush_pages, which traverses the device list that is protected by the domain lock. Also, this is in line with the comment on top of __map_single, which says that the domain lock should be held when calling. Signed-off-by: Filippo Sironi --- drivers

iommu/amd: Flushing and locking fixes

2019-09-10 Thread Filippo Sironi
This patch series introduce patches to take the domain lock whenever we call functions that end up calling __domain_flush_pages. Holding the domain lock is necessary since __domain_flush_pages traverses the device list, which is protected by the domain lock. The first patch in the series adds a c

[PATCH 5/5] iommu/amd: Hold the domain lock when calling domain_flush_tlb[_pde]

2019-09-10 Thread Filippo Sironi
From: Wei Wang domain_flush_tlb[_pde] traverses the device list, which is protected by the domain lock. Signed-off-by: Wei Wang Signed-off-by: Filippo Sironi --- drivers/iommu/amd_iommu.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu

[PATCH 1/5] iommu/amd: Wait for completion of IOTLB flush in attach_device

2019-09-10 Thread Filippo Sironi via iommu
Signed-off-by: Filippo Sironi --- drivers/iommu/amd_iommu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 61de81965c44..f026a8c2b218 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -2169,6 +2169,8

[PATCH 4/5] iommu/amd: Hold the domain lock when calling iommu_map_page

2019-09-10 Thread Filippo Sironi
iommu_map_page calls into __domain_flush_pages, which requires the domain lock since it traverses the device list, which the lock protects. Signed-off-by: Filippo Sironi --- drivers/iommu/amd_iommu.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/iommu/amd_iommu.c b/drivers

[PATCH v2] iommu/vt-d: Don't be too aggressive when clearing one context entry

2017-08-31 Thread Filippo Sironi via iommu
Previously, we were invalidating context cache and IOTLB globally when clearing one context entry. This is a tad too aggressive. Invalidate the context cache and IOTLB for the interested device only. Signed-off-by: Filippo Sironi Cc: David Woodhouse Cc: David Woodhouse Cc: Joerg Roedel Cc

[PATCH] intel-iommu: Don't be too aggressive when clearing one context entry

2017-08-28 Thread Filippo Sironi via iommu
Previously, we were invalidating context cache and IOTLB globally when clearing one context entry. This is a tad too aggressive. Invalidate the context cache and IOTLB for the interested device only. Signed-off-by: Filippo Sironi Cc: David Woodhouse Cc: David Woodhouse Cc: Joerg Roedel Cc