summaryrefslogtreecommitdiff
path: root/drivers/misc/cxl/cxl.h
diff options
context:
space:
mode:
authorIan Munsie <imunsie@au1.ibm.com>2015-08-27 19:50:19 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2015-08-30 18:47:26 +1000
commit55e07668fbba9466e6a9ef7650718356cda38406 (patch)
tree8125e4c7a0504f582f50817e3830790ccc788923 /drivers/misc/cxl/cxl.h
parentaf2a50bb0ce1ca7a9c4784813419c922bf2285df (diff)
cxl: Fix force unmapping mmaps of contexts allocated through the kernel api
The cxl user api uses the address_space associated with the file when we need to force unmap all cxl mmap regions (e.g. on eeh, driver detach, etc). Currently, contexts allocated through the kernel api do not do this and instead skip the mmap invalidation, potentially allowing them to poke at the hardware after such an event, which may cause all sorts of trouble. This patch allocates an address_space for cxl contexts allocated through the kernel api so that the same invalidate path will for these contexts as well. We don't use the anonymous inode's address_space, as doing so could invalidate any mmaps of completely unrelated drivers using anonymous file descriptors. This patch also introduces a kernelapi flag, so we know when freeing the context if the address_space was allocated by us and needs to be freed. Signed-off-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/misc/cxl/cxl.h')
-rw-r--r--drivers/misc/cxl/cxl.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
index e7af256f60c5..d6566c60bcb0 100644
--- a/drivers/misc/cxl/cxl.h
+++ b/drivers/misc/cxl/cxl.h
@@ -420,6 +420,7 @@ struct cxl_context {
struct mutex mapping_lock;
struct page *ff_page;
bool mmio_err_ff;
+ bool kernelapi;
spinlock_t sste_lock; /* Protects segment table entries */
struct cxl_sste *sstp;