Skip to content

Commit 4c2c526

Browse files
committed
Merge tag 'iommu-fixes-v7.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux
Pull iommu fixes from Joerg Roedel: - IOMMU-PT related compile breakage in for AMD driver - IOTLB flushing behavior when unmapped region is larger than requested due to page-sizes - Fix IOTLB flush behavior with empty gathers * tag 'iommu-fixes-v7.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux: iommupt/amdv1: mark amdv1pt_install_leaf_entry as __always_inline iommupt: Fix short gather if the unmap goes into a large mapping iommu: Do not call drivers for empty gathers
2 parents 2ec9074 + 8b72aa5 commit 4c2c526

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/iommu/generic_pt/fmt/amdv1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static inline enum pt_entry_type amdv1pt_load_entry_raw(struct pt_state *pts)
191191
}
192192
#define pt_load_entry_raw amdv1pt_load_entry_raw
193193

194-
static inline void
194+
static __always_inline void
195195
amdv1pt_install_leaf_entry(struct pt_state *pts, pt_oaddr_t oa,
196196
unsigned int oasz_lg2,
197197
const struct pt_write_attrs *attrs)

drivers/iommu/generic_pt/iommu_pt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ size_t DOMAIN_NS(unmap_pages)(struct iommu_domain *domain, unsigned long iova,
10571057

10581058
pt_walk_range(&range, __unmap_range, &unmap);
10591059

1060-
gather_range_pages(iotlb_gather, iommu_table, iova, len,
1060+
gather_range_pages(iotlb_gather, iommu_table, iova, unmap.unmapped,
10611061
&unmap.free_list);
10621062

10631063
return unmap.unmapped;

include/linux/iommu.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,8 @@ static inline void iommu_flush_iotlb_all(struct iommu_domain *domain)
980980
static inline void iommu_iotlb_sync(struct iommu_domain *domain,
981981
struct iommu_iotlb_gather *iotlb_gather)
982982
{
983-
if (domain->ops->iotlb_sync)
983+
if (domain->ops->iotlb_sync &&
984+
likely(iotlb_gather->start < iotlb_gather->end))
984985
domain->ops->iotlb_sync(domain, iotlb_gather);
985986

986987
iommu_iotlb_gather_init(iotlb_gather);

0 commit comments

Comments
 (0)