linux-stable/drivers/misc
Vaibhav Jain 7b8ad495d5 cxl: Fix DSI misses when the context owning task exits
Presently when a user-space process issues CXL_IOCTL_START_WORK ioctl we
store the pid of the current task_struct and use it to get pointer to
the mm_struct of the process, while processing page or segment faults
from the capi card. However this causes issues when the thread that had
originally issued the start-work ioctl exits in which case the stored
pid is no more valid and the cxl driver is unable to handle faults as
the mm_struct corresponding to process is no more accessible.

This patch fixes this issue by using the mm_struct of the next alive
task in the thread group. This is done by iterating over all the tasks
in the thread group starting from thread group leader and calling
get_task_mm on each one of them. When a valid mm_struct is obtained the
pid of the associated task is stored in the context replacing the
exiting one for handling future faults.

The patch introduces a new function named get_mem_context that checks if
the current task pointed to by ctx->pid is dead? If yes it performs the
steps described above. Also a new variable cxl_context.glpid is
introduced which stores the pid of the thread group leader associated
with the context owning task.

Reported-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Reported-by: Frank Haverkamp <HAVERKAM@de.ibm.com>
Suggested-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-01-05 16:28:25 +11:00
..
altera-stapl drivers/misc/altera-stapl/altera.c: remove extraneous KERN_INFO prefix 2015-06-25 17:00:38 -07:00
c2port drivers: misc: Drop unlikely before IS_ERR(_OR_NULL) 2015-09-29 15:11:40 +02:00
cb710
cxl cxl: Fix DSI misses when the context owning task exits 2016-01-05 16:28:25 +11:00
echo
eeprom - New Device Support 2015-11-06 10:23:50 -08:00
genwqe misc: genwqe: fix a comment typo 2015-10-04 12:57:15 +01:00
ibmasm
lis3lv02d spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
mei char/misc drivers for 4.4-rc1 2015-11-04 22:15:15 -08:00
mic misc: mic/scif: fix error code in scif_create_remote_lookup() 2015-10-17 21:49:48 -07:00
sgi-gru misc: sgi-gru: fix return of error 2015-10-04 12:55:59 +01:00
sgi-xp mm: rename alloc_pages_exact_node() to __alloc_pages_node() 2015-09-08 15:35:28 -07:00
ti-st ti-st: use worker instead of calling st_int_write in wake up 2015-09-20 22:52:13 -07:00
vmw_vmci misc/vmw_vmci: use kmemdup rather than duplicating its implementation 2015-09-20 19:27:58 -07:00
ad525x_dpot-i2c.c misc: ad525x_dpot: Remove unnecessary MODULE_ALIAS() 2015-09-20 19:33:29 -07:00
ad525x_dpot-spi.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
ad525x_dpot.c ad525x_dpot:Remove break after return 2015-01-12 05:04:12 -08:00
ad525x_dpot.h
apds990x.c misc: Drop owner assignment from i2c_driver 2015-08-10 08:37:35 +02:00
apds9802als.c
arm-charlcd.c
atmel-ssc.c
atmel_tclib.c misc: atmel_tclib: get and use slow clock 2015-10-06 12:33:14 +02:00
bh1770glc.c misc: Drop owner assignment from i2c_driver 2015-08-10 08:37:35 +02:00
bh1780gli.c misc: bh1780: Add module aliases 2015-03-16 21:10:28 +01:00
bmp085-i2c.c misc: Drop owner assignment from i2c_driver 2015-08-10 08:37:35 +02:00
bmp085-spi.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
bmp085.c
bmp085.h
cs5535-mfgpt.c
ds1682.c misc: ds1682: clean up ds1682_eeprom_read() and ds1682_eeprom_write() 2015-08-05 13:53:39 -07:00
dummy-irq.c
enclosure.c enclosure: fix WARN_ON removing an adapter in multi-path devices 2015-03-31 08:53:36 +03:00
fsa9480.c
hmc6352.c
hpilo.c misc: hpilo: Change e-mail address from hp.com to hpe.com 2015-10-04 12:42:33 +01:00
hpilo.h
ics932s401.c
ioc4.c
isl29003.c misc: Drop owner assignment from i2c_driver 2015-08-10 08:37:35 +02:00
isl29020.c
Kconfig VMware balloon: Enable notification via VMCI 2015-10-04 12:59:11 +01:00
kgdbts.c drivers/misc: make kgdbts.c slightly more explicitly non-modular 2015-09-20 19:32:35 -07:00
lattice-ecp3-config.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
lkdtm.c lkdtm: fix ACCESS_USERSPACE test 2015-10-29 09:02:16 +09:00
Makefile ARM: qcom: Add coincell charger driver 2015-07-29 13:37:18 -07:00
pch_phub.c
phantom.c
pti.c
qcom-coincell.c ARM: qcom: Add coincell charger driver 2015-07-29 13:37:18 -07:00
spear13xx_pcie_gadget.c spear13xx_pcie_gadget: use per-attribute show and store methods 2015-10-13 22:17:40 -07:00
sram.c misc: sram: partition base address belongs to __iomem space 2015-10-18 19:00:36 -07:00
ti_dac7512.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
tifm_7xx1.c misc: tifm: match return type of wait_for_completion_timeout 2015-03-25 11:36:38 +01:00
tifm_core.c
tsl2550.c misc: Drop owner assignment from i2c_driver 2015-08-10 08:37:35 +02:00
vexpress-syscfg.c
vmw_balloon.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00