]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
cxl: Keep track of mm struct associated with a context
authorChristophe Lombard <clombard@linux.vnet.ibm.com>
Wed, 26 Apr 2017 21:25:00 +0000 (23:25 +0200)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Wed, 17 May 2017 16:36:38 +0000 (13:36 -0300)
commitec7beb86b184df1085c93c233a1bcb2723d5eb58
treefb132bfa4e77fb32892f97519bd352e142669c15
parent66477b3263094feabea1c2484f8edd54abaf57b5
cxl: Keep track of mm struct associated with a context

BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1686519
The mm_struct corresponding to the current task is acquired each time
an interrupt is raised. So to simplify the code, we only get the
mm_struct when attaching an AFU context to the process.
The mm_count reference is increased to ensure that the mm_struct can't
be freed. The mm_struct will be released when the context is detached.
A reference on mm_users is not kept to avoid a circular dependency if
the process mmaps its cxl mmio and forget to unmap before exiting.
The field glpid (pid of the group leader associated with the pid), of
the structure cxl_context, is removed because it's no longer useful.

Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 6dd2d23403396d8e6d153a6c9db56e1a1012bad8)
Signed-off-by: Breno Leitao <breno.leitao@gmail.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/misc/cxl/api.c
drivers/misc/cxl/context.c
drivers/misc/cxl/cxl.h
drivers/misc/cxl/fault.c
drivers/misc/cxl/file.c
drivers/misc/cxl/main.c