x86/mm: mem-paging and mem-sharing only work with HAP
authorTim Deegan <Tim.Deegan@citrix.com>
Wed, 1 Jun 2011 10:11:43 +0000 (11:11 +0100)
committerTim Deegan <Tim.Deegan@citrix.com>
Wed, 1 Jun 2011 10:11:43 +0000 (11:11 +0100)
so don't let the tools shoot themselves in the foot.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen/arch/x86/mm/mem_paging.c
xen/arch/x86/mm/mem_sharing.c

index be4823dd3fb0968a77676c451a5e95597acd0d5a..f00a1a92a1a223caa0aaeb2a5cf282c84efc1a57 100644 (file)
@@ -31,6 +31,10 @@ int mem_paging_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
     int rc;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
 
+    /* Only HAP is supported */
+    if ( !hap_enabled(d) )
+         return -ENODEV;
+
     switch( mec->op )
     {
     case XEN_DOMCTL_MEM_EVENT_OP_PAGING_NOMINATE:
index bd3ff6851d6153ddede59f58061fd4d450626dbe..bf1940dd65d55102b02f8ffb5a5bbf9e72664299 100644 (file)
@@ -737,6 +737,10 @@ int mem_sharing_domctl(struct domain *d, xen_domctl_mem_sharing_op_t *mec)
 {
     int rc;
 
+    /* Only HAP is supported */
+    if ( !hap_enabled(d) )
+         return -ENODEV;
+
     switch(mec->op)
     {
         case XEN_DOMCTL_MEM_SHARING_OP_CONTROL: