From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Cc: "robin.murphy@arm.com" <robin.murphy@arm.com>,
"will@kernel.org" <will@kernel.org>,
"joro@8bytes.org" <joro@8bytes.org>,
"jgg@nvidia.com" <jgg@nvidia.com>,
"ryan.roberts@arm.com" <ryan.roberts@arm.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 v3 3/4] iommu/arm-smmu-v3: Add support for dirty tracking in domain alloc
Date: Wed, 22 May 2024 14:30:19 +0000 [thread overview]
Message-ID: <d08fcd087e9541a2a77733ec52ff931a@huawei.com> (raw)
In-Reply-To: <BN9PR11MB52765EF502C246B4C344CE888CEB2@BN9PR11MB5276.namprd11.prod.outlook.com>
> -----Original Message-----
> From: Tian, Kevin <kevin.tian@intel.com>
> Sent: Wednesday, May 22, 2024 8:16 AM
> To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>;
> iommu@lists.linux.dev; linux-arm-kernel@lists.infradead.org
> Cc: robin.murphy@arm.com; will@kernel.org; joro@8bytes.org;
> jgg@nvidia.com; ryan.roberts@arm.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 v3 3/4] iommu/arm-smmu-v3: Add support for dirty tracking
> in domain alloc
>
> > From: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
> > Sent: Tuesday, April 30, 2024 9:43 PM
> >
> > @@ -2422,31 +2425,32 @@ static int arm_smmu_domain_finalise(struct
> > arm_smmu_domain *smmu_domain,
> > if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S2))
> > smmu_domain->stage = ARM_SMMU_DOMAIN_S1;
> >
> > + pgtbl_cfg = (struct io_pgtable_cfg) {
> > + .pgsize_bitmap = smmu->pgsize_bitmap,
> > + .coherent_walk = smmu->features &
> > ARM_SMMU_FEAT_COHERENCY,
> > + .tlb = &arm_smmu_flush_ops,
> > + .iommu_dev = smmu->dev,
> > + };
> > +
> > switch (smmu_domain->stage) {
> > case ARM_SMMU_DOMAIN_S1:
> > - ias = (smmu->features & ARM_SMMU_FEAT_VAX) ? 52 : 48;
> > - ias = min_t(unsigned long, ias, VA_BITS);
> > - oas = smmu->ias;
> > + unsigned long ias = (smmu->features &
> > + ARM_SMMU_FEAT_VAX) ? 52 : 48;
> > + pgtbl_cfg.ias = min_t(unsigned long, ias, VA_BITS);
> > + pgtbl_cfg.oas = smmu->ias;
> > + if (enable_dirty)
> > + pgtbl_cfg.quirks |= IO_PGTABLE_QUIRK_ARM_HD;
>
> why is dirty tracking considered as a quirk?
Yes, that is a bit unconventional. But this was discussed earlier and in SMMUv3
driver the word "quirk" is considered in the broadest sense and there are
precedent for this in the driver already.
From Robin:
"Indeed these features aren't decorative grooves on a piece of furniture,
but in the case of io-pgtable we're merely using "quirk" in its broadest
sense to imply something that differs from the baseline default
behaviour - ARM_MTK_EXT, ARM_TTBR1 and ARM_OUTER_WBWA (or whatever it's
called this week) are all just indicating extra hardware features
entirely comparable to HTTU;..."
https://lore.kernel.org/linux-iommu/5ada4a8b-8852-f83c-040a-9ef5dac51de2@arm.com/
>
> > fmt = ARM_64_LPAE_S1;
> > break;
> > case ARM_SMMU_DOMAIN_S2:
> > - ias = smmu->ias;
> > - oas = smmu->oas;
> > + pgtbl_cfg.ias = smmu->ias;
> > + pgtbl_cfg.oas = smmu->oas;
> > fmt = ARM_64_LPAE_S2;
> > break;
>
> so dirty-tracking is not supported by s2? what about nesting?
It will be added later when we have the nested support.
> if this is desired then attempting to set dirty_tracking on a s2 domain
> should be rejected with an error.
Ok. I will add that.
Thanks,
Shameer
WARNING: multiple messages have this Message-ID (diff)
From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Cc: "robin.murphy@arm.com" <robin.murphy@arm.com>,
"will@kernel.org" <will@kernel.org>,
"joro@8bytes.org" <joro@8bytes.org>,
"jgg@nvidia.com" <jgg@nvidia.com>,
"ryan.roberts@arm.com" <ryan.roberts@arm.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 v3 3/4] iommu/arm-smmu-v3: Add support for dirty tracking in domain alloc
Date: Wed, 22 May 2024 14:30:19 +0000 [thread overview]
Message-ID: <d08fcd087e9541a2a77733ec52ff931a@huawei.com> (raw)
In-Reply-To: <BN9PR11MB52765EF502C246B4C344CE888CEB2@BN9PR11MB5276.namprd11.prod.outlook.com>
> -----Original Message-----
> From: Tian, Kevin <kevin.tian@intel.com>
> Sent: Wednesday, May 22, 2024 8:16 AM
> To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>;
> iommu@lists.linux.dev; linux-arm-kernel@lists.infradead.org
> Cc: robin.murphy@arm.com; will@kernel.org; joro@8bytes.org;
> jgg@nvidia.com; ryan.roberts@arm.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 v3 3/4] iommu/arm-smmu-v3: Add support for dirty tracking
> in domain alloc
>
> > From: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
> > Sent: Tuesday, April 30, 2024 9:43 PM
> >
> > @@ -2422,31 +2425,32 @@ static int arm_smmu_domain_finalise(struct
> > arm_smmu_domain *smmu_domain,
> > if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S2))
> > smmu_domain->stage = ARM_SMMU_DOMAIN_S1;
> >
> > + pgtbl_cfg = (struct io_pgtable_cfg) {
> > + .pgsize_bitmap = smmu->pgsize_bitmap,
> > + .coherent_walk = smmu->features &
> > ARM_SMMU_FEAT_COHERENCY,
> > + .tlb = &arm_smmu_flush_ops,
> > + .iommu_dev = smmu->dev,
> > + };
> > +
> > switch (smmu_domain->stage) {
> > case ARM_SMMU_DOMAIN_S1:
> > - ias = (smmu->features & ARM_SMMU_FEAT_VAX) ? 52 : 48;
> > - ias = min_t(unsigned long, ias, VA_BITS);
> > - oas = smmu->ias;
> > + unsigned long ias = (smmu->features &
> > + ARM_SMMU_FEAT_VAX) ? 52 : 48;
> > + pgtbl_cfg.ias = min_t(unsigned long, ias, VA_BITS);
> > + pgtbl_cfg.oas = smmu->ias;
> > + if (enable_dirty)
> > + pgtbl_cfg.quirks |= IO_PGTABLE_QUIRK_ARM_HD;
>
> why is dirty tracking considered as a quirk?
Yes, that is a bit unconventional. But this was discussed earlier and in SMMUv3
driver the word "quirk" is considered in the broadest sense and there are
precedent for this in the driver already.
From Robin:
"Indeed these features aren't decorative grooves on a piece of furniture,
but in the case of io-pgtable we're merely using "quirk" in its broadest
sense to imply something that differs from the baseline default
behaviour - ARM_MTK_EXT, ARM_TTBR1 and ARM_OUTER_WBWA (or whatever it's
called this week) are all just indicating extra hardware features
entirely comparable to HTTU;..."
https://lore.kernel.org/linux-iommu/5ada4a8b-8852-f83c-040a-9ef5dac51de2@arm.com/
>
> > fmt = ARM_64_LPAE_S1;
> > break;
> > case ARM_SMMU_DOMAIN_S2:
> > - ias = smmu->ias;
> > - oas = smmu->oas;
> > + pgtbl_cfg.ias = smmu->ias;
> > + pgtbl_cfg.oas = smmu->oas;
> > fmt = ARM_64_LPAE_S2;
> > break;
>
> so dirty-tracking is not supported by s2? what about nesting?
It will be added later when we have the nested support.
> if this is desired then attempting to set dirty_tracking on a s2 domain
> should be rejected with an error.
Ok. I will add that.
Thanks,
Shameer
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-05-22 14:52 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-30 13:43 [PATCH v3 0/4] iommu/smmuv3: Add IOMMUFD dirty tracking support for SMMUv3 Shameer Kolothum
2024-04-30 13:43 ` Shameer Kolothum
2024-04-30 13:43 ` [PATCH v3 1/4] iommu/arm-smmu-v3: Add feature detection for HTTU Shameer Kolothum
2024-04-30 13:43 ` Shameer Kolothum
2024-05-22 7:02 ` Tian, Kevin
2024-05-22 7:02 ` Tian, Kevin
2024-04-30 13:43 ` [PATCH v3 2/4] iommu/io-pgtable-arm: Add read_and_clear_dirty() support Shameer Kolothum
2024-04-30 13:43 ` Shameer Kolothum
2024-04-30 14:51 ` Ryan Roberts
2024-04-30 14:51 ` Ryan Roberts
2024-05-12 12:51 ` Jason Gunthorpe
2024-05-12 12:51 ` Jason Gunthorpe
2024-05-22 7:12 ` Tian, Kevin
2024-05-22 7:12 ` Tian, Kevin
2024-05-22 12:37 ` Jason Gunthorpe
2024-05-22 12:37 ` Jason Gunthorpe
2024-05-22 14:03 ` Shameerali Kolothum Thodi
2024-05-22 14:03 ` Shameerali Kolothum Thodi
2024-05-22 14:37 ` Joao Martins
2024-05-22 14:37 ` Joao Martins
2024-05-22 16:56 ` Jason Gunthorpe
2024-05-22 16:56 ` Jason Gunthorpe
2024-05-22 17:10 ` Joao Martins
2024-05-22 17:10 ` Joao Martins
2024-05-22 17:50 ` Jason Gunthorpe
2024-05-22 17:50 ` Jason Gunthorpe
2024-05-22 18:15 ` Joao Martins
2024-05-22 18:15 ` Joao Martins
2024-05-22 18:39 ` Joao Martins
2024-05-22 18:39 ` Joao Martins
2024-05-23 3:30 ` Tian, Kevin
2024-05-23 3:30 ` Tian, Kevin
2024-05-24 11:30 ` Joao Martins
2024-05-24 11:30 ` Joao Martins
2024-05-24 14:07 ` Jason Gunthorpe
2024-05-24 14:07 ` Jason Gunthorpe
2024-05-27 1:21 ` Tian, Kevin
2024-05-27 1:21 ` Tian, Kevin
2024-05-27 9:50 ` Joao Martins
2024-05-27 9:50 ` Joao Martins
2024-06-01 18:55 ` Jason Gunthorpe
2024-06-01 18:55 ` Jason Gunthorpe
2024-06-03 18:50 ` Joao Martins
2024-06-03 18:50 ` Joao Martins
2024-04-30 13:43 ` [PATCH v3 3/4] iommu/arm-smmu-v3: Add support for dirty tracking in domain alloc Shameer Kolothum
2024-04-30 13:43 ` Shameer Kolothum
2024-04-30 15:05 ` Ryan Roberts
2024-04-30 15:05 ` Ryan Roberts
2024-05-12 12:57 ` Jason Gunthorpe
2024-05-12 12:57 ` Jason Gunthorpe
2024-05-22 7:16 ` Tian, Kevin
2024-05-22 7:16 ` Tian, Kevin
2024-05-22 12:38 ` Jason Gunthorpe
2024-05-22 12:38 ` Jason Gunthorpe
2024-05-22 14:30 ` Shameerali Kolothum Thodi [this message]
2024-05-22 14:30 ` Shameerali Kolothum Thodi
2024-05-22 23:49 ` Tian, Kevin
2024-05-22 23:49 ` Tian, Kevin
2024-04-30 13:43 ` [PATCH v3 4/4] iommu/arm-smmu-v3: Enable HTTU for stage1 with io-pgtable mapping Shameer Kolothum
2024-04-30 13:43 ` Shameer Kolothum
2024-05-12 12:08 ` Jason Gunthorpe
2024-05-12 12:08 ` Jason Gunthorpe
2024-05-22 7:19 ` Tian, Kevin
2024-05-22 7:19 ` Tian, Kevin
2024-05-22 12:39 ` Jason Gunthorpe
2024-05-22 12:39 ` Jason Gunthorpe
2024-05-22 23:52 ` Tian, Kevin
2024-05-22 23:52 ` Tian, Kevin
2024-05-22 13:26 ` Shameerali Kolothum Thodi
2024-05-22 13:26 ` Shameerali Kolothum Thodi
2024-05-22 13:41 ` Jason Gunthorpe
2024-05-22 13:41 ` Jason Gunthorpe
2024-05-12 12:58 ` [PATCH v3 0/4] iommu/smmuv3: Add IOMMUFD dirty tracking support for SMMUv3 Jason Gunthorpe
2024-05-12 12:58 ` Jason Gunthorpe
2024-05-22 13:28 ` Shameerali Kolothum Thodi
2024-05-22 13:28 ` Shameerali Kolothum Thodi
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=d08fcd087e9541a2a77733ec52ff931a@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=ryan.roberts@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.