x86: Fix guest_handle_okay/guest_handle_subrange_okay
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 3 Sep 2008 13:16:35 +0000 (14:16 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 3 Sep 2008 13:16:35 +0000 (14:16 +0100)
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@citrix.com>
xen/arch/x86/domain.c
xen/arch/x86/domain_build.c
xen/arch/x86/domctl.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/mm/hap/hap.c
xen/arch/x86/traps.c
xen/include/asm-x86/guest_access.h

index 10d0cef7c652bef24899a6984a6c60790e273e56..9f2746910b8f0ecc6f9656e83b4fbf08b9646170 100644 (file)
@@ -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>
index d4388a666982a4e18e908fadf65fb45f136f8c7e..fffe9540833dd458e925909d40998d68ab577301 100644 (file)
@@ -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>
index 8f1df3ed941c5a3634ff58e196f1b7e9e75ed5af..9740a7083b0c223e91ef1d18501c656076841e62 100644 (file)
@@ -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>
index 4b58db1d679b8c6f8e14d576a8917893b17194b5..14dda4f1b0ac18e5e5615475018e04664402e655 100644 (file)
 #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>
index 149efbb8cf431baa369afc4950c8aebd05945acc..2556a6ea9e531ea37a3a2e4abed6a8d7f5718346 100644 (file)
@@ -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>
 
index 75b9e44be3b45febe01c71438301cd28678182c6..f7fdb4d1f25d1016378455abac656af120d51051 100644 (file)
@@ -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>
index 8b6722b60c8a58ae8eaaec8bb5d0008494c7fdff..ab9cb752c05ff761b93c0f44cf2ac3e942b2dd71 100644 (file)
@@ -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>
 
  * 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)))