linux-imx/include
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
..
acpi acpi: fix bogus preemption logic 2010-08-26 16:45:43 -07:00
asm-generic bug.h: Add WARN_RATELIMIT 2011-08-01 13:54:59 -07:00
crypto crypto: skcipher - Add ablkcipher_walk interfaces 2010-05-19 14:13:07 +10:00
drm drm: fix unsigned vs signed comparison issue in modeset ctl ioctl. 2011-03-31 11:58:15 -07:00
keys RxRPC: Fix v1 keys 2011-03-31 11:58:19 -07:00
linux x86, mtrr: lock stop machine during MTRR rendezvous sequence 2011-08-01 13:55:04 -07:00
math-emu math-emu: correct test for downshifting fraction in _FP_FROM_INT() 2010-07-20 18:45:14 -07:00
media V4L/DVB: tuner: Add a definition for the Philips FQ1236 MK5 NTSC tuner 2010-07-08 16:49:53 -03:00
mtd
net inet_diag: Make sure we actually run the same bytecode we audited. 2011-04-28 08:21:01 -07:00
pcmcia pcmcia: remove unused mem_op.h 2010-05-10 10:23:20 +02:00
rdma IB/core: Allow device-specific per-port sysfs files 2010-05-21 10:34:44 -07:00
rxrpc
scsi ses: Avoid kernel panic when lun 0 is not mapped 2011-03-31 11:58:50 -07:00
sound ASoC: Explicitly say registerless widgets have no register 2011-04-28 08:20:51 -07:00
trace tracing: Fix timer tracing 2010-08-26 16:46:32 -07:00
video fbdev: move FBIO_WAITFORVSYNC to linux/fb.h 2010-05-25 08:07:09 -07:00
xen xen: Provide a variant of __RING_SIZE() that is an integer constant expression 2011-02-06 11:03:40 -08:00
Kbuild