From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
To: Nicolin Chen <nicolinc@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>,
"jgg@nvidia.com" <jgg@nvidia.com>,
"ryan.roberts@arm.com" <ryan.roberts@arm.com>,
"kevin.tian@intel.com" <kevin.tian@intel.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 v5 3/6] iommu/arm-smmu-v3: Add feature detection for HTTU
Date: Fri, 7 Jun 2024 08:04:45 +0000 [thread overview]
Message-ID: <e4e6c50d181641d086cb3ef1d60b6732@huawei.com> (raw)
In-Reply-To: <ZmJB/IjP+RVTKp/5@Asurada-Nvidia>
> -----Original Message-----
> From: Nicolin Chen <nicolinc@nvidia.com>
> Sent: Friday, June 7, 2024 12:11 AM
> 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;
> jgg@nvidia.com; ryan.roberts@arm.com; kevin.tian@intel.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 v5 3/6] iommu/arm-smmu-v3: Add feature detection for
> HTTU
>
> Hi Shameer,
>
> Some nitpicking inline.
Thanks for taking a look Nicolin.
>
> On Thu, Jun 06, 2024 at 02:32:59PM +0100, Shameer Kolothum wrote:
>
> > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> > index e30ce55ed1af..c05a74aa52a4 100644
> > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> > @@ -3738,6 +3738,29 @@ static void arm_smmu_device_iidr_probe(struct
> arm_smmu_device *smmu)
> > }
> > }
> >
> > +static void arm_smmu_get_httu(struct arm_smmu_device *smmu, u32
> reg)
>
> Following the other helper arm_smmu_device_iidr_probe, how about
> arm_smmu_device_httu_probe?
Hmm..I don't have any objection per se but "_get_" feels like more simple
and straightforward to me. Let me know if you feel strongly about this.
> And we could pass in FIELD_GET(IDR0_HTTU, reg) too?
Same here.
>
> > +{
> > + u32 fw_features = smmu->features & (ARM_SMMU_FEAT_HA |
> ARM_SMMU_FEAT_HD);
> > + u32 httu = FIELD_GET(IDR0_HTTU, reg);
> > + u32 features = 0;
>
> How about "hw_feats" v.s. "fw_feats"?
Ok.
>
> > +
> > + switch (httu) {
> > + case IDR0_HTTU_ACCESS_DIRTY:
> > + features |= ARM_SMMU_FEAT_HD;
> > + fallthrough;
> > + case IDR0_HTTU_ACCESS:
> > + features |= ARM_SMMU_FEAT_HA;
> > + }
> > +
> > + if (smmu->dev->of_node)
> > + smmu->features |= features;
> > + else if (features != fw_features)
> > + /* ACPI IORT sets the HTTU bits */
> > + dev_warn(smmu->dev,
> > + "IDR0.HTTU(0x%x) overridden by FW configuration
> (0x%x)\n",
> > + httu, fw_features);
>
> httu and fw_features have different shifts -- could be odd to see:
> IDR0.HTTU(0x2) overridden by FW configuration (0x600000)
>
> FIELD_GET(ACPI_IORT_SMMU_V3_HTTU_OVERRIDE, iort_smmu->flags)
> seems
> to be overcomplicated to reference? So, how about just features?
> + "IDR0.HTTU features (0x%x) overridden by FW
> configuration (0x%x)\n",
Yes. I think that make sense. Will change.
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-06-07 8:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 13:32 [PATCH v5 0/6] Add IOMMUFD dirty tracking support for SMMUv3 Shameer Kolothum
2024-06-06 13:32 ` [PATCH v5 1/6] iommu/arm-smmu-v3: Factor out a common domain alloc Shameer Kolothum
2024-06-06 18:08 ` Jason Gunthorpe
2024-06-06 22:12 ` Nicolin Chen
2024-06-06 13:32 ` [PATCH v5 2/6] iommu/arm-smmu-v3: Add support for domain_alloc_user fn Shameer Kolothum
2024-06-06 22:13 ` Nicolin Chen
2024-06-06 13:32 ` [PATCH v5 3/6] iommu/arm-smmu-v3: Add feature detection for HTTU Shameer Kolothum
2024-06-06 23:10 ` Nicolin Chen
2024-06-07 8:04 ` Shameerali Kolothum Thodi [this message]
2024-06-07 21:21 ` Nicolin Chen
2024-06-06 13:33 ` [PATCH v5 4/6] iommu/io-pgtable-arm: Add read_and_clear_dirty() support Shameer Kolothum
2024-06-06 13:33 ` [PATCH v5 5/6] iommu/arm-smmu-v3: Add support for dirty tracking in domain alloc Shameer Kolothum
2024-06-06 23:39 ` Nicolin Chen
2024-06-06 13:33 ` [PATCH v5 6/6] iommu/arm-smmu-v3: Enable HTTU for stage1 with io-pgtable mapping Shameer Kolothum
2024-06-06 23:47 ` Nicolin Chen
2024-06-07 9:49 ` [PATCH v5 0/6] Add IOMMUFD dirty tracking support for SMMUv3 Tian, Kevin
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=e4e6c50d181641d086cb3ef1d60b6732@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).