linux-imx/arch
Suresh Siddha 22950d2535 x86, mtrr: lock stop machine during MTRR rendezvous sequence
[ upstream commit 6d3321e8e2 ]

MTRR rendezvous sequence using stop_one_cpu_nowait() can potentially
happen in parallel with another system wide rendezvous using
stop_machine(). This can lead to deadlock (The order in which
works are queued can be different on different cpu's. Some cpu's
will be running the first rendezvous handler and others will be running
the second rendezvous handler. Each set waiting for the other set to join
for the system wide rendezvous, leading to a deadlock).

MTRR rendezvous sequence is not implemented using stop_machine() as this
gets called both from the process context aswell as the cpu online paths
(where the cpu has not come online and the interrupts are disabled etc).
stop_machine() works with only online cpus.

For now, take the stop_machine mutex in the MTRR rendezvous sequence that
gets called from an online cpu (here we are in the process context
and can potentially sleep while taking the mutex). And the MTRR rendezvous
that gets triggered during cpu online doesn't need to take this stop_machine
lock (as the stop_machine() already ensures that there is no cpu hotplug
going on in parallel by doing get_online_cpus())

    TBD: Pursue a cleaner solution of extending the stop_machine()
         infrastructure to handle the case where the calling cpu is
         still not online and use this for MTRR rendezvous sequence.

fixes: https://bugzilla.novell.com/show_bug.cgi?id=672008

Reported-by: Vadim Kotelnikov <vadimuzzz@inbox.ru>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/20110623182056.807230326@sbsiddha-MOBL3.sc.intel.com
Cc: stable@kernel.org # 2.6.35+, backport a week or two after this gets more testing in mainline
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-08-01 13:55:04 -07:00
..
alpha alpha: fix several security issues 2011-08-01 13:54:59 -07:00
arm ARM: 6989/1: perf: do not start the PMU when no events are 2011-08-01 13:55:04 -07:00
avr32 serial: fix rs485 for atmel_serial on avr32 2010-07-26 11:59:31 -07:00
blackfin BFIN: Fix gen_nand probe structures contents 2010-08-26 16:45:52 -07:00
cris Merge branch 'for-linus' of git://www.jni.nu/cris 2010-06-01 08:51:25 -07:00
frv FRV: Reinstate null behaviour for the GDB remote protocol 'p' command 2010-06-09 12:42:44 -07:00
h8300 Merge branch 'for-35' of git://repo.or.cz/linux-kbuild 2010-06-01 08:55:52 -07:00
ia64 mca.c: Fix cast from integer to pointer warning 2011-04-28 08:21:04 -07:00
m32r m32r: invoke oom-killer from page fault 2010-06-04 15:21:44 -07:00
m68k m68k/mm: Set all online nodes in N_NORMAL_MEMORY 2011-08-01 13:54:42 -07:00
m68knommu Merge branch 'for-35' of git://repo.or.cz/linux-kbuild 2010-06-01 08:55:52 -07:00
microblaze microblaze: Fix build with make 3.82 2010-12-14 23:40:03 +01:00
mips MIPS: DMA: Fix computation of DMA flags from device's coherent_dma_mask. 2011-08-01 13:54:46 -07:00
mn10300 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2010-06-11 14:15:44 -07:00
parisc set memory ranges in N_NORMAL_MEMORY when onlined 2011-08-01 13:54:42 -07:00
powerpc powerpc/kdump: Fix timeout in crash_kexec_wait_realmode 2011-08-01 13:55:01 -07:00
s390 s390: remove task_show_regs 2011-03-31 11:58:07 -07:00
score asm-generic: remove ISA_DMA_THRESHOLD in scatterlist.h 2010-05-27 09:12:54 -07:00
sh 2.6.35.y: Revert "SH: Add missing consts to sys_execve() declaration" 2011-04-28 08:21:16 -07:00
sparc sparc: Write to prom console using indirect buffer. 2011-02-06 11:03:33 -08:00
um uml: fix CONFIG_STATIC_LINK=y build failure with newer glibc 2011-08-01 13:54:58 -07:00
x86 x86, mtrr: lock stop machine during MTRR rendezvous sequence 2011-08-01 13:55:04 -07:00
xtensa xtensa: prevent arbitrary read in ptrace 2011-08-01 13:55:00 -07:00
.gitignore
Kconfig hw-breakpoints: Separate constraint space for data and instruction breakpoints 2010-05-01 04:32:11 +02:00