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

[Xen-changelog] [xen-unstable] x86: Fix guest_handle_okay/guest_handle_subrange_okay



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1220447795 -3600
# Node ID 1e98ea5c860438a227e135701e6439b22826f52f
# Parent  c759a6cef79fcb33f867c8e92afc2ed4e73dfe13
x86: Fix guest_handle_okay/guest_handle_subrange_okay

The guest handle checks should use paging_* predicates, not shadow_*.
Also tidy up a few places where p2m definitions were being imported
via asm/guest_access.h -> asm/shadow.h -> asm/p2m.h

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
---
 xen/arch/x86/domain.c              |    2 +-
 xen/arch/x86/domain_build.c        |    1 +
 xen/arch/x86/domctl.c              |    2 +-
 xen/arch/x86/hvm/hvm.c             |    3 ++-
 xen/arch/x86/mm/hap/hap.c          |    1 +
 xen/arch/x86/traps.c               |    2 +-
 xen/include/asm-x86/guest_access.h |    6 +++---
 7 files changed, 10 insertions(+), 7 deletions(-)

diff -r c759a6cef79f -r 1e98ea5c8604 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Wed Sep 03 14:14:18 2008 +0100
+++ b/xen/arch/x86/domain.c     Wed Sep 03 14:16:35 2008 +0100
@@ -31,6 +31,7 @@
 #include <xen/compat.h>
 #include <xen/acpi.h>
 #include <xen/pci.h>
+#include <xen/paging.h>
 #include <asm/regs.h>
 #include <asm/mc146818rtc.h>
 #include <asm/system.h>
@@ -40,7 +41,6 @@
 #include <asm/i387.h>
 #include <asm/mpspec.h>
 #include <asm/ldt.h>
-#include <asm/paging.h>
 #include <asm/hypercall.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/support.h>
diff -r c759a6cef79f -r 1e98ea5c8604 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c       Wed Sep 03 14:14:18 2008 +0100
+++ b/xen/arch/x86/domain_build.c       Wed Sep 03 14:16:35 2008 +0100
@@ -26,6 +26,7 @@
 #include <asm/desc.h>
 #include <asm/i387.h>
 #include <asm/paging.h>
+#include <asm/p2m.h>
 #include <asm/e820.h>
 
 #include <public/version.h>
diff -r c759a6cef79f -r 1e98ea5c8604 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c     Wed Sep 03 14:14:18 2008 +0100
+++ b/xen/arch/x86/domctl.c     Wed Sep 03 14:16:35 2008 +0100
@@ -20,7 +20,7 @@
 #include <xen/trace.h>
 #include <xen/console.h>
 #include <xen/iocap.h>
-#include <asm/paging.h>
+#include <xen/paging.h>
 #include <asm/irq.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/support.h>
diff -r c759a6cef79f -r 1e98ea5c8604 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Wed Sep 03 14:14:18 2008 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Wed Sep 03 14:16:35 2008 +0100
@@ -31,10 +31,11 @@
 #include <xen/hypercall.h>
 #include <xen/guest_access.h>
 #include <xen/event.h>
+#include <xen/paging.h>
+#include <asm/shadow.h>
 #include <asm/current.h>
 #include <asm/e820.h>
 #include <asm/io.h>
-#include <asm/paging.h>
 #include <asm/regs.h>
 #include <asm/cpufeature.h>
 #include <asm/processor.h>
diff -r c759a6cef79f -r 1e98ea5c8604 xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c Wed Sep 03 14:14:18 2008 +0100
+++ b/xen/arch/x86/mm/hap/hap.c Wed Sep 03 14:16:35 2008 +0100
@@ -37,6 +37,7 @@
 #include <asm/shared.h>
 #include <asm/hap.h>
 #include <asm/paging.h>
+#include <asm/p2m.h>
 #include <asm/domain.h>
 #include <xen/numa.h>
 
diff -r c759a6cef79f -r 1e98ea5c8604 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Wed Sep 03 14:14:18 2008 +0100
+++ b/xen/arch/x86/traps.c      Wed Sep 03 14:16:35 2008 +0100
@@ -47,7 +47,7 @@
 #include <xen/version.h>
 #include <xen/kexec.h>
 #include <xen/trace.h>
-#include <asm/paging.h>
+#include <xen/paging.h>
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/atomic.h>
diff -r c759a6cef79f -r 1e98ea5c8604 xen/include/asm-x86/guest_access.h
--- a/xen/include/asm-x86/guest_access.h        Wed Sep 03 14:14:18 2008 +0100
+++ b/xen/include/asm-x86/guest_access.h        Wed Sep 03 14:16:35 2008 +0100
@@ -8,7 +8,7 @@
 #define __ASM_X86_GUEST_ACCESS_H__
 
 #include <asm/uaccess.h>
-#include <asm/shadow.h>
+#include <asm/paging.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/guest_access.h>
 
@@ -87,10 +87,10 @@
  * Allows use of faster __copy_* functions.
  */
 #define guest_handle_okay(hnd, nr)                      \
-    (shadow_mode_external(current->domain) ||           \
+    (paging_mode_external(current->domain) ||           \
      array_access_ok((hnd).p, (nr), sizeof(*(hnd).p)))
 #define guest_handle_subrange_okay(hnd, first, last)    \
-    (shadow_mode_external(current->domain) ||           \
+    (paging_mode_external(current->domain) ||           \
      array_access_ok((hnd).p + (first),                 \
                      (last)-(first)+1,                  \
                      sizeof(*(hnd).p)))

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