diff options
| author | Alexey Kardashevskiy <[email protected]> | 2019-07-18 05:11:36 +0000 |
|---|---|---|
| committer | Michael Ellerman <[email protected]> | 2019-08-19 03:20:23 +0000 |
| commit | 56090a3902c80c296e822d11acdb6a101b322c52 (patch) | |
| tree | e28bf46263ab7b6f0a9dd4fb6a40c0b0959be343 /arch/powerpc/sysdev/dart_iommu.c | |
| parent | powerpc/pseries: Fix cpu_hotplug_lock acquisition in resize_hpt() (diff) | |
| download | kernel-56090a3902c80c296e822d11acdb6a101b322c52.tar.gz kernel-56090a3902c80c296e822d11acdb6a101b322c52.zip | |
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: a68bd1267b72 ("powerpc/powernv/ioda: Allocate indirect TCE levels on demand")
CC: [email protected] # v4.19+
Signed-off-by: Alexey Kardashevskiy <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'arch/powerpc/sysdev/dart_iommu.c')
0 files changed, 0 insertions, 0 deletions
