On Thu, 2019-07-18 at 05:11:36 UTC, Alexey Kardashevskiy wrote:
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.
CC: stable@vger.kernel.org # v4.19+ Fixes: a68bd1267b72 ("powerpc/powernv/ioda: Allocate indirect TCE levels on demand") Signed-off-by: Alexey Kardashevskiy aik@ozlabs.ru
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/56090a3902c80c296e822d11acdb6a101b322c52
cheers