All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Michael Shavit <mshavit@google.com>
Cc: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, robin.murphy@arm.com,
	will@kernel.org, jean-philippe@linaro.org, nicolinc@nvidia.com
Subject: Re: [PATCH v3 5/8] iommu/arm-smmu-v3: Refactor write_ctx_desc
Date: Tue, 1 Aug 2023 20:50:47 -0300	[thread overview]
Message-ID: <ZMmaV+e6BtyJgn9R@nvidia.com> (raw)
In-Reply-To: <20230802023524.v3.5.I219054a6cf538df5bb22f4ada2d9933155d6058c@changeid>

On Wed, Aug 02, 2023 at 02:35:22AM +0800, Michael Shavit wrote:
> Update arm_smmu_write_ctx_desc and downstream functions to operate on
> a master instead of an smmu domain. We expect arm_smmu_write_ctx_desc()
> to only be called to write a CD entry into a CD table owned by the
> master. Under the hood, arm_smmu_write_ctx_desc still fetches the CD
> table from the domain that is attached to the master, but a subsequent
> commit will move that table's ownership to the master.
> 
> Note that this change isn't a nop refactor since SVA will call
> arm_smmu_write_ctx_desc in a loop for every master the domain is
> attached to despite the fact that they all share the same CD table. This
> loop may look weird but becomes necessary when the CD table becomes
> per-master in a subsequent commit.
> 
> Signed-off-by: Michael Shavit <mshavit@google.com>
> ---
> 
> Changes in v3:
> - Add a helper to write a CD to all masters that a domain is attached
>   to.
> - Fixed an issue where an arm_smmu_write_ctx_desc error return wasn't
>   correctly handled by its caller.
> 
> Changes in v2:
> - minor style fixes
> 
> Changes in v1:
> - arm_smmu_write_ctx_desc now get's the CD table to write to from the
>   master parameter instead of a distinct parameter. This works well
>   because the CD table being written to should always be owned by the
>   master by the end of this series. This version no longer allows master
>   to be NULL.
> 
>  .../iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c   | 31 +++++++++--
>  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c   | 51 +++++++------------
>  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h   |  2 +-
>  3 files changed, 46 insertions(+), 38 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: Michael Shavit <mshavit@google.com>
Cc: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, robin.murphy@arm.com,
	will@kernel.org, jean-philippe@linaro.org, nicolinc@nvidia.com
Subject: Re: [PATCH v3 5/8] iommu/arm-smmu-v3: Refactor write_ctx_desc
Date: Tue, 1 Aug 2023 20:50:47 -0300	[thread overview]
Message-ID: <ZMmaV+e6BtyJgn9R@nvidia.com> (raw)
In-Reply-To: <20230802023524.v3.5.I219054a6cf538df5bb22f4ada2d9933155d6058c@changeid>

On Wed, Aug 02, 2023 at 02:35:22AM +0800, Michael Shavit wrote:
> Update arm_smmu_write_ctx_desc and downstream functions to operate on
> a master instead of an smmu domain. We expect arm_smmu_write_ctx_desc()
> to only be called to write a CD entry into a CD table owned by the
> master. Under the hood, arm_smmu_write_ctx_desc still fetches the CD
> table from the domain that is attached to the master, but a subsequent
> commit will move that table's ownership to the master.
> 
> Note that this change isn't a nop refactor since SVA will call
> arm_smmu_write_ctx_desc in a loop for every master the domain is
> attached to despite the fact that they all share the same CD table. This
> loop may look weird but becomes necessary when the CD table becomes
> per-master in a subsequent commit.
> 
> Signed-off-by: Michael Shavit <mshavit@google.com>
> ---
> 
> Changes in v3:
> - Add a helper to write a CD to all masters that a domain is attached
>   to.
> - Fixed an issue where an arm_smmu_write_ctx_desc error return wasn't
>   correctly handled by its caller.
> 
> Changes in v2:
> - minor style fixes
> 
> Changes in v1:
> - arm_smmu_write_ctx_desc now get's the CD table to write to from the
>   master parameter instead of a distinct parameter. This works well
>   because the CD table being written to should always be owned by the
>   master by the end of this series. This version no longer allows master
>   to be NULL.
> 
>  .../iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c   | 31 +++++++++--
>  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c   | 51 +++++++------------
>  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h   |  2 +-
>  3 files changed, 46 insertions(+), 38 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-08-01 23:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 18:35 [PATCH v3 0/8] Refactor the SMMU's CD table ownership Michael Shavit
2023-08-01 18:35 ` Michael Shavit
2023-08-01 18:35 ` [PATCH v3 1/8] iommu/arm-smmu-v3: Move ctx_desc out of s1_cfg Michael Shavit
2023-08-01 18:35   ` Michael Shavit
2023-08-01 18:35 ` [PATCH v3 2/8] iommu/arm-smmu-v3: Replace s1_cfg with cdtab_cfg Michael Shavit
2023-08-01 18:35   ` Michael Shavit
2023-08-01 23:48   ` Jason Gunthorpe
2023-08-01 23:48     ` Jason Gunthorpe
2023-08-01 18:35 ` [PATCH v3 3/8] iommu/arm-smmu-v3: Encapsulate ctx_desc_cfg init in alloc_cd_tables Michael Shavit
2023-08-01 18:35   ` Michael Shavit
2023-08-01 18:35 ` [PATCH v3 4/8] iommu/arm-smmu-v3: move stall_enabled to the cd table Michael Shavit
2023-08-01 18:35   ` Michael Shavit
2023-08-01 18:35 ` [PATCH v3 5/8] iommu/arm-smmu-v3: Refactor write_ctx_desc Michael Shavit
2023-08-01 18:35   ` Michael Shavit
2023-08-01 23:50   ` Jason Gunthorpe [this message]
2023-08-01 23:50     ` Jason Gunthorpe
2023-08-01 18:35 ` [PATCH v3 6/8] iommu/arm-smmu-v3: Move CD table to arm_smmu_master Michael Shavit
2023-08-01 18:35   ` Michael Shavit
2023-08-01 23:53   ` Jason Gunthorpe
2023-08-01 23:53     ` Jason Gunthorpe
2023-08-02 11:19     ` Michael Shavit
2023-08-02 11:19       ` Michael Shavit
2023-08-02 11:51       ` Jason Gunthorpe
2023-08-02 11:51         ` Jason Gunthorpe
2023-08-01 18:35 ` [PATCH v3 7/8] iommu/arm-smmu-v3: Skip cd sync if CD table isn't active Michael Shavit
2023-08-01 18:35   ` Michael Shavit
2023-08-01 18:35 ` [PATCH v3 8/8] iommu/arm-smmu-v3: Rename cdcfg to cd_table Michael Shavit
2023-08-01 18:35   ` 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=ZMmaV+e6BtyJgn9R@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=iommu@lists.linux.dev \
    --cc=jean-philippe@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mshavit@google.com \
    --cc=nicolinc@nvidia.com \
    --cc=robin.murphy@arm.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 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.