linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Joerg Roedel <joro@8bytes.org>,
	Linux IOMMU <iommu@lists.linux-foundation.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: RE: [PATCH 3/3] iommu/ipmmu-vmsa: Add utlb_offset_base
Date: Tue, 15 Oct 2019 05:28:54 +0000	[thread overview]
Message-ID: <TYAPR01MB45443D65491480D1F95ACECCD8930@TYAPR01MB4544.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <CAMuHMdW-Z9xkE5Eh7rbgufHSDvqoPyRJgsFhp_Ne9uk2XfUnEg@mail.gmail.com>

Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Friday, October 11, 2019 9:32 PM
> 
> Hi Shimoda-san,
> 
> On Wed, Oct 9, 2019 at 10:27 AM Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com> wrote:
> > Since we will have changed memory mapping of the IPMMU in the future,
> > this patch adds a utlb_offset_base into struct ipmmu_features
> > for IMUCTR and IMUASID registers.
> > No behavior change.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> 
> Thanks for your patch!
> 
> > --- a/drivers/iommu/ipmmu-vmsa.c
> > +++ b/drivers/iommu/ipmmu-vmsa.c
> > @@ -52,6 +52,7 @@ struct ipmmu_features {
> >         bool cache_snoop;
> >         u32 ctx_offset_base;
> >         u32 ctx_offset_stride;
> > +       u32 utlb_offset_base;
> >  };
> >
> >  struct ipmmu_vmsa_device {
> > @@ -285,6 +286,11 @@ static void ipmmu_ctx_write_all(struct ipmmu_vmsa_domain *domain,
> >         ipmmu_ctx_write_root(domain, reg, data);
> >  }
> >
> > +static u32 ipmmu_utlb_reg(struct ipmmu_vmsa_device *mmu, unsigned int reg)
> > +{
> > +       return mmu->features->utlb_offset_base + reg;
> > +}
> > +
> >  /* -----------------------------------------------------------------------------
> >   * TLB and microTLB Management
> >   */
> > @@ -330,9 +336,9 @@ 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_write(mmu, ipmmu_utlb_reg(mmu, IMUASID(utlb)), 0);
> >         /* TODO: Do we need to flush the microTLB ? */
> > -       ipmmu_write(mmu, IMUCTR(utlb),
> > +       ipmmu_write(mmu, ipmmu_utlb_reg(mmu, IMUCTR(utlb)),
> >                     IMUCTR_TTSEL_MMU(domain->context_id) | IMUCTR_FLUSH |
> >                     IMUCTR_MMUEN);
> 
> Like in [PATCH 2/3], I think providing two helpers would make this more
> readable:
> 
>     ipmmu_imuasid_write(mmu, utlb, 0);
>     ipmmu_imuctr_write(mmu, utlb, data);

I agree. I'll fix it.

Best regards,
Yoshihiro Shimoda

> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

      reply	other threads:[~2019-10-15  5:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09  8:26 [PATCH 0/3] iommu/ipmmu-vmsa: minor updates Yoshihiro Shimoda
2019-10-09  8:26 ` [PATCH 1/3] iommu/ipmmu-vmsa: Remove some unused register declarations Yoshihiro Shimoda
2019-10-09 21:03   ` Niklas Söderlund
2019-10-11 12:10   ` Geert Uytterhoeven
2019-10-15  5:17     ` Yoshihiro Shimoda
2019-10-09  8:26 ` [PATCH 2/3] iommu/ipmmu-vmsa: Calculate context registers' offset instead of a macro Yoshihiro Shimoda
2019-10-09 21:13   ` Niklas Söderlund
2019-10-11 12:29   ` Geert Uytterhoeven
2019-10-15  5:28     ` Yoshihiro Shimoda
2019-10-09  8:26 ` [PATCH 3/3] iommu/ipmmu-vmsa: Add utlb_offset_base Yoshihiro Shimoda
2019-10-09 22:28   ` Niklas Söderlund
2019-10-11 12:32   ` Geert Uytterhoeven
2019-10-15  5:28     ` Yoshihiro Shimoda [this message]

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=TYAPR01MB45443D65491480D1F95ACECCD8930@TYAPR01MB4544.jpnprd01.prod.outlook.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=geert@linux-m68k.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-renesas-soc@vger.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 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).