alistair23-linux/arch/mips
James Hogan 11f769039e MIPS: c-r4k: Use SMP calls for CM indexed cache ops
The MIPS Coherence Manager (CM) can propagate address-based ("hit")
cache operations to other cores in the coherent system, alleviating
software of the need to use SMP calls, however indexed cache operations
are not propagated by hardware since doing so makes no sense for
separate caches.

Update r4k_op_needs_ipi() to report that only hit cache operations are
globalized by the CM, requiring indexed cache operations to be
globalized by software via an SMP call.

r4k_on_each_cpu() previously had a special case for CONFIG_MIPS_MT_SMP,
intended to avoid the SMP calls when the only other CPUs in the system
were other VPEs in the same core, and hence sharing the same caches.
This was changed by commit cccf34e941 ("MIPS: c-r4k: Fix cache
flushing for MT cores") to apparently handle multi-core multi-VPE
systems, but it focussed mainly on hit cache ops, so the SMP calls were
still disabled entirely for CM systems.

This doesn't normally cause problems, but tests can be written to hit
these corner cases by using multiple threads, or changing task
affinities to force the process to migrate cores. For example the
failure of mprotect RW->RX to globally sync icaches (via
flush_cache_range) can be detected by modifying and mprotecting a code
page on one core, and migrating to a different core to execute from it.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Leonid Yegoshin <leonid.yegoshin@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/13807/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2016-07-29 10:19:30 +02:00
..
alchemy Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2016-05-19 10:02:26 -07:00
ar7
ath25
ath79 TTY and Serial driver update for 4.7-rc1 2016-05-20 20:57:27 -07:00
bcm47xx
bcm63xx
bmips MIPS: BMIPS: Add support for BCM63268 2016-05-13 14:02:09 +02:00
boot MIPS: devicetree: fix cpu interrupt controller node-names 2016-05-28 12:35:12 +02:00
cavium-octeon MIPS: SMP: Update cpu_foreign_map on CPU disable 2016-07-29 10:19:28 +02:00
cobalt
configs MIPS: Add default configuration for ath25 2016-07-24 12:45:59 +02:00
dec MIPS: DEC: Export `ioasic_ssr_lock' to modules 2016-05-17 11:03:54 +02:00
emma
fw
include MIPS: c-r4k: Exclude sibling CPUs in SMP calls 2016-07-29 10:19:29 +02:00
jazz
jz4740 MTD updates for v4.7: 2016-05-24 11:00:20 -07:00
kernel MIPS: c-r4k: Exclude sibling CPUs in SMP calls 2016-07-29 10:19:29 +02:00
kvm MIPS: KVM: Fix CACHE triggered exception emulation 2016-06-14 10:59:45 +02:00
lantiq MIPS: Lantiq: Use the real EXIN count 2016-07-24 12:31:58 +02:00
lasat MIPS: Lasat: A couple off by one bugs in picvue_proc.c 2016-05-28 12:35:06 +02:00
lib MIPS: lib: Mark intrinsics notrace 2016-05-28 12:35:11 +02:00
loongson32
loongson64 MIPS: SMP: Update cpu_foreign_map on CPU disable 2016-07-29 10:19:28 +02:00
math-emu MIPS: math-emu: Fix typo 2016-05-28 12:35:09 +02:00
mm MIPS: c-r4k: Use SMP calls for CM indexed cache ops 2016-07-29 10:19:30 +02:00
mti-malta MIPS: malta-time: Take seconds into account 2016-05-13 15:30:25 +02:00
mti-sead3
net
netlogic MIPS: Define & use CP0_EBase bit definitions 2016-05-13 15:30:25 +02:00
oprofile MIPS: oprofile: Fix typo 2016-05-28 12:35:09 +02:00
paravirt
pci MIPS: IP27: Fix typo 2016-05-28 12:35:07 +02:00
pic32 Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2016-05-19 10:02:26 -07:00
pistachio MIPS: Pistachio: Remove plat_setup_iocoherency 2016-07-24 12:41:22 +02:00
pmcs-msp71xx
pnx833x MIPS: make PCI_DMA_BUS_IS_PHYS=1 constant 2016-05-13 14:02:17 +02:00
power
ralink MIPS: ralink: add MT7628 EPHY LEDs pinmux support 2016-05-28 12:35:05 +02:00
rb532
sgi-ip22
sgi-ip27 MIPS: Spelling fix lets -> let's 2016-05-28 12:35:09 +02:00
sgi-ip32
sibyte
sni MIPS: Spelling fix lets -> let's 2016-05-28 12:35:09 +02:00
txx9
vdso MIPS: Build microMIPS VDSO for microMIPS kernels 2016-05-28 12:35:12 +02:00
vr41xx MIPS: VR41xx: Fix typo 2016-05-28 12:35:09 +02:00
xilfpga
Kbuild
Kbuild.platforms
Kconfig MIPS: Pistachio: Remove plat_setup_iocoherency 2016-07-24 12:41:22 +02:00
Kconfig.debug
Makefile MIPS: Fix VZ probe gas errors with binutils <2.24 2016-05-17 11:06:04 +02:00