From: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
To: alistair@popple.id.au, aneesh.kumar@linux.vnet.ibm.com,
bsingharora@gmail.com, linuxppc-dev@lists.ozlabs.org,
mpe@ellerman.id.au
Subject: [RFC 2/2] cxl: Mark context requiring global TLBIs
Date: Wed, 3 May 2017 16:29:06 +0200 [thread overview]
Message-ID: <20170503142906.29220-3-fbarrat@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170503142906.29220-1-fbarrat@linux.vnet.ibm.com>
The PSL needs to see all TLBI pertinent to the memory contexts used on
the cxl adapter. For the hash memory model, it was done by making all
TLBIs global as soon as the cxl driver is in us. 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.
Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
---
drivers/misc/cxl/api.c | 5 ++++-
drivers/misc/cxl/file.c | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c
index 1a138c83f877..86b2ad86fdee 100644
--- a/drivers/misc/cxl/api.c
+++ b/drivers/misc/cxl/api.c
@@ -347,7 +347,10 @@ int cxl_start_context(struct cxl_context *ctx, u64 wed,
cxl_context_mm_count_put(ctx);
goto out;
}
-
+#ifdef CONFIG_PPC_BOOK3S_64
+ if (ctx->mm)
+ mm_context_set_global_tlbi(&ctx->mm->context);
+#endif
ctx->status = STARTED;
out:
mutex_unlock(&ctx->status_mutex);
diff --git a/drivers/misc/cxl/file.c b/drivers/misc/cxl/file.c
index 17b433f1ce23..c7ead488eee2 100644
--- a/drivers/misc/cxl/file.c
+++ b/drivers/misc/cxl/file.c
@@ -239,7 +239,10 @@ static long afu_ioctl_start_work(struct cxl_context *ctx,
cxl_context_mm_count_put(ctx);
goto out;
}
-
+#ifdef CONFIG_PPC_BOOK3S_64
+ if (ctx->mm)
+ mm_context_set_global_tlbi(&ctx->mm->context);
+#endif
ctx->status = STARTED;
rc = 0;
out:
--
2.11.0
next prev parent reply other threads:[~2017-05-03 14:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-03 14:29 [RFC 0/2] powerpc/mm: Mark memory contexts requiring global TLBIs Frederic Barrat
2017-05-03 14:29 ` [RFC 1/2] powerpc/mm: Add marker for contexts requiring global TLB invalidations Frederic Barrat
2017-05-04 6:41 ` Aneesh Kumar K.V
2017-05-04 17:24 ` Frederic Barrat
2017-05-04 7:25 ` Balbir Singh
2017-05-04 9:24 ` Michael Ellerman
2017-05-04 9:42 ` Michael Ellerman
2017-05-07 11:15 ` Frederic Barrat
2017-05-03 14:29 ` Frederic Barrat [this message]
2017-05-04 7:39 ` [RFC 2/2] cxl: Mark context requiring global TLBIs Balbir Singh
2017-05-07 10:41 ` Frederic Barrat
2017-05-05 5:28 ` [RFC 0/2] powerpc/mm: Mark memory contexts " Alistair Popple
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=20170503142906.29220-3-fbarrat@linux.vnet.ibm.com \
--to=fbarrat@linux.vnet.ibm.com \
--cc=alistair@popple.id.au \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=bsingharora@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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).