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

[Xen-changelog] [xen-unstable] x86/mm: Flag mem_events caused by foreign domains



# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla>
# Date 1323202232 0
# Node ID d35bedf334f2072172dfc367b8db7b8a2a88a7ad
# Parent  ff988cea61ea0a0142bb525bd616517602b19cc9
x86/mm: Flag mem_events caused by foreign domains

Add a new flag for mem events, as consumers might need to discriminate
foreign domain-caused from guest-caused events. The vcpu field of an
event is bogus from a consumer p.o.v. for foreign domain-caused events.

Also assert that we shouldn't be pausing foreign vcpus.

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


diff -r ff988cea61ea -r d35bedf334f2 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c       Tue Dec 06 11:28:30 2011 +0000
+++ b/xen/arch/x86/mm/mem_event.c       Tue Dec 06 20:10:32 2011 +0000
@@ -143,6 +143,12 @@
     front_ring = &med->front_ring;
     req_prod = front_ring->req_prod_pvt;
 
+    if ( current->domain != d )
+    {
+        req->flags |= MEM_EVENT_FLAG_FOREIGN;
+        ASSERT( !(req->flags & MEM_EVENT_FLAG_VCPU_PAUSED) );
+    }
+
     /* Copy request */
     memcpy(RING_GET_REQUEST(front_ring, req_prod), req, sizeof(*req));
     req_prod++;
diff -r ff988cea61ea -r d35bedf334f2 xen/include/public/mem_event.h
--- a/xen/include/public/mem_event.h    Tue Dec 06 11:28:30 2011 +0000
+++ b/xen/include/public/mem_event.h    Tue Dec 06 20:10:32 2011 +0000
@@ -39,6 +39,7 @@
 #define MEM_EVENT_FLAG_VCPU_PAUSED  (1 << 0)
 #define MEM_EVENT_FLAG_DROP_PAGE    (1 << 1)
 #define MEM_EVENT_FLAG_EVICT_FAIL   (1 << 2)
+#define MEM_EVENT_FLAG_FOREIGN      (1 << 3)
 
 /* Reasons for the memory event request */
 #define MEM_EVENT_REASON_UNKNOWN     0    /* typical reason */

_______________________________________________
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®.