From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: linux-renesas-soc@vger.kernel.org, iommu@lists.linux-foundation.org
Subject: Re: [PATCH v3 5/6] iommu/ipmmu-vmsa: Add helper functions for "uTLB" registers
Date: Thu, 7 Nov 2019 01:09:59 +0100 [thread overview]
Message-ID: <20191107000959.GF18345@bigcity.dyn.berto.se> (raw)
In-Reply-To: <1573007750-16611-6-git-send-email-yoshihiro.shimoda.uh@renesas.com>
Hi Shimoda-san,
Thanks for your work,
On 2019-11-06 11:35:49 +0900, Yoshihiro Shimoda wrote:
> Since we will have changed memory mapping of the IPMMU in the future,
> This patch adds helper functions ipmmu_utlb_reg() and
> ipmmu_imu{asid,ctr}_write() for "uTLB" registers. No behavior change.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> drivers/iommu/ipmmu-vmsa.c | 26 +++++++++++++++++++++-----
> 1 file changed, 21 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
> index 8e2ca1c..82da486 100644
> --- a/drivers/iommu/ipmmu-vmsa.c
> +++ b/drivers/iommu/ipmmu-vmsa.c
> @@ -230,6 +230,23 @@ static void ipmmu_ctx_write_all(struct ipmmu_vmsa_domain *domain,
> ipmmu_ctx_write(domain->mmu->root, domain->context_id, reg, data);
> }
>
> +static u32 ipmmu_utlb_reg(struct ipmmu_vmsa_device *mmu, unsigned int reg)
> +{
> + return reg;
> +}
> +
> +static void ipmmu_imuasid_write(struct ipmmu_vmsa_device *mmu,
> + unsigned int utlb, u32 data)
> +{
> + ipmmu_write(mmu, ipmmu_utlb_reg(mmu, IMUASID(utlb)), data);
> +}
> +
> +static void ipmmu_imuctr_write(struct ipmmu_vmsa_device *mmu,
> + unsigned int utlb, u32 data)
> +{
> + ipmmu_write(mmu, ipmmu_utlb_reg(mmu, IMUCTR(utlb)), data);
> +}
> +
> /* -----------------------------------------------------------------------------
> * TLB and microTLB Management
> */
> @@ -275,11 +292,10 @@ static void ipmmu_utlb_enable(struct ipmmu_vmsa_domain *domain,
> */
>
> /* TODO: What should we set the ASID to ? */
> - ipmmu_write(mmu, IMUASID(utlb), 0);
> + ipmmu_imuasid_write(mmu, utlb, 0);
> /* TODO: Do we need to flush the microTLB ? */
> - ipmmu_write(mmu, IMUCTR(utlb),
> - IMUCTR_TTSEL_MMU(domain->context_id) | IMUCTR_FLUSH |
> - IMUCTR_MMUEN);
> + ipmmu_imuctr_write(mmu, utlb, IMUCTR_TTSEL_MMU(domain->context_id) |
> + IMUCTR_FLUSH | IMUCTR_MMUEN);
> mmu->utlb_ctx[utlb] = domain->context_id;
> }
>
> @@ -291,7 +307,7 @@ static void ipmmu_utlb_disable(struct ipmmu_vmsa_domain *domain,
> {
> struct ipmmu_vmsa_device *mmu = domain->mmu;
>
> - ipmmu_write(mmu, IMUCTR(utlb), 0);
> + ipmmu_imuctr_write(mmu, utlb, 0);
> mmu->utlb_ctx[utlb] = IPMMU_CTX_INVALID;
> }
>
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2019-11-07 0:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-06 2:35 [PATCH v3 0/6] iommu/ipmmu-vmsa: minor updates Yoshihiro Shimoda
2019-11-06 2:35 ` [PATCH v3 1/6] iommu/ipmmu-vmsa: Remove all unused register definitions Yoshihiro Shimoda
2019-11-06 23:56 ` Niklas Söderlund
2019-11-06 2:35 ` [PATCH v3 2/6] iommu/ipmmu-vmsa: tidyup " Yoshihiro Shimoda
2019-11-06 23:58 ` Niklas Söderlund
2019-11-06 2:35 ` [PATCH v3 3/6] iommu/ipmmu-vmsa: Add helper functions for MMU "context" registers Yoshihiro Shimoda
2019-11-07 0:01 ` Niklas Söderlund
2019-11-06 2:35 ` [PATCH v3 4/6] iommu/ipmmu-vmsa: Calculate context registers' offset instead of a macro Yoshihiro Shimoda
2019-11-07 0:03 ` Niklas Söderlund
2019-11-06 2:35 ` [PATCH v3 5/6] iommu/ipmmu-vmsa: Add helper functions for "uTLB" registers Yoshihiro Shimoda
2019-11-07 0:09 ` Niklas Söderlund [this message]
2019-11-06 2:35 ` [PATCH v3 6/6] iommu/ipmmu-vmsa: Add utlb_offset_base Yoshihiro Shimoda
2019-11-07 0:11 ` Niklas Söderlund
2019-11-11 14:07 ` [PATCH v3 0/6] iommu/ipmmu-vmsa: minor updates Joerg Roedel
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=20191107000959.GF18345@bigcity.dyn.berto.se \
--to=niklas.soderlund@ragnatech.se \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=yoshihiro.shimoda.uh@renesas.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).