linux_dsm_epyc7002/arch/powerpc/platforms
Alistair Popple 28a5933e8d powerpc/powernv/npu: Add lock to prevent race in concurrent context init/destroy
The pnv_npu2_init_context() and pnv_npu2_destroy_context() functions
are used to allocate/free contexts to allow address translation and
shootdown by the NPU on a particular GPU. Context initialisation is
implicitly safe as it is protected by the requirement mmap_sem be held
in write mode, however pnv_npu2_destroy_context() does not require
mmap_sem to be held and it is not safe to call with a concurrent
initialisation for a different GPU.

It was assumed the driver would ensure destruction was not called
concurrently with initialisation. However the driver may be simplified
by allowing concurrent initialisation and destruction for different
GPUs. As npu context creation/destruction is not a performance
critical path and the critical section is not large a single spinlock
is used for simplicity.

Fixes: 1ab66d1fba ("powerpc/powernv: Introduce address translation services for Nvlink2")
Cc: stable@vger.kernel.org # v4.12+
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Mark Hairgrove <mhairgrove@nvidia.com>
Tested-by: Mark Hairgrove <mhairgrove@nvidia.com>
Reviewed-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-04-24 09:46:56 +10:00
..
4xx powerpc/4xx: Fix error return code in ppc4xx_msi_probe() 2018-03-31 00:10:34 +11:00
8xx powerpc/8xx: fix cpm_cascade() dual end of interrupt 2018-03-13 15:50:28 +11:00
40x
44x
52xx
82xx
83xx
85xx powerpc/64: Use array of paca pointers and allocate pacas individually 2018-03-30 23:34:23 +11:00
86xx
512x
amigaone
cell proc: fix /proc/loadavg regression 2018-04-20 17:18:36 -07:00
chrp
embedded6xx powerpc/wii: Don't rely on the reserved memory hack 2018-04-01 00:47:43 +11:00
maple
pasemi
powermac powerpc: Use sizeof(*foo) rather than sizeof(struct foo) 2018-03-20 16:47:53 +11:00
powernv powerpc/powernv/npu: Add lock to prevent race in concurrent context init/destroy 2018-04-24 09:46:56 +10:00
ps3 powerpc: Use sizeof(*foo) rather than sizeof(struct foo) 2018-03-20 16:47:53 +11:00
pseries powerpc/pseries: Restore default security feature flags on setup 2018-04-03 21:50:09 +10:00
fsl_uli1575.c
Kconfig
Kconfig.cputype powerpc/64s: Add POWER9 CPU type selection 2018-04-01 22:15:32 +10:00
Makefile