[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86/mm: Check sharing/paging/access have been enabled before processing a memop



# HG changeset patch
# User Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
# Date 1329406982 0
# Node ID de4206b6546c96ee890df144326658cb964b534e
# Parent  5a9c571ee39663929d1fe6d57326a40a46753ca2
x86/mm: Check sharing/paging/access have been enabled before processing a memop

Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
Acked-by: Tim Deegan <tim@xxxxxxx>
Committed-by: Tim Deegan <tim@xxxxxxx>
---


diff -r 5a9c571ee396 -r de4206b6546c xen/arch/x86/mm/mem_access.c
--- a/xen/arch/x86/mm/mem_access.c      Thu Feb 16 15:43:02 2012 +0000
+++ b/xen/arch/x86/mm/mem_access.c      Thu Feb 16 15:43:02 2012 +0000
@@ -29,6 +29,9 @@
 {
     int rc;
 
+    if ( unlikely(!d->mem_event->access.ring_page) )
+        return -ENODEV;
+
     switch( meo->op )
     {
     case XENMEM_access_op_resume:
diff -r 5a9c571ee396 -r de4206b6546c xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c       Thu Feb 16 15:43:02 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c       Thu Feb 16 15:43:02 2012 +0000
@@ -452,13 +452,15 @@
 /* Registered with Xen-bound event channel for incoming notifications. */
 static void mem_paging_notification(struct vcpu *v, unsigned int port)
 {
-    p2m_mem_paging_resume(v->domain);
+    if ( likely(v->domain->mem_event->paging.ring_page != NULL) )
+        p2m_mem_paging_resume(v->domain);
 }
 
 /* Registered with Xen-bound event channel for incoming notifications. */
 static void mem_access_notification(struct vcpu *v, unsigned int port)
 {
-    p2m_mem_access_resume(v->domain);
+    if ( likely(v->domain->mem_event->access.ring_page != NULL) )
+        p2m_mem_access_resume(v->domain);
 }
 
 struct domain *get_mem_event_op_target(uint32_t domain, int *rc)
diff -r 5a9c571ee396 -r de4206b6546c xen/arch/x86/mm/mem_paging.c
--- a/xen/arch/x86/mm/mem_paging.c      Thu Feb 16 15:43:02 2012 +0000
+++ b/xen/arch/x86/mm/mem_paging.c      Thu Feb 16 15:43:02 2012 +0000
@@ -27,6 +27,9 @@
 
 int mem_paging_memop(struct domain *d, xen_mem_event_op_t *mec)
 {
+    if ( unlikely(!d->mem_event->paging.ring_page) )
+        return -ENODEV;
+
     switch( mec->op )
     {
     case XENMEM_paging_op_nominate:
diff -r 5a9c571ee396 -r de4206b6546c xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c     Thu Feb 16 15:43:02 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c     Thu Feb 16 15:43:02 2012 +0000
@@ -1022,7 +1022,7 @@
     int rc = 0;
 
     /* Only HAP is supported */
-    if ( !hap_enabled(d) )
+    if ( !hap_enabled(d) || !d->arch.hvm_domain.mem_sharing_enabled )
          return -ENODEV;
 
     switch(mec->op)

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.