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 7] REDO2: mem_access & mem_access 2: access list

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 3 of 7] REDO2: mem_access & mem_access 2: access listener can be required
From: Joe Epstein <jepstein98@xxxxxxxxx>
Date: Wed, 5 Jan 2011 19:53:33 -0800
Delivery-date: Wed, 05 Jan 2011 20:00:13 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=aPXo0h9ztalDQFpCfTiopVES0jo06TUWnC1JiGoFiSQ=; b=lfMaLNKsx1DLqMH8TIdRRLGfg+rWBUvP9WEE7qv3DAgsOFNW7C0Kuy9B3dFmnMTwSN CyKrZ3HL/3ITBjfhq44azSqL9PngIcITjjQxMg2XXFIhK/zYcYkTGCLofvyQE/cVEfsG WtqGxICZM9K0m267qS2dglhVTl4Jyyf4T8u64=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=SYG4CsZZcUNFe6aUOeDCRkXvbDUl02NgERaX8aJQ6TEXS+Pflwx1KkO6FgT/hfrmwH IlL1RmLQhpQsv7Nq8i25U2/SQCleBjdhhzMVX0l0AhiUAtqoCOJQUIYO7x56Y+4ra/3Y 0mTS/+ILEazEUUq0s58EmDi4MEljdYZMNPy1A=
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
* Adds the ability to set that a domain that an access listener;
  that is, it pauses the VCPU if there is no memory event listener.

Signed-off-by: Joe Epstein <jepstein98@xxxxxxxxx


diff -r 253cc5185fb5 -r 281e5488ee97 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c    Wed Jan 05 18:49:34 2011 -0800
+++ b/xen/arch/x86/domctl.c    Wed Jan 05 18:50:54 2011 -0800
@@ -1566,6 +1566,26 @@ long arch_do_domctl(
     break;
 #endif /* __x86_64__ */
 
+    case XEN_DOMCTL_set_access_required:
+    {
+        struct domain *d;
+        struct p2m_domain* p2m;
+       
+        ret = -EPERM;
+        if ( current->domain->domain_id == domctl->domain )
+            break;
+
+        ret = -ESRCH;
+        d = rcu_lock_domain_by_id(domctl->domain);
+        if ( d != NULL )
+        {
+            p2m = p2m_get_hostp2m(d);
+            p2m->access_required = domctl->u.access_required.access_required;
+            rcu_unlock_domain(d);
+        }
+    }
+    break;
+
     default:
         ret = -ENOSYS;
         break;
diff -r 253cc5185fb5 -r 281e5488ee97 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h    Wed Jan 05 18:49:34 2011 -0800
+++ b/xen/include/public/domctl.h    Wed Jan 05 18:50:54 2011 -0800
@@ -820,6 +820,16 @@ typedef struct xen_domctl_vcpuextstate x
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpuextstate_t);
 #endif
 
+/* XEN_DOMCTL_set_access_required: sets whether a memory event listener
+ * must be present to handle page access events: if false, the page
+ * access will revert to full permissions if no one is listening;
+ *  */
+struct xen_domctl_set_access_required {
+    uint8_t access_required;
+};
+typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -882,6 +892,7 @@ struct xen_domctl {
 #define XEN_DOMCTL_getpageframeinfo3             61
 #define XEN_DOMCTL_setvcpuextstate               62
 #define XEN_DOMCTL_getvcpuextstate               63
+#define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -934,6 +945,7 @@ struct xen_domctl {
         struct xen_domctl_cpuid             cpuid;
         struct xen_domctl_vcpuextstate      vcpuextstate;
 #endif
+        struct xen_domctl_set_access_required access_required;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;

Attachment: 3.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 3 of 7] REDO2: mem_access & mem_access 2: access listener can be required, Joe Epstein <=