From: Robin Murphy <robin.murphy@arm.com>
To: Michael Shavit <mshavit@google.com>, iommu@lists.linux.dev
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
Joerg Roedel <joro@8bytes.org>,
Lu Baolu <baolu.lu@linux.intel.com>,
Nicolin Chen <nicolinc@nvidia.com>,
Tomas Krcka <krckatom@amazon.de>, Will Deacon <will@kernel.org>,
Yicong Yang <yangyicong@hisilicon.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu/arm-smmu-v3: Simplify stage selection logic
Date: Thu, 17 Aug 2023 17:35:34 +0100 [thread overview]
Message-ID: <928822fd-642a-5ca7-7b42-dc7885f3cf51@arm.com> (raw)
In-Reply-To: <20230818000321.1.Ibca43cc8d1bcad3ac3deef5726b9745128aea634@changeid>
On 2023-08-17 17:03, Michael Shavit wrote:
> It is invalid for an arm-smmu-v3 to have neither FEAT_TRANS_S1 nor
> FEAT_TRANS_S2 bits set, and this is even checked in the probe.
>
> Only set ARM_SMMU_DOMAIN_S2 if FEAT_TRANS_S1 isn't supported, otherwise set
> ARM_SMMU_DOMAIN_S1. This is clearer as the existing code implies that
> something more sophisticated is going on with the stage selection logic.
The reason it's like this is because of arm_smmu_enable_nesting(), which
*is* the additional thing that's going on with the stage selection logic.
Thanks,
Robin.
> Signed-off-by: Michael Shavit <mshavit@google.com>
> ---
>
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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 9b0dc35056019..e74c8c630adfa 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> @@ -2206,7 +2206,7 @@ static int arm_smmu_domain_finalise(struct iommu_domain *domain,
> /* Restrict the stage to what we can actually support */
> if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S1))
> smmu_domain->stage = ARM_SMMU_DOMAIN_S2;
> - if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S2))
> + else
> smmu_domain->stage = ARM_SMMU_DOMAIN_S1;
>
> switch (smmu_domain->stage) {
>
> base-commit: 6eaae198076080886b9e7d57f4ae06fa782f90ef
next prev parent reply other threads:[~2023-08-17 16:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-17 16:03 Michael Shavit
2023-08-17 16:21 ` Nicolin Chen
2023-08-17 16:35 ` Robin Murphy [this message]
2023-08-17 17:06 ` Michael Shavit
2023-08-17 18:19 ` Robin Murphy
2023-08-17 18:29 ` Michael Shavit
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=928822fd-642a-5ca7-7b42-dc7885f3cf51@arm.com \
--to=robin.murphy@arm.com \
--cc=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=jean-philippe@linaro.org \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=krckatom@amazon.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mshavit@google.com \
--cc=nicolinc@nvidia.com \
--cc=will@kernel.org \
--cc=yangyicong@hisilicon.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
all inboxes | Powered by JetHome®