Re: [PATCH v5] iommu/io-pgtable-arm: Add support for contiguous hint bit
From: Jason Gunthorpe
Date: Thu Sep 24 2026 - 18:55:45 EST
On Thu, Sep 24, 2026 at 01:36:12PM -0700, Daniel Mentz wrote:
> Interaction with Hardware Dirty Tracking (IO_PGTABLE_QUIRK_ARM_HD)
>
> When Hardware Dirty Tracking (ARM_LPAE_PTE_DBM) is enabled on Stage-1 tables:
> * In visit_dirty() / arm_lpae_read_and_clear_dirty(), dirty bits are
> queried and cleared on a page-by-page granularity
> (iopte_set_writeable_clean(ptep)).
> * If a single 4KB page within a 64KB CONT group is marked clean while
> neighboring pages remain marked dirty/writeable, the descriptors in
> that group will differ in access permissions (AP[2]).
> * According to Arm ARM D8.3.1, all descriptors in a contiguous block
> must share identical permissions and attributes. If dirty tracking is
> active on a domain, consider whether IO_PGTABLE_QUIRK_ARM_NO_CONT_HINT
> should be set or whether CONT sizes should be suppressed when
> IO_PGTABLE_QUIRK_ARM_HD is active.
This is right, handling dirty and CONT together is a PITA. You should
probably make them exclusive for this simplified implementation.
SMMUv3 is the only user of dirty and it will switch to iommupt which
does all this right.
Jason