From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: "iommu@lists.linux.dev" <iommu@lists.linux.dev>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"robin.murphy@arm.com" <robin.murphy@arm.com>,
"will@kernel.org" <will@kernel.org>,
"joro@8bytes.org" <joro@8bytes.org>,
"kevin.tian@intel.com" <kevin.tian@intel.com>,
"nicolinc@nvidia.com" <nicolinc@nvidia.com>,
"mshavit@google.com" <mshavit@google.com>,
"eric.auger@redhat.com" <eric.auger@redhat.com>,
"joao.m.martins@oracle.com" <joao.m.martins@oracle.com>,
jiangkunkun <jiangkunkun@huawei.com>,
zhukeqian <zhukeqian1@huawei.com>, Linuxarm <linuxarm@huawei.com>
Subject: RE: [PATCH 4/5] iommu/arm-smmu-v3: Add set_dirty_tracking() support
Date: Thu, 30 Nov 2023 14:04:05 +0000 [thread overview]
Message-ID: <23d034c1aca044598ae4777f7939108d@huawei.com> (raw)
In-Reply-To: <20231130125412.GH1389974@nvidia.com>
> -----Original Message-----
> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Thursday, November 30, 2023 12:54 PM
> To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
> Cc: iommu@lists.linux.dev; linux-arm-kernel@lists.infradead.org;
> robin.murphy@arm.com; will@kernel.org; joro@8bytes.org;
> kevin.tian@intel.com; nicolinc@nvidia.com; mshavit@google.com;
> eric.auger@redhat.com; joao.m.martins@oracle.com; jiangkunkun
> <jiangkunkun@huawei.com>; zhukeqian <zhukeqian1@huawei.com>;
> Linuxarm <linuxarm@huawei.com>
> Subject: Re: [PATCH 4/5] iommu/arm-smmu-v3: Add set_dirty_tracking()
> support
>
> On Thu, Nov 30, 2023 at 08:56:32AM +0000, Shameerali Kolothum Thodi
> wrote:
> > > On Tue, Nov 28, 2023 at 09:49:39AM +0000, Shameer Kolothum wrote:
> > > > From: Joao Martins <joao.m.martins@oracle.com>
> > > >
> > > > Dirty tracking will always be enabled with DBM=1 modifier enabled
> > > > by default when HD is supported.
> > >
> > > Is this trying to say that ARM doesn't have a per-table global enable
> > > for dirty tracking but instead pre-sets the DBM bit to avoid the cost?
> > >
> >
> > Yes. SMMUv3 has per-PTE DBM control and I think the initial RFC had
> > it walking the PTEs and setting the DBM on set_dirty_tracking().
>
> set_dirty_tracking doesn't have access to the necessary locking to
> touch the PTEs.
>
> > > So on smmuv3 to enable we have to clear everything and disable
> > > continues to pay a penalty since we don't go and mark all things as
> > > dirty again?
> >
> > Yes we clear everything on enable. Sorry I didn't get the second part.
> > We don't mark dirty on disable. How is that different from Intel/AMD?
>
> Intel/AMD have a global switch so they just turn off the tracking and
> stop paying the cost.
>
> This approach on ARM means once the tracking is logically turned off
> the HW will continue to generate memory traffic to set dirty bits on
> DMAs. There is no way to back to the at-start state where their is 0
> memory traffic on DMAs. Not sure that it totally matters, but it is
> worth noting someplace.
Ah..you meant the HW penalty of keeping it on always.
> If we do want to solve this then ARM would need iommufd to make a pass
> over the page table to set for disable similar to how we have to clear
> for enable.
I will try to see if there is any overhead in keeping it on. Also we could limit
turning it on for DOMAIN_NESTED ?
Thanks,
Shameer
next prev parent reply other threads:[~2023-11-30 14:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-28 9:49 [PATCH 0/5] iommu/smmuv3: Add IOMMUFD dirty tracking support for SMMUv3 Shameer Kolothum
2023-11-28 9:49 ` [PATCH 1/5] iommu/arm-smmu-v3: Add feature detection for HTTU Shameer Kolothum
2023-11-29 19:49 ` Jason Gunthorpe
2023-11-28 9:49 ` [PATCH 2/5] iommu/arm-smmu-v3: Enable HTTU for stage1 with io-pgtable mapping Shameer Kolothum
2023-11-29 19:30 ` Jason Gunthorpe
2023-11-30 9:17 ` Shameerali Kolothum Thodi
2023-11-28 9:49 ` [PATCH 3/5] iommu/arm-smmu-v3: Add read_and_clear_dirty() support Shameer Kolothum
2023-11-29 19:35 ` Jason Gunthorpe
2023-11-30 9:05 ` Shameerali Kolothum Thodi
2023-11-28 9:49 ` [PATCH 4/5] iommu/arm-smmu-v3: Add set_dirty_tracking() support Shameer Kolothum
2023-11-29 19:42 ` Jason Gunthorpe
2023-11-30 8:56 ` Shameerali Kolothum Thodi
2023-11-30 12:54 ` Jason Gunthorpe
2023-11-30 14:04 ` Shameerali Kolothum Thodi [this message]
2023-12-14 16:23 ` Joao Martins
2023-11-28 9:49 ` [PATCH 5/5] iommu/arm-smmu-v3: Enforce dirty tracking in domain attach/alloc Shameer Kolothum
2023-11-29 19:48 ` Jason Gunthorpe
2023-11-30 9:01 ` Shameerali Kolothum Thodi
2023-12-14 16:29 ` Joao Martins
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=23d034c1aca044598ae4777f7939108d@huawei.com \
--to=shameerali.kolothum.thodi@huawei.com \
--cc=eric.auger@redhat.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=jiangkunkun@huawei.com \
--cc=joao.m.martins@oracle.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linuxarm@huawei.com \
--cc=mshavit@google.com \
--cc=nicolinc@nvidia.com \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
--cc=zhukeqian1@huawei.com \
/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