Hi Jason Am 27.02.26 um 20:30 schrieb Jason Gunthorpe: > Currently the core code provides a simplified interface to drivers where > it fragments a requested multi-page map into single page size steps after > doing all the calculations to figure out what page size is > appropriate. Each step rewalks the page tables from the start. > > Since iommupt has a single implementation of the mapping algorithm it can > internally compute each step as it goes while retaining its current > position in the walk. > > Add a new function pt_pgsz_count() which computes the same page size > fragement of a large mapping operations. > > Compute the next fragment when all the leaf entries of the current > fragement have been written, then continue walking from the current > point. > > The function pointer is run through pt_iommu_ops instead of > iommu_domain_ops to discourage using it outside iommupt. All drivers with > their own page tables should continue to use the simplified map_pages() > style interfaces. > > Reviewed-by: Samiullah Khawaja > Reviewed-by: Kevin Tian > Signed-off-by: Jason Gunthorpe > --- > drivers/iommu/generic_pt/iommu_pt.h | 133 ++++++++++++-------- > drivers/iommu/generic_pt/kunit_generic_pt.h | 12 ++ > drivers/iommu/generic_pt/pt_iter.h | 22 ++++ > drivers/iommu/iommu.c | 39 ++++-- > include/linux/generic_pt/iommu.h | 34 ++++- > 5 files changed, 175 insertions(+), 65 deletions(-) This patch has landed in v7.1-rc1 and introduced a regression on the arm64 SolidRun LX2160A Clearfog-CX board. Since d6c65b0fd621 ("iommupt: Avoid rewalking during map"), boot now stalls - printing many smmu errors. Please find attached full boot logs for reference: - good.txt @ 99fb8afa16ad - bad.txt @ d6c65b0fd621 - config.txt: .config from the build Is there any advice how to deal with this? Below extract from failed boot log: [    0.870157] iommu: Default domain type: Translated [    0.870160] iommu: DMA domain TLB invalidation policy: strict mode ... [    2.157846] arm-smmu 5000000.iommu: probing hardware configuration... [    2.157851] arm-smmu 5000000.iommu: SMMUv2 with: [    2.157854] arm-smmu 5000000.iommu:  stage 1 translation [    2.157856] arm-smmu 5000000.iommu:  stage 2 translation [    2.157858] arm-smmu 5000000.iommu:  nested translation [    2.157861] arm-smmu 5000000.iommu:  coherent table walk [    2.157863] arm-smmu 5000000.iommu:  (IDR0.CTTW overridden by FW configuration) [    2.157866] arm-smmu 5000000.iommu:  stream matching with 128 register groups [    2.157869] arm-smmu 5000000.iommu:  64 context banks (0 stage-2 only) [    2.157873] arm-smmu 5000000.iommu:  Supported page sizes: 0x61311000 [    2.157876] arm-smmu 5000000.iommu:  Stage-1: 48-bit VA -> 48-bit IPA [    2.157878] arm-smmu 5000000.iommu:  Stage-2: 48-bit IPA -> 48-bit PA [    2.158058] arm-smmu 5000000.iommu:  preserved 0 boot mappings ... [    2.276090] arm-smmu 5000000.iommu: Unhandled context fault: fsr=0x402, iova=0x27e0bffee0, fsynr=0x230010, cbfrsynra=0x4000, cb=8 [    2.276097] arm-smmu 5000000.iommu: FSR    = 00000402 [Format=2 TF], SID=0x4000 [    2.276102] arm-smmu 5000000.iommu: FSYNR0 = 00230010 [S1CBNDX=35 WNR PLVL=0] ... [   17.280621] arm-smmu 5000000.iommu: Unhandled context fault: fsr=0x402, iova=0x27e0bffee0, fsynr=0x230010, cbfrsynra=0x4000, cb=8 [   17.280626] arm-smmu 5000000.iommu: FSR    = 00000402 [Format=2 TF], SID=0x4000 [   17.280630] arm-smmu 5000000.iommu: FSYNR0 = 00230010 [S1CBNDX=35 WNR PLVL=0] [   17.280656] arm-smmu 5000000.iommu: Unhandled context fault: fsr=0x402, iova=0x27e0000100, fsynr=0x230040, cbfrsynra=0x4000, cb=8 ... [   17.280660] arm-smmu 5000000.iommu: FSR    = 00000402 [Format=2 TF], SID=0x4000 [   17.280664] arm-smmu 5000000.iommu: FSYNR0 = 00230040 [S1CBNDX=35 IND PLVL=0] ... [   17.280694] arm-smmu 5000000.iommu: Unhandled context fault: fsr=0x402, iova=0x27e0000100, fsynr=0x230040, cbfrsynra=0x4000, cb=8 [   17.280697] arm-smmu 5000000.iommu: FSR    = 00000402 [Format=2 TF], SID=0x4000 [   17.280700] arm-smmu 5000000.iommu: FSYNR0 = 00230040 [S1CBNDX=35 IND PLVL=0] [   17.280708] arm-smmu 5000000.iommu: Unhandled context fault: fsr=0x402, iova=0x27e0000100, fsynr=0x230040, cbfrsynra=0x4000, cb=8 [   17.280711] arm-smmu 5000000.iommu: FSR    = 00000402 [Format=2 TF], SID=0x4000 [   17.280715] arm-smmu 5000000.iommu: FSYNR0 = 00230040 [S1CBNDX=35 IND PLVL=0] [   17.280721] arm-smmu 5000000.iommu: Unhandled context fault: fsr=0x402, iova=0x27e0000100, fsynr=0x230040, cbfrsynra=0x4000, cb=8 [   17.280724] arm-smmu 5000000.iommu: FSR    = 00000402 [Format=2 TF], SID=0x4000 [   17.280727] arm-smmu 5000000.iommu: FSYNR0 = 00230040 [S1CBNDX=35 IND PLVL=0] [   17.280732] arm-smmu 5000000.iommu: Unhandled context fault: fsr=0x402, iova=0x27e0000100, fsynr=0x230040, cbfrsynra=0x4000, cb=8 [   17.280735] arm-smmu 5000000.iommu: FSR    = 00000402 [Format=2 TF], SID=0x4000 [   17.280738] arm-smmu 5000000.iommu: FSYNR0 = 00230040 [S1CBNDX=35 IND PLVL=0] [   17.280743] arm-smmu 5000000.iommu: Unhandled context fault: fsr=0x402, iova=0x27e0000100, fsynr=0x230040, cbfrsynra=0x4000, cb=8 [   17.280746] arm-smmu 5000000.iommu: FSR    = 00000402 [Format=2 TF], SID=0x4000 [   17.280750] arm-smmu 5000000.iommu: FSYNR0 = 00230040 [S1CBNDX=35 IND PLVL=0] [   17.280755] arm-smmu 5000000.iommu: Unhandled context fault: fsr=0x402, iova=0x27e0000100, fsynr=0x230040, cbfrsynra=0x4000, cb=8 [   17.280758] arm-smmu 5000000.iommu: FSR    = 00000402 [Format=2 TF], SID=0x4000 [   17.280761] arm-smmu 5000000.iommu: FSYNR0 = 00230040 [S1CBNDX=35 IND PLVL=0] [   17.280766] arm-smmu 5000000.iommu: Unhandled context fault: fsr=0x402, iova=0x27e0000100, fsynr=0x230040, cbfrsynra=0x4000, cb=8 [   17.280769] arm-smmu 5000000.iommu: FSR    = 00000402 [Format=2 TF], SID=0x4000 [   17.280772] arm-smmu 5000000.iommu: FSYNR0 = 00230040 [S1CBNDX=35 IND PLVL=0] [   17.280777] arm-smmu 5000000.iommu: Unhandled context fault: fsr=0x402, iova=0x27e0000100, fsynr=0x230040, cbfrsynra=0x4000, cb=8 [   17.280780] arm-smmu 5000000.iommu: FSR    = 00000402 [Format=2 TF], SID=0x4000 [   17.280783] arm-smmu 5000000.iommu: FSYNR0 = 00230040 [S1CBNDX=35 IND PLVL=0] bisect log: # good: [028ef9c96e96197026887c0f092424679298aae8] Linux 7.0 git bisect good 028ef9c96e96197026887c0f092424679298aae8 # good: [334fbe734e687404f346eba7d5d96ed2b44d35ab] Merge tag 'mm-stable-2026-04-13-21-45' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm git bisect good 334fbe734e687404f346eba7d5d96ed2b44d35ab # bad: [cdd4dc3aebeab43a72ce0bc2b5bab6f0a80b97a5] Merge tag 'ntfs-for-7.1-rc1-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs git bisect bad cdd4dc3aebeab43a72ce0bc2b5bab6f0a80b97a5 # bad: [440d6635b20037bc9ad46b20817d7b61cef0fc1b] Merge tag 'mm-nonmm-stable-2026-04-15-04-20' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm git bisect bad 440d6635b20037bc9ad46b20817d7b61cef0fc1b # bad: [f1d26d72f01556c787b1291729aa7a2ce37656a8] Merge tag 'iommu-updates-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux git bisect bad f1d26d72f01556c787b1291729aa7a2ce37656a8 # good: [405f6584d7d0fc46534fd370e374630283dffe60] Merge tag 'spi-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi git bisect good 405f6584d7d0fc46534fd370e374630283dffe60 # good: [5a69195686d5b874ac5a4c7f809ecb75fbc535ef] Merge tag 'ata-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux git bisect good 5a69195686d5b874ac5a4c7f809ecb75fbc535ef # bad: [ebfaf2bcc1902d293ed25f5a0580c96f73c47cbb] iommu/vt-d: Restore IOMMU_CAP_CACHE_COHERENCY git bisect bad ebfaf2bcc1902d293ed25f5a0580c96f73c47cbb # good: [199036ae01321651fe0e4488f9e19a28af4c5f1d] iommupt: Optimize the gather processing for DMA-FQ mode git bisect good 199036ae01321651fe0e4488f9e19a28af4c5f1d # bad: [d6c65b0fd6218bd21ed0be7a8d3218e8f6dc91de] iommupt: Avoid rewalking during map git bisect bad d6c65b0fd6218bd21ed0be7a8d3218e8f6dc91de # good: [99fb8afa16add85ed016baee9735231bca0c32b4] iommupt: Directly call iommupt's unmap_range() git bisect good 99fb8afa16add85ed016baee9735231bca0c32b4 # first bad commit: [d6c65b0fd6218bd21ed0be7a8d3218e8f6dc91de] iommupt: Avoid rewalking during map sincerely Josua Mayer