xen: use stronger barrier after unlocking lock
commit7bb8fd4ee497a34c68e35d259a20d98cbad7fc94
authorYang Xiaowei <xiaowei.yang@intel.com>
Wed, 9 Sep 2009 19:44:52 +0000 (9 12:44 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Oct 2009 16:31:45 +0000 (5 09:31 -0700)
tree81e7418ff8521f813125e1f7b6b4a15704118715
parent64aa234c396c3f595bc08aed93fd753102a0a0ec
xen: use stronger barrier after unlocking lock

commit 2496afbf1e50c70f80992656bcb730c8583ddac3 upstream.

We need to have a stronger barrier between releasing the lock and
checking for any waiting spinners.  A compiler barrier is not sufficient
because the CPU's ordering rules do not prevent the read xl->spinners
from happening before the unlock assignment, as they are different
memory locations.

We need to have an explicit barrier to enforce the write-read ordering
to different memory locations.

Because of it, I can't bring up > 4 HVM guests on one SMP machine.

[ Code and commit comments expanded -J ]

[ Impact: avoid deadlock when using Xen PV spinlocks ]

Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/xen/spinlock.c