WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86: Cache read of cpu_state in __cpu_die

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Cache read of cpu_state in __cpu_die() for subsequent BUG_ON check.
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Sun, 06 Mar 2011 07:00:10 +0000
Delivery-date: Sat, 05 Mar 2011 23:00:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: Cache read of cpu_state in __cpu_die() for subsequent BUG_ON check., Xen patchbot-unstable <=