[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: Cache read of cpu_state in __cpu_die() for subsequent BUG_ON check.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1299340953 0
# Node ID bbc03993d31f5b9c56c44b068cdd00f08971c21c
# Parent  a1108fe570869a8c05c547497cb9e18c8445f6e8
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@xxxxxxx>
Signed-off-by: Liu, Jinsong <jinsong.liu@xxxxxxxxx>
---


diff -r a1108fe57086 -r bbc03993d31f xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c    Sat Mar 05 11:36:21 2011 +0000
+++ b/xen/arch/x86/smpboot.c    Sat Mar 05 16:02:33 2011 +0000
@@ -861,10 +861,11 @@
 {
     /* 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();

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.