Skip to contentSkip to conversation

Fix guest_handle_okay/guest_handle_subrange_okay

PATCH In review Tim Deegan 1 participant 2 messages Sep 3, 2008

lore
Share & tools
lore

Tim Deegan

author
#0 lore raw

PATCH 1/1 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

Signature · 3 lines
Tim Deegan <[email protected]>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]
author
#1 lore raw

With the patch this time...

Quoted 5 lines · Tim Deegan

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

Signature · 3 lines
Tim Deegan <[email protected]>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]
xen/include/asm-x86/guest_access.h +3 -3
diff -r e17faaa612f0 xen/include/asm-x86/guest_access.h
@@ -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/arch/x86/domctl.c +1 -1
diff -r e17faaa612f0 xen/arch/x86/domctl.c
@@ -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>
xen/arch/x86/domain_build.c +1 -0
diff -r e17faaa612f0 xen/arch/x86/domain_build.c
@@ -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>
xen/arch/x86/domain.c +1 -1
diff -r 2c777e37871b xen/arch/x86/domain.c
@@ -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>
xen/arch/x86/hvm/hvm.c +2 -1
diff -r 2c777e37871b xen/arch/x86/hvm/hvm.c
@@ -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>
xen/arch/x86/mm/hap/hap.c +1 -0
diff -r 2c777e37871b xen/arch/x86/mm/hap/hap.c
@@ -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>
 
xen/arch/x86/traps.c +1 -1
diff -r 2c777e37871b xen/arch/x86/traps.c
@@ -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>

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel