kernel_optimize_test/arch/mips
Ralf Baechle a76ab5c10d [MIPS] MT: Fix bug in multithreaded kernels.
When GDB writes a breakpoint into address area of inferior process the
kernel needs to invalidate the modified memory in the inferior which
is done by calling flush_cache_page which in turns calls
r4k_flush_cache_page and local_r4k_flush_cache_page for VSMP or SMTC
kernel via r4k_on_each_cpu().

As the VSMP and SMTC SMP kernels for 34K are running on a single shared
caches it is possible to get away without interprocessor function calls.
This optimization is implemented in r4k_on_each_cpu, so
local_r4k_flush_cache_page is only ever called on the local CPU.

This is where the following code in local_r4k_flush_cache_page() strikes:

        /*
         * If ownes no valid ASID yet, cannot possibly have gotten
         * this page into the cache.
         */
        if (cpu_context(smp_processor_id(), mm) == 0)
                return;

On VSMP and SMTC had a function of cpu_context() for each CPU(TC).

So in case another CPU than the CPU executing local_r4k_cache_flush_page
has not accessed the mm but one of the other CPUs has there may be data
to be flushed in the cache yet local_r4k_cache_flush_page will falsely
return leaving the I-cache inconsistent for the breakpoint.

While the issue was discovered with GDB it also exists in
local_r4k_flush_cache_range() and local_r4k_flush_cache().

Fixed by introducing a new function has_valid_asid which on MT kernels
returns true if a mm is active on any processor in the system.

This is relativly expensive since for memory acccesses in that loop
cache misses have to be assumed but it seems the most viable solution
for 2.6.23 and older -stable kernels.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-10-29 19:35:37 +00:00
..
au1000 [MIPS] Alchemy: Register platform devices 2007-10-29 19:35:36 +00:00
basler/excite [MIPS] time: Merge eXcite plat_timer_setup into plat_time_init. 2007-10-29 19:35:34 +00:00
bcm47xx [MIPS] Kill duplicated setup_irq() for cp0 timer 2007-10-19 18:15:58 +01:00
boot [MIPS] checkfiles: Fix "need space after that ','" errors. 2007-10-11 23:46:15 +01:00
cobalt [MIPS] time: Add GT641xx timer0 clockevent driver 2007-10-22 22:09:00 +01:00
configs [MIPS] Alchemy: Remove CONFIG_TS_AU1X00_ADS7846 from defconfigs. 2007-10-29 19:35:37 +00:00
dec [MIPS] Allow hardwiring of the CPU type to a single type for optimization. 2007-10-11 23:46:15 +01:00
emma2rh [MIPS] Kill duplicated setup_irq() for cp0 timer 2007-10-19 18:15:58 +01:00
fw [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
gt64120/wrppmc [MIPS] time: Remove wrppmc's definition of plat_timer_setup. 2007-10-29 19:35:34 +00:00
jazz [MIPS] Jazz: Retire use of plat_timer_setup. 2007-10-18 18:11:47 +01:00
jmr3927 [MIPS] txx9tmr clockevent/clocksource driver 2007-10-29 19:35:35 +00:00
kernel [MIPS] vmlinux.ld.S: correctly indent .data section 2007-10-29 19:35:37 +00:00
lasat [MIPS] time: Merge lasat plat_timer_setup into plat_time_init. 2007-10-29 19:35:34 +00:00
lemote/lm2e [MIPS] Kill duplicated setup_irq() for cp0 timer 2007-10-19 18:15:58 +01:00
lib [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
math-emu [MIPS] checkfiles: Fix "need space after that ','" errors. 2007-10-11 23:46:15 +01:00
mips-boards [MIPS] time: Replace plat_timer_setup with modern APIs. 2007-10-29 19:35:36 +00:00
mipssim [MIPS] time: Replace plat_timer_setup with modern APIs. 2007-10-29 19:35:36 +00:00
mm [MIPS] MT: Fix bug in multithreaded kernels. 2007-10-29 19:35:37 +00:00
oprofile Combine instrumentation menus in kernel/Kconfig.instrumentation 2007-10-19 11:53:54 -07:00
pci Author: Ralf Baechle <ralf@linux-mips.org> 2007-10-29 19:35:37 +00:00
philips/pnx8550 [MIPS] checkfiles: Fix "need space after that ','" errors. 2007-10-11 23:46:15 +01:00
pmc-sierra Author: Ralf Baechle <ralf@linux-mips.org> 2007-10-29 19:35:37 +00:00
qemu [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
sgi-ip22 [MIPS] IP22: Fix hang due to messing with timer interrupt handler 2007-10-17 18:28:49 +01:00
sgi-ip27 [MIPS] IP27: Fix slice logic to work for arbitrary number of slices. 2007-10-29 19:35:35 +00:00
sgi-ip32 [MIPS] IP32: Fixes after interrupt renumbering. 2007-10-29 19:35:35 +00:00
sibyte [MIPS] time: Fix cut'n'paste bug in Sibyte clockevent driver. 2007-10-29 19:35:36 +00:00
sni [MIPS] SNI: Convert a20r timer to clockevent device. 2007-10-29 19:35:34 +00:00
tx4927 [MIPS] txx9tmr clockevent/clocksource driver 2007-10-29 19:35:35 +00:00
tx4938 [MIPS] txx9tmr clockevent/clocksource driver 2007-10-29 19:35:35 +00:00
vr41xx [MIPS] Kill duplicated setup_irq() for cp0 timer 2007-10-19 18:15:58 +01:00
defconfig [MIPS] Update a few defconfigs. 2007-08-27 02:16:55 +01:00
Kconfig [MIPS] txx9tmr clockevent/clocksource driver 2007-10-29 19:35:35 +00:00
Kconfig.debug [MIPS] Kbuild: Use the new cc-cross-prefix feature. 2007-10-22 22:09:01 +01:00
Makefile [MIPS] Kbuild: Use the new cc-cross-prefix feature. 2007-10-22 22:09:01 +01:00