LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Popple <alistair@popple.id.au>
To: linuxppc-dev@lists.ozlabs.org
Cc: Balbir Singh <bsingharora@gmail.com>,
	Frederic Barrat <fbarrat@linux.vnet.ibm.com>,
	clombard@linux.vnet.ibm.com, vaibhav@linux.vnet.ibm.com,
	Aneesh Kumar KV <aneesh.kumar@linux.vnet.ibm.com>
Subject: Re: [PATCH v3 2/3] cxl: Mark context requiring global TLBIs
Date: Tue, 22 Aug 2017 13:09:44 +1000	[thread overview]
Message-ID: <2098488.gckpkjsb17@new-mexico> (raw)
In-Reply-To: <CAKTCnz=f-Z4vg-1V2bsx-JGHPmnPdu_DGDNoSjsB17id=F57gQ@mail.gmail.com>

On Thu, 3 Aug 2017 05:22:31 PM Balbir Singh wrote:
> On Thu, Aug 3, 2017 at 6:29 AM, Frederic Barrat
> <fbarrat@linux.vnet.ibm.com> wrote:
> > The PSL and XSL need to see all TLBIs pertinent to the memory contexts
> > used on the adapter. For the hash memory model, it is done by making
> > all TLBIs global as soon as the cxl driver is in use. For radix, we
> > need something similar, but we can refine and only convert to global
> > the invalidations for contexts actually used by the device.
> >
> > So mark the contexts being attached to the cxl adapter as requiring
> > global TLBIs.
> >
> 
> Looking at these bits, I'm wondering the previous code should check
> for CONFIG_CXL in mm_is_invalidation_local? That would pretty much cover
> BOOK3S_64

That won't work as we also need this for other nest MMU users which might
not have CONFIG_CXL set - for example the NPU the will use
mm_context_set_global_tlbi() for processes on the GPU.

Regards,

Alistair

> > Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> > ---
> >  drivers/misc/cxl/api.c    | 12 ++++++++++--
> >  drivers/misc/cxl/cxllib.c |  7 +++++++
> >  drivers/misc/cxl/file.c   | 12 ++++++++++--
> >  3 files changed, 27 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c
> > index 1a138c83f877..d3f3fdede755 100644
> > --- a/drivers/misc/cxl/api.c
> > +++ b/drivers/misc/cxl/api.c
> > @@ -332,8 +332,17 @@ int cxl_start_context(struct cxl_context *ctx, u64 wed,
> >                 cxl_context_mm_count_get(ctx);
> >
> >                 /* decrement the use count */
> > -               if (ctx->mm)
> > +               if (ctx->mm) {
> >                         mmput(ctx->mm);
> > +#ifdef CONFIG_PPC_BOOK3S_64
> > +                       mm_context_set_global_tlbi(&ctx->mm->context);
> 
> Do we have CXL for non PPC_BOOK3S_64?
> 
> > +                       /*
> > +                        * Barrier guarantees that the device will
> > +                        * receive all TLBIs from that point on
> > +                        */
> > +                       wmb();
> 
> smp_wmb();
> 
> > +#endif
> > +               }
> >         }
> 
> The other comments are the same as this (in the snip'd code)
> 
> Balbir

  reply	other threads:[~2017-08-22  3:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02 20:29 [PATCH v3 0/3] powerpc/mm: Mark memory contexts requiring global TLBIs Frederic Barrat
2017-08-02 20:29 ` [PATCH v3 1/3] powerpc/mm: Add marker for contexts requiring global TLB invalidations Frederic Barrat
2017-08-03  7:16   ` Balbir Singh
2017-08-22  3:11     ` Alistair Popple
2017-08-02 20:29 ` [PATCH v3 2/3] cxl: Mark context requiring global TLBIs Frederic Barrat
2017-08-03  7:22   ` Balbir Singh
2017-08-22  3:09     ` Alistair Popple [this message]
2017-08-02 20:29 ` [PATCH v3 3/3] cxl: Add memory barrier to guarantee TLBI scope Frederic Barrat
2017-08-30 13:29 ` [PATCH v3 0/3] powerpc/mm: Mark memory contexts requiring global TLBIs Frederic Barrat

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=2098488.gckpkjsb17@new-mexico \
    --to=alistair@popple.id.au \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=bsingharora@gmail.com \
    --cc=clombard@linux.vnet.ibm.com \
    --cc=fbarrat@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=vaibhav@linux.vnet.ibm.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