diff options
author | Keir Fraser <keir@xen.org> | 2011-03-05 16:05:52 +0000 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2011-03-05 16:05:52 +0000 |
commit | e61c7eefd4f5e2d4fb6da1a3d31a3ce7af0454b5 (patch) | |
tree | df0a072372f9451ff4c2861a8bd063252debd2d2 | |
parent | 1cb39d117f79892e49eb4992f6f1c4c190379b31 (diff) | |
download | xen-e61c7eefd4f5e2d4fb6da1a3d31a3ce7af0454b5.tar.gz xen-e61c7eefd4f5e2d4fb6da1a3d31a3ce7af0454b5.tar.bz2 xen-e61c7eefd4f5e2d4fb6da1a3d31a3ce7af0454b5.zip |
x86: Cache read of cpu_state in __cpu_die() for subsequent BUG_ON check.
Otherwise compiler may re-read cpu_state for the BUG_ON and see a
modified value causing erroneous BUG.
Signed-off-by: Keir Fraser <keir@xen.org>
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen-unstable changeset: 22977:bbc03993d31f
xen-unstable date: Sat Mar 05 16:02:33 2011 +0000
-rw-r--r-- | xen/arch/x86/smpboot.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index 7c14f06286..39eb583e84 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -861,10 +861,11 @@ void __cpu_die(unsigned int cpu) { /* We don't do anything here: idle task is faking death itself. */ unsigned int i = 0; + enum cpu_state seen_state; - while ( cpu_state != CPU_STATE_DEAD ) + while ( (seen_state = cpu_state) != CPU_STATE_DEAD ) { - BUG_ON(cpu_state != CPU_STATE_DYING); + BUG_ON(seen_state != CPU_STATE_DYING); mdelay(100); cpu_relax(); process_pending_softirqs(); |