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] hvm: Fix PV-on-HVM drivers to not execuit

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] hvm: Fix PV-on-HVM drivers to not execuite hypercall page while it is
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 07 Aug 2007 05:30:27 -0700
Delivery-date: Tue, 07 Aug 2007 05:29:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1186395374 -3600
# Node ID b82e6818fb31c6373ccd3e840ef2f9719d5f21a3
# Parent  e1435c1f3382069ca5044808b3233bda8b09d150
hvm: Fix PV-on-HVM drivers to not execuite hypercall page while it is
being re-initialised.
Signed-off-by: Edwin Zhai <edwin.zhai@xxxxxxxxx>
---
 unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c |   10 ++++++++++
 1 files changed, 10 insertions(+)

diff -r e1435c1f3382 -r b82e6818fb31 
unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c
--- a/unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c        Mon Aug 
06 11:08:57 2007 +0100
+++ b/unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c        Mon Aug 
06 11:16:14 2007 +0100
@@ -10,6 +10,12 @@ struct ap_suspend_info {
        int      do_spin;
        atomic_t nr_spinning;
 };
+
+/*
+ * Use a rwlock to protect the hypercall page from being executed in AP context
+ * while the BSP is re-initializing it after restore.
+ */
+static DEFINE_RWLOCK(suspend_lock);
 
 /*
  * Spinning prevents, for example, APs touching grant table entries while
@@ -27,7 +33,9 @@ static void ap_suspend(void *_info)
 
        while (info->do_spin) {
                cpu_relax();
+               read_lock(&suspend_lock);
                HYPERVISOR_yield();
+               read_unlock(&suspend_lock);
        }
 
        mb();
@@ -43,7 +51,9 @@ static int bp_suspend(void)
        suspend_cancelled = HYPERVISOR_shutdown(SHUTDOWN_suspend);
 
        if (!suspend_cancelled) {
+               write_lock(&suspend_lock);
                platform_pci_resume();
+               write_unlock(&suspend_lock);
                gnttab_resume();
                irq_resume();
        }

_______________________________________________
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] hvm: Fix PV-on-HVM drivers to not execuite hypercall page while it is, Xen patchbot-unstable <=