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-devel

[Xen-devel] [Patch] Add comments of code restrictions inside play_dead()

To: Keir Fraser <keir@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [Patch] Add comments of code restrictions inside play_dead()
From: Haitao Shan <maillists.shan@xxxxxxxxx>
Date: Tue, 1 Mar 2011 15:55:36 +0800
Cc:
Delivery-date: Mon, 28 Feb 2011 23:56:16 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=uewnvJjeH8HoSLdKprCCWcHjNJdjVzCb+3t7QllRrSs=; b=rVYPvE9ZSLIKJZAPS7Q74HAXfCAYKl6yBxghxHOUk9gWgiW4EDgnB7MWhOjRGLh6Sj 3GXuxfj+5K1xZv26DOoEIZolZGgL8IXL/b8wCc5jQnFwo32InvIOk954EeDBpzLZqpbZ 2xz0n5pIY2K6I1xjXr6RT2QnTQeILaOwYid3w=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=EtkaPbCz8yEHXojqerdlu2MIJMH3QHiq49yCQ5oFzGPxGximtlraOXMBlYtIfm+i1E WbK4ju7PBDHGcEm0NPTV/v2Nm9fPVSOteZdV//egYyaS3+dsGQd0yTIRElwpifGT5Grn kAA7AvjLrzPZT+p01tFAunPoLsGr802E9Ngik=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This patch adds comments inside play_dead. This can be served as a notice
to developers who will add code to this code path.

Signed-off-by: Shan Haitao <haitao.shan@xxxxxxxxx>

diff -r c5d121fd35c0 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c Mon Feb 28 16:55:20 2011 +0000
+++ b/xen/arch/x86/domain.c Tue Mar 01 16:03:40 2011 +0800
@@ -99,6 +99,14 @@ static void default_dead_idle(void)
 
 static void play_dead(void)
 {
+    /*
+     * Important note:
+     *   After cpu_exit_clear, one can never assume per cpu variables are
+     * still accessable. Otherwise, #PF will happen. For example, calling to
+     * printk() will involve tasklet scheduling ,which also touches per cpu
+     * variables.
+     * Consider more carefully when adding code to this path.
+     */
     cpu_exit_clear(smp_processor_id());
     mb();
     local_irq_disable();

Attachment: add_warning_comment_for_play_dead.patch
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [Patch] Add comments of code restrictions inside play_dead(), Haitao Shan <=