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-4.1-testing] x86: Cache read of cpu_state in __cpu_

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.1-testing] x86: Cache read of cpu_state in __cpu_die() for subsequent BUG_ON check.
From: Xen patchbot-4.1-testing <patchbot@xxxxxxx>
Date: Sun, 06 Mar 2011 17:50:13 +0000
Delivery-date: Sun, 06 Mar 2011 09:51:13 -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 1299341152 0
# Node ID 0f9f2248127e91ae95ca9b8b9b2db17ad0719bcb
# Parent  9d4cdf7d70b9ef9e2907954e42600a2eed71947d
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>
xen-unstable changeset:   22977:bbc03993d31f
xen-unstable date:        Sat Mar 05 16:02:33 2011 +0000
---


diff -r 9d4cdf7d70b9 -r 0f9f2248127e xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c    Sat Mar 05 11:37:42 2011 +0000
+++ b/xen/arch/x86/smpboot.c    Sat Mar 05 16:05:52 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-4.1-testing] x86: Cache read of cpu_state in __cpu_die() for subsequent BUG_ON check., Xen patchbot-4 . 1-testing <=