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 06/18] xenpaging: allow only one xenpaging binary per

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 06/18] xenpaging: allow only one xenpaging binary per guest
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Fri, 15 Oct 2010 16:12:08 +0200
Delivery-date: Fri, 15 Oct 2010 07:26:24 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1287151939; l=1477; s=domk; d=aepfle.de; h=References:Subject:To:From:Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=V8tSFCgUsx+Rt1WdWZXFW9mzQ3o=; b=bBzcmD/u5yZ3y+sAhEIxYC1zMsGNk15JVjKkWcYBu1IPpv/y5JiYwxM9tJc8CfaSrT3 f7dy1YHQi3igBmYlk1zowQAl9ob8FEzyGAneJFYtvW8lEy4idshUcaxoxGQYMmtstf5pI gmuDvX2DdJQDafBqSs8DHAEcAlJL3FzsJ/I=
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>
References: <20101015141202.309585877@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.48-4.4
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>
Already-Acked-by: Patrick Colp <pjcolp@xxxxxxxxx>
Already-Acked-by: Keir Fraser <keir.fraser@xxxxxxxxxx>

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

--- xen-4.0.1-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.0.1-testing/tools/xenpaging/xenpaging.c
@@ -119,7 +119,17 @@ xenpaging_t *xenpaging_init(domid_t doma
                              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-4.0.1-testing.orig/xen/arch/x86/mm/mem_event.c
+++ xen-4.0.1-testing/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 ( !(is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled &&


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

<Prev in Thread] Current Thread [Next in Thread>