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 3 of 3] xenpaging: disallow paging in a PoD guest

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 3 of 3] xenpaging: disallow paging in a PoD guest
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Wed, 19 Oct 2011 16:23:23 +0200
Delivery-date: Wed, 19 Oct 2011 07:34:29 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1319034217; l=1520; s=domk; d=aepfle.de; h=To:From:Date:References:In-Reply-To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:X-RZG-CLASS-ID: X-RZG-AUTH; bh=yPepE48zpmVMussofbSnZ9PAzFY=; b=yI0dljOP/DCpSq+MgvRrCQKry3dOpu123CeUSFbmjounCHT5GP8XObFrDVbJau2WeO/ QeDVxYF11w7AbmsppQmEAI6kzlGvFCDg0Bcf0MbXxzGDe1weO6cEBYPUqcu1jQYM6s8LE t12m7E7bTmQQhWRazrfW0yKhteY1aiUSwzU=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1319034200@xxxxxxxxxxxx>
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: <patchbomb.1319034200@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.7.5
# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1319034160 -7200
# Node ID d56219addb9e921a02bce5fa8a97c43eba9bc914
# Parent  cc6184fcd784f94165417073935c5fd0c4b4a76e
xenpaging: disallow paging in a PoD guest

Disallow xenpaging in a PoD guest until coexistance between the two features
is properly implemented.

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

diff -r cc6184fcd784 -r d56219addb9e tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -246,6 +246,9 @@ static xenpaging_t *xenpaging_init(domid
             case ENODEV:
                 ERROR("EPT not supported for this guest");
                 break;
+            case EXDEV:
+                ERROR("xenpaging not supported in a PoD guest");
+                break;
             default:
                 ERROR("Error initialising shared page: %s", strerror(errno));
                 break;
diff -r cc6184fcd784 -r d56219addb9e xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -253,6 +253,7 @@ int mem_event_domctl(struct domain *d, x
     case XEN_DOMCTL_MEM_EVENT_OP_PAGING:
     {
         struct mem_event_domain *med = &d->mem_paging;
+        struct p2m_domain *p2m = p2m_get_hostp2m(d);
         rc = -ENODEV;
         /* Only HAP is supported */
         if ( !hap_enabled(d) )
@@ -262,6 +263,11 @@ int mem_event_domctl(struct domain *d, x
         if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
             break;
 
+        rc = -EXDEV;
+        /* Disallow paging in a PoD guest */
+        if ( p2m->pod.entry_count )
+            break;
+
         switch( mec->op )
         {
         case XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE:

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