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

[Xen-changelog] [xen-unstable] x86 hvm: Refuse to perform __hvm_copy() work in atomic context.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1290083311 0
# Node ID 7d2fdc083c9c27142f09177e5f021e390da1550f
# Parent  92bc47c81fdcb06c0b0db2399a7d58b15a533c5d
x86 hvm: Refuse to perform __hvm_copy() work in atomic context.

Soon we will properly handle paged out memory in this function by
sleeping in hypervisor context. This will require that all callers can
sleep.

If this check is too strong, we can reduce it to only applying to
guests with paging enabled (which also currently implies only guests
using Intel EPT). However my brief testing seems to indicate it works
okay.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---
 xen/arch/x86/hvm/hvm.c |    7 +++++++
 1 files changed, 7 insertions(+)

diff -r 92bc47c81fdc -r 7d2fdc083c9c xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Thu Nov 18 12:26:27 2010 +0000
+++ b/xen/arch/x86/hvm/hvm.c    Thu Nov 18 12:28:31 2010 +0000
@@ -1905,6 +1905,13 @@ static enum hvm_copy_result __hvm_copy(
     char *p;
     int count, todo = size;
 
+    /*
+     * If the required guest memory is paged out, this function may sleep.
+     * Hence we bail immediately if called from atomic context.
+     */
+    if ( in_atomic() )
+        return HVMCOPY_unhandleable;
+
     while ( todo > 0 )
     {
         count = min_t(int, PAGE_SIZE - (addr & ~PAGE_MASK), todo);

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