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] xenpaging: allow only one xenpaging call per guest

To: Patrick Colp <pjcolp@xxxxxxxxx>
Subject: [Xen-devel] [PATCH] xenpaging: allow only one xenpaging call per guest
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Wed, 22 Sep 2010 17:41:46 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 22 Sep 2010 08:42:53 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1285170106; l=1368; s=domk; d=aepfle.de; h=In-Reply-To:Content-Type:MIME-Version:References:Subject:Cc:To:From: Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=+JBwI2IDTBtG8fzeiVPN81OYdZI=; b=JsQ+RU3nGseQwDLBDrLzs2ZS9B7ePxNnBVWqFy2Xv4EQ4I7tGZQJJf7LXpJ+eElfHmV X8j/l10W34C9OEMZ0OCjLskFdVF4OY71N8tPVg+rDxol9juoe1ErdpcO9yiDTHDB4wKqe ANHAlA2bIH+PNvfjArSjB3YHFGxGNlNPgfU=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100915160521.GA16644@xxxxxxxxx>
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>
References: <20100915160521.GA16644@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
Make sure only one xenpaging binary is active per domain.
Print info when the host lacks the required features for xenpaging.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

---
 tools/xenpaging/xenpaging.c |   12 +++++++++++-
 xen/arch/x86/mm/mem_event.c |    7 +++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

--- xen-unstable.hg-4.1.22155.orig/tools/xenpaging/xenpaging.c
+++ xen-unstable.hg-4.1.22155/tools/xenpaging/xenpaging.c
@@ -123,7 +123,17 @@ xenpaging_t *xenpaging_init(xc_interface
                              paging->mem_event.ring_page);
     if ( rc != 0 )
     {
-        ERROR("Error initialising shared page");
+        switch ( errno ) {
+            case EBUSY:
+                ERROR("xenpaging is (or was) active on this domain");
+                break;
+            case ENODEV:
+                ERROR("EPT not supported for this guest");
+                break;
+            default:
+                ERROR("Error initialising shared page");
+                break;
+        }
         goto err;
     }
 
--- xen-unstable.hg-4.1.22155.orig/xen/arch/x86/mm/mem_event.c
+++ xen-unstable.hg-4.1.22155/xen/arch/x86/mm/mem_event.c
@@ -226,6 +226,13 @@ int mem_event_domctl(struct domain *d, x
             mfn_t ring_mfn;
             mfn_t shared_mfn;
 
+            /* Only one xenpaging at a time. If xenpaging crashed,
+             * the cache is in an undefined state and so is the guest
+             */
+            rc = -EBUSY;
+            if ( d->mem_event.enabled )
+                break;
+
             /* Currently only EPT is supported */
             rc = -ENODEV;
             if ( !(hap_enabled(d) &&

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel