aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/smpboot.c
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2011-03-05 16:02:33 +0000
committerKeir Fraser <keir@xen.org>2011-03-05 16:02:33 +0000
commite63aa7c25bcad93030b276c5fce6df175f4c4dd6 (patch)
tree3d369bc91212efcb6466e30f68bb6ce33339912b /xen/arch/x86/smpboot.c
parente00d02009db149c6b9ee52da9d0907e9fe362a23 (diff)
downloadxen-e63aa7c25bcad93030b276c5fce6df175f4c4dd6.tar.gz
xen-e63aa7c25bcad93030b276c5fce6df175f4c4dd6.tar.bz2
xen-e63aa7c25bcad93030b276c5fce6df175f4c4dd6.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>
Diffstat (limited to 'xen/arch/x86/smpboot.c')
-rw-r--r--xen/arch/x86/smpboot.c5
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();