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] acpi sleep: Must acquire hypercall_deadlo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] acpi sleep: Must acquire hypercall_deadlock_mutex when a domain
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Apr 2010 21:50:25 -0700
Delivery-date: Sun, 18 Apr 2010 11:03:44 -0700
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.fraser@xxxxxxxxxx>
# Date 1271333208 -3600
# Node ID fddff17c7c741d85a9a07c1cc3aa2e5921551175
# Parent  22339e54f0bb0ebceee90e9b39c896ff004c6a02
acpi sleep: Must acquire hypercall_deadlock_mutex when a domain
freezes its own vcpus.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/acpi/power.c |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff -r 22339e54f0bb -r fddff17c7c74 xen/arch/x86/acpi/power.c
--- a/xen/arch/x86/acpi/power.c Thu Apr 15 12:29:48 2010 +0100
+++ b/xen/arch/x86/acpi/power.c Thu Apr 15 13:06:48 2010 +0100
@@ -74,10 +74,13 @@ static void device_power_up(void)
     console_resume();
 }
 
-static void freeze_domains(void)
+static int freeze_domains(void)
 {
     struct domain *d;
     struct vcpu *v;
+
+    if ( !spin_trylock(&current->domain->hypercall_deadlock_mutex) )
+        return -EBUSY;
 
     rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
@@ -91,6 +94,10 @@ static void freeze_domains(void)
         }
     }
     rcu_read_unlock(&domlist_read_lock);
+
+    spin_unlock(&current->domain->hypercall_deadlock_mutex);
+
+    return 0;
 }
 
 static void thaw_domains(void)
@@ -254,16 +261,22 @@ int acpi_enter_sleep(struct xenpf_enter_
 
     printk(XENLOG_INFO "Preparing system for ACPI S%d state.", state);
 
-    freeze_domains();
+    rc = freeze_domains();
+    if ( rc )
+        goto unlock_and_fail;
 
     rc = continue_hypercall_on_cpu(0, enter_state_helper, &acpi_sinfo);
     if ( rc )
     {
         /* Continuation will not execute: undo our own work so far. */
         thaw_domains();
-        spin_unlock(&pm_lock);
-    }
-
+        goto unlock_and_fail;
+    }
+
+    return 0;
+
+ unlock_and_fail:
+    spin_unlock(&pm_lock);
     return rc;
 }
 

_______________________________________________
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] acpi sleep: Must acquire hypercall_deadlock_mutex when a domain, Xen patchbot-unstable <=