IOMMU Fixes for Linux v6.19-rc7

Including:
 
 	- Fix a performance regression cause by new Generic
 	  IO-Page-Table code detected in Intel VT-d driver.
 
 	- Command queue flushing fix for NVidia version of the
 	  ARM-SMMU-v3
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEr9jSbILcajRFYWYyK/BELZcBGuMFAml+LeMACgkQK/BELZcB
 GuPi4xAA5T7+RG/KG244Wtb+jjiYg8FabKkPtubWw4PD3fVo2KW3Zkt3xHUtznDL
 Lpm5Ywb7yJ2pgwy4E4H4mE3wkVAWy9K4WNzv+jr++SxXktBBi52xrqAzJspbQUGd
 Twrdh7CGeoHQnuEVAm0OnUDA0JKx6/tLPI3XCHNH0zdas5eKnODDpE2w0etDpuTE
 +fRXc+n2Z2P7UzjDBBrjb5xM+SyN0ImuBqk11D3psye2zZu/KLXZskLpwtNRm+fr
 Jzl5LkTcOwCHk/Do/ZW2SpJLMV4p70QympEJRCfWu/wca+0R9APNdhUFlTPazKSj
 eo+SUSUBYo7LTmrR4asyEr1UCEI0M+OCZAhYKQzVKNyPCFnnnKCufH6oTyxX17I4
 nDg5piCtedwU9rUjX0VqRmx3ZA+0dILfcOGsgWV4mOvbO0nuQk6PHXfgTd3Fzdnh
 2yjaUFWwUN/edCZHQAtk1RqmPu3LLXeUsx1eMngJlivHljMtGKGD18vmZzXZUNZL
 aG/H5FRVDX63mNZNJyC90SWx3LMmhmOAWWBbvRTXtL3xvLgd6j+ZYYSwnghnYmpn
 c9BE+POvLexRrRNXAFEChTHt9K2IWuPxBqGHOjLmM0Nds+lP0Ixh5EjuwpJW0gSY
 k+z9MLtFFI3TJn6S3h7SAQpc7ngDiHfvxKSfcRZ1YwZIDXLwM3Q=
 =/mf8
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2026-01-31 09:40:13 -08:00
commit 162b42445b
2 changed files with 13 additions and 1 deletions

View File

@ -1078,6 +1078,9 @@ static int tegra241_vcmdq_hw_init_user(struct tegra241_vcmdq *vcmdq)
{
char header[64];
/* Reset VCMDQ */
tegra241_vcmdq_hw_deinit(vcmdq);
/* Configure the vcmdq only; User space does the enabling */
writeq_relaxed(vcmdq->cmdq.q.q_base, REG_VCMDQ_PAGE1(vcmdq, BASE));

View File

@ -931,6 +931,8 @@ static __maybe_unused int __unmap_range(struct pt_range *range, void *arg,
struct pt_table_p *table)
{
struct pt_state pts = pt_init(range, level, table);
unsigned int flush_start_index = UINT_MAX;
unsigned int flush_end_index = UINT_MAX;
struct pt_unmap_args *unmap = arg;
unsigned int num_oas = 0;
unsigned int start_index;
@ -986,6 +988,9 @@ static __maybe_unused int __unmap_range(struct pt_range *range, void *arg,
iommu_pages_list_add(&unmap->free_list,
pts.table_lower);
pt_clear_entries(&pts, ilog2(1));
if (pts.index < flush_start_index)
flush_start_index = pts.index;
flush_end_index = pts.index + 1;
}
pts.index++;
} else {
@ -999,7 +1004,10 @@ start_oa:
num_contig_lg2 = pt_entry_num_contig_lg2(&pts);
pt_clear_entries(&pts, num_contig_lg2);
num_oas += log2_to_int(num_contig_lg2);
if (pts.index < flush_start_index)
flush_start_index = pts.index;
pts.index += log2_to_int(num_contig_lg2);
flush_end_index = pts.index;
}
if (pts.index >= pts.end_index)
break;
@ -1007,7 +1015,8 @@ start_oa:
} while (true);
unmap->unmapped += log2_mul(num_oas, pt_table_item_lg2sz(&pts));
flush_writes_range(&pts, start_index, pts.index);
if (flush_start_index != flush_end_index)
flush_writes_range(&pts, flush_start_index, flush_end_index);
return ret;
}