xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HVM guests are allowed to use the entire virtual address space for
@ 2010-05-25 14:49 Tim Deegan
  2010-05-25 15:04 ` Keir Fraser
  2010-07-26  9:52 ` Paolo Bonzini
  0 siblings, 2 replies; 8+ messages in thread
From: Tim Deegan @ 2010-05-25 14:49 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 150 bytes --]

whatever they want, without any Xen hole.  __addr_ok() is therefore
always true for such guests.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>



[-- Attachment #2: xen-unstable.hg.patch --]
[-- Type: text/x-patch, Size: 2916 bytes --]

# HG changeset patch
# User Tim Deegan <Tim.Deegan@citrix.com>
# Date 1274798621 -3600
# Node ID 0b3b2b31e962561390cac4896a4a70841990f0e6
# Parent  fef1e7dc74e64cf25d817991dc2594579abf5bd0
HVM guests are allowed to use the entire virtual address space for
whatever they want, without any Xen hole.  __addr_ok() is therefore
always true for such guests.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>

diff -r fef1e7dc74e6 -r 0b3b2b31e962 xen/arch/x86/usercopy.c
--- a/xen/arch/x86/usercopy.c	Tue May 25 15:36:25 2010 +0100
+++ b/xen/arch/x86/usercopy.c	Tue May 25 15:43:41 2010 +0100
@@ -7,6 +7,7 @@
  */
 
 #include <xen/config.h>
+#include <xen/sched.h>
 #include <xen/lib.h>
 #include <asm/uaccess.h>
 
diff -r fef1e7dc74e6 -r 0b3b2b31e962 xen/include/asm-x86/x86_32/uaccess.h
--- a/xen/include/asm-x86/x86_32/uaccess.h	Tue May 25 15:36:25 2010 +0100
+++ b/xen/include/asm-x86/x86_32/uaccess.h	Tue May 25 15:43:41 2010 +0100
@@ -15,7 +15,8 @@
 		:"1" (addr),"g" ((int)(size)),"r" (HYPERVISOR_VIRT_START)); \
 	flag; })
 
-#define access_ok(addr,size) (likely(__range_not_ok(addr,size) == 0))
+#define access_ok(addr,size) \
+    (is_hvm_vcpu(current) || likely(__range_not_ok(addr,size) == 0))
 
 #define array_access_ok(addr,count,size) \
     (likely(count < (~0UL/size)) && access_ok(addr,count*size))
diff -r fef1e7dc74e6 -r 0b3b2b31e962 xen/include/asm-x86/x86_64/uaccess.h
--- a/xen/include/asm-x86/x86_64/uaccess.h	Tue May 25 15:36:25 2010 +0100
+++ b/xen/include/asm-x86/x86_64/uaccess.h	Tue May 25 15:43:41 2010 +0100
@@ -14,13 +14,15 @@
 })
 
 /*
- * Valid if in +ve half of 48-bit address space, or above Xen-reserved area.
+ * Valid if in +ve half of 48-bit address space, or above Xen-reserved
+ * area or anywhere in HVM guests (which have no Xen-reserved area).
  * This is also valid for range checks (addr, addr+size). As long as the
  * start address is outside the Xen-reserved area then we will access a
  * non-canonical address (and thus fault) before ever reaching VIRT_START.
  */
-#define __addr_ok(addr) \
-    (((unsigned long)(addr) < (1UL<<48)) || \
+#define __addr_ok(addr)                                 \
+    (is_hvm_vcpu(current) ||                            \
+     ((unsigned long)(addr) < (1UL<<48)) ||             \
      ((unsigned long)(addr) >= HYPERVISOR_VIRT_END))
 
 #define access_ok(addr, size) \
@@ -32,8 +34,9 @@
 #define __compat_addr_ok(d, addr) \
     ((unsigned long)(addr) < HYPERVISOR_COMPAT_VIRT_START(d))
 
-#define __compat_access_ok(d, addr, size) \
-    __compat_addr_ok(d, (unsigned long)(addr) + ((size) ? (size) - 1 : 0))
+#define __compat_access_ok(d, addr, size)                               \
+    (is_hvm_vcpu(current) ||                                            \
+     __compat_addr_ok(d, (unsigned long)(addr) + ((size) ? (size) - 1 : 0)))
 
 #define compat_access_ok(addr, size) \
     __compat_access_ok(current->domain, addr, size)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-07-26 10:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25 14:49 [PATCH] HVM guests are allowed to use the entire virtual address space for Tim Deegan
2010-05-25 15:04 ` Keir Fraser
2010-05-25 15:11   ` Keir Fraser
2010-05-25 15:14   ` Tim Deegan
2010-05-25 16:24     ` Keir Fraser
2010-07-26  9:52 ` Paolo Bonzini
2010-07-26 10:00   ` Tim Deegan
2010-07-26 10:57     ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).