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

[Xen-changelog] [xen-unstable] x86, waitqueue: Allocate whole page for shadow stack.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1321966821 0
# Node ID fe80909663c1b1765d9b3407b8dcea88bc318d53
# Parent  334d3ec1130c3890b848cf304c0ecadf729b4127
x86,waitqueue: Allocate whole page for shadow stack.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 334d3ec1130c -r fe80909663c1 xen/common/wait.c
--- a/xen/common/wait.c Tue Nov 22 12:53:48 2011 +0000
+++ b/xen/common/wait.c Tue Nov 22 13:00:21 2011 +0000
@@ -33,7 +33,7 @@
      * hypervisor context before sleeping (descheduling), setjmp/longjmp-style.
      */
     void *esp;
-    char stack[3000];
+    char *stack;
 #endif
 };
 
@@ -45,6 +45,15 @@
     if ( wqv == NULL )
         return -ENOMEM;
 
+#ifdef CONFIG_X86
+    wqv->stack = alloc_xenheap_page();
+    if ( wqv->stack == NULL )
+    {
+        xfree(wqv);
+        return -ENOMEM;
+    }
+#endif
+
     INIT_LIST_HEAD(&wqv->list);
     wqv->vcpu = v;
 
@@ -62,6 +71,9 @@
         return;
 
     BUG_ON(!list_empty(&wqv->list));
+#ifdef CONFIG_X86
+    free_xenheap_page(wqv->stack);
+#endif
     xfree(wqv);
 
     v->waitqueue_vcpu = NULL;
@@ -114,7 +126,7 @@
         : "=S" (wqv->esp)
         : "c" (cpu_info), "D" (wqv->stack)
         : "memory" );
-    BUG_ON((cpu_info - (char *)wqv->esp) > sizeof(wqv->stack));
+    BUG_ON((cpu_info - (char *)wqv->esp) > PAGE_SIZE);
 }
 
 static void __finish_wait(struct waitqueue_vcpu *wqv)

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