From: Nicolin Chen <nicolinc@nvidia.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: <iommu@lists.linux.dev>, "Joerg Roedel (AMD)" <joro@8bytes.org>,
Jean-Philippe Brucker <jpb@kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
Robin Murphy <robin.murphy@arm.com>,
Will Deacon <will@kernel.org>,
David Matlack <dmatlack@google.com>,
"John Garry" <john.garry@arm.com>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
<patches@lists.linux.dev>, Pranjal Shrivastava <praan@google.com>,
"Samiullah Khawaja" <skhawaja@google.com>,
Mostafa Saleh <smostafa@google.com>
Subject: Re: [PATCH v3 07/13] iommupt/armv8: Add DBM support
Date: Thu, 3 Dec 2026 17:38:55 -0800 [thread overview]
Message-ID: <axIZr9pckXy4llBS@nvidia.com> (raw)
In-Reply-To: <7-v3-97feb2edfbab+748d0a-iommupt_armv8_jgg@nvidia.com>
On Sun, Nov 15, 2026 at 07:30:37PM -0400, Jason Gunthorpe wrote:
> Provide the functions required to do dirty tracking with variations for S1
> and S2 formats. This follows the same scheme as iopgtable where the table
> starts off dirty to avoid any HW updates, and once dirty tracking is
> started it will be cleaned.
>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Two nits below, but they are ignorable.
> +static inline bool armv8pt_check_is_dirty_s1(u64 *tablep, u64 entry)
> +{
> + return (entry & (ARMV8PT_FMT_DBM |
> + FIELD_PREP(ARMV8PT_FMT_AP, ARMV8PT_AP_RDONLY))) ==
> + ARMV8PT_FMT_DBM;
> +}
> +
> +static bool armv8pt_clear_dirty_s1(u64 *tablep, u64 entry)
> +{
> + WRITE_ONCE(*tablep,
> + entry | FIELD_PREP(ARMV8PT_FMT_AP, ARMV8PT_AP_RDONLY));
> + return false;
> +}
Could this be "inline", matching with armv8pt_check_is_dirty_s1?
> +static inline bool armv8pt_check_is_dirty_s2(u64 *tablep, u64 entry)
> +{
> + const u64 DIRTY = ARMV8PT_FMT_DBM |
> + FIELD_PREP(ARMV8PT_FMT_S2AP, ARMV8PT_S2AP_WRITE);
> +
> + return (entry & DIRTY) == DIRTY;
> +}
> +
> +static bool armv8pt_clear_dirty_s2(u64 *tablep, u64 entry)
> +{
> + WRITE_ONCE(*tablep, entry & ~(u64)FIELD_PREP(ARMV8PT_FMT_S2AP,
> + ARMV8PT_S2AP_WRITE));
> + return false;
> +}
Ditto
Nicolin
next prev parent reply other threads:[~2026-12-04 1:39 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 23:30 [PATCH v3 00/13] Use the generic iommu page table for SMMUv3 Jason Gunthorpe
2026-11-15 23:30 ` [PATCH v3 01/13] iommu/arm-smmu-v3: Change how the tlbi describes the invalidation Jason Gunthorpe
2026-11-15 23:30 ` [PATCH v3 02/13] iommu/arm-smmu-v3: Support the DS expansion of range invalidation SCALE Jason Gunthorpe
2026-11-15 23:30 ` [PATCH v3 03/13] iommupt: Remove the sanity check for pt_num_items_lg2() at the top level Jason Gunthorpe
2026-11-24 0:40 ` Nicolin Chen
2026-11-15 23:30 ` [PATCH v3 04/13] iommupt/kunit: Do not test INCOHERENT on anything but x86 Jason Gunthorpe
2026-11-24 0:49 ` Nicolin Chen
2026-11-15 23:30 ` [PATCH v3 05/13] iommupt/kunit: Skip test configs without supported features Jason Gunthorpe
2026-11-24 5:29 ` Nicolin Chen
2026-11-24 15:08 ` Jason Gunthorpe
2026-11-24 19:08 ` Nicolin Chen
2026-11-24 20:07 ` Jason Gunthorpe
2026-11-26 5:00 ` Nicolin Chen
2026-11-30 22:44 ` Nicolin Chen
2026-11-15 23:30 ` [PATCH v3 06/13] iommupt/armv8: Add the 64 bit ARMv8 page table format Jason Gunthorpe
2026-12-03 0:15 ` Nicolin Chen
2026-11-15 23:30 ` [PATCH v3 07/13] iommupt/armv8: Add DBM support Jason Gunthorpe
2026-12-04 1:38 ` Nicolin Chen [this message]
2026-11-15 23:30 ` [PATCH v3 08/13] iommupt/armv8: Implement the iommu specific components Jason Gunthorpe
2026-11-15 23:30 ` [PATCH v3 09/13] iommu/arm-smmu-v3: Remove io-pgtable-arm from sva.c Jason Gunthorpe
2026-11-15 23:30 ` [PATCH v3 10/13] iommu/arm-smmu-v3: Move the DMA API comment to flush_iotlb_all Jason Gunthorpe
2026-11-15 23:30 ` [PATCH v3 11/13] iommu/arm-smmu-v3: Support CONT in paging domains with errata Jason Gunthorpe
2026-11-15 23:30 ` [PATCH v3 12/13] iommu/arm-smmu-v3: Use the generic iommu page table Jason Gunthorpe
2026-11-15 23:30 ` [PATCH v3 13/13] iommu: Remove pgsize from iommu_iotlb_gather Jason Gunthorpe
2026-11-24 0:04 ` [PATCH v3 00/13] Use the generic iommu page table for SMMUv3 Nicolin Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=axIZr9pckXy4llBS@nvidia.com \
--to=nicolinc@nvidia.com \
--cc=dmatlack@google.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=john.garry@arm.com \
--cc=joro@8bytes.org \
--cc=jpb@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=pasha.tatashin@soleen.com \
--cc=patches@lists.linux.dev \
--cc=praan@google.com \
--cc=robin.murphy@arm.com \
--cc=skhawaja@google.com \
--cc=smostafa@google.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox