Merge tag 'iommu-fixes-v6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux

Pull iommu fixes from Joerg Roedel:

- Fix a performance regression cause by the new Generic IO-Page-Table
code detected in Intel VT-d driver

- Command queue flushing fix for NVidia version of the ARM-SMMU-v3

* tag 'iommu-fixes-v6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux:
iommu/tegra241-cmdqv: Reset VCMDQ in tegra241_vcmdq_hw_init_user()
iommupt: Only cache flush memory changed by unmap

+13 -1
+3
drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c
··· 1078 { 1079 char header[64]; 1080 1081 /* Configure the vcmdq only; User space does the enabling */ 1082 writeq_relaxed(vcmdq->cmdq.q.q_base, REG_VCMDQ_PAGE1(vcmdq, BASE)); 1083
··· 1078 { 1079 char header[64]; 1080 1081 + /* Reset VCMDQ */ 1082 + tegra241_vcmdq_hw_deinit(vcmdq); 1083 + 1084 /* Configure the vcmdq only; User space does the enabling */ 1085 writeq_relaxed(vcmdq->cmdq.q.q_base, REG_VCMDQ_PAGE1(vcmdq, BASE)); 1086
+10 -1
drivers/iommu/generic_pt/iommu_pt.h
··· 931 struct pt_table_p *table) 932 { 933 struct pt_state pts = pt_init(range, level, table); 934 struct pt_unmap_args *unmap = arg; 935 unsigned int num_oas = 0; 936 unsigned int start_index; ··· 988 iommu_pages_list_add(&unmap->free_list, 989 pts.table_lower); 990 pt_clear_entries(&pts, ilog2(1)); 991 } 992 pts.index++; 993 } else { ··· 1004 num_contig_lg2 = pt_entry_num_contig_lg2(&pts); 1005 pt_clear_entries(&pts, num_contig_lg2); 1006 num_oas += log2_to_int(num_contig_lg2); 1007 pts.index += log2_to_int(num_contig_lg2); 1008 } 1009 if (pts.index >= pts.end_index) 1010 break; ··· 1015 } while (true); 1016 1017 unmap->unmapped += log2_mul(num_oas, pt_table_item_lg2sz(&pts)); 1018 - flush_writes_range(&pts, start_index, pts.index); 1019 1020 return ret; 1021 }
··· 931 struct pt_table_p *table) 932 { 933 struct pt_state pts = pt_init(range, level, table); 934 + unsigned int flush_start_index = UINT_MAX; 935 + unsigned int flush_end_index = UINT_MAX; 936 struct pt_unmap_args *unmap = arg; 937 unsigned int num_oas = 0; 938 unsigned int start_index; ··· 986 iommu_pages_list_add(&unmap->free_list, 987 pts.table_lower); 988 pt_clear_entries(&pts, ilog2(1)); 989 + if (pts.index < flush_start_index) 990 + flush_start_index = pts.index; 991 + flush_end_index = pts.index + 1; 992 } 993 pts.index++; 994 } else { ··· 999 num_contig_lg2 = pt_entry_num_contig_lg2(&pts); 1000 pt_clear_entries(&pts, num_contig_lg2); 1001 num_oas += log2_to_int(num_contig_lg2); 1002 + if (pts.index < flush_start_index) 1003 + flush_start_index = pts.index; 1004 pts.index += log2_to_int(num_contig_lg2); 1005 + flush_end_index = pts.index; 1006 } 1007 if (pts.index >= pts.end_index) 1008 break; ··· 1007 } while (true); 1008 1009 unmap->unmapped += log2_mul(num_oas, pt_table_item_lg2sz(&pts)); 1010 + if (flush_start_index != flush_end_index) 1011 + flush_writes_range(&pts, flush_start_index, flush_end_index); 1012 1013 return ret; 1014 }