]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: smp.c: Fix uninitialised temp_foreign_map
authorJames Hogan <james.hogan@imgtec.com>
Fri, 4 Mar 2016 10:10:51 +0000 (10:10 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Sun, 13 Mar 2016 09:59:19 +0000 (10:59 +0100)
commite7cad28521a322f732341e7c03e2605b83794200
treef825c3681af8a7a962b95c23c4904d27ac5df35f
parent228ef0aae84c24d919f392a379ecffc4a8fb0edc
MIPS: smp.c: Fix uninitialised temp_foreign_map

When calculate_cpu_foreign_map() recalculates the cpu_foreign_map
cpumask it uses the local variable temp_foreign_map without initialising
it to zero. Since the calculation only ever sets bits in this cpumask
any existing bits at that memory location will remain set and find their
way into cpu_foreign_map too. This could potentially lead to cache
operations suboptimally doing smp calls to multiple VPEs in the same
core, even though the VPEs share primary caches.

Therefore initialise temp_foreign_map using cpumask_clear() before use.

Fixes: 8edc57fcd609 ("MIPS: c-r4k: Fix cache flushing for MT cores")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/12759/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/smp.c