linux_dsm_epyc7002/arch/powerpc/platforms
Alexey Kardashevskiy 56090a3902 powerpc/powernv/ioda: Fix race in TCE level allocation
pnv_tce() returns a pointer to a TCE entry and originally a TCE table
would be pre-allocated. For the default case of 2GB window the table
needs only a single level and that is fine. However if more levels are
requested, it is possible to get a race when 2 threads want a pointer
to a TCE entry from the same page of TCEs.

This adds cmpxchg to handle the race. Note that once TCE is non-zero,
it cannot become zero again.

Fixes: a68bd1267b ("powerpc/powernv/ioda: Allocate indirect TCE levels on demand")
CC: stable@vger.kernel.org # v4.19+
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190718051139.74787-2-aik@ozlabs.ru
2019-08-19 13:20:23 +10:00
..
4xx powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
8xx powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
40x powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
44x powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
52xx treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
82xx treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
83xx treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
85xx powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
86xx powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
512x treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
amigaone treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
cell powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
chrp treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
embedded6xx treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
maple powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
pasemi treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
powermac powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
powernv powerpc/powernv/ioda: Fix race in TCE level allocation 2019-08-19 13:20:23 +10:00
ps3 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 167 2019-05-30 11:26:39 -07:00
pseries powerpc/pseries: Fix cpu_hotplug_lock acquisition in resize_hpt() 2019-08-19 13:20:23 +10:00
fsl_uli1575.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
Kconfig Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
Kconfig.cputype powerpc/mm: Remove radix dependency on HugeTLB page 2019-07-05 00:44:53 +10:00
Makefile powerpc: Add -Werror at arch/powerpc level 2018-10-19 00:56:17 +11:00