From: Tim Deegan Subject: Re: [PATCH] Fix guest_handle_okay/guest_handle_subrange_okay Date: Wed, 3 Sep 2008 14:11:32 +0100 Message-ID: <20080903131132.GN27463@york.uk.xensource.com> References: <20080903131022.GM27463@york.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="dWYAkE0V1FpFQHQ3" Return-path: Content-Disposition: inline In-Reply-To: <20080903131022.GM27463@york.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --dWYAkE0V1FpFQHQ3 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline With the patch this time... At 14:10 +0100 on 03 Sep (1220451022), Tim Deegan wrote: > 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 Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.] --dWYAkE0V1FpFQHQ3 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename=fix-guest-access-ok diff -r e17faaa612f0 xen/include/asm-x86/guest_access.h --- a/xen/include/asm-x86/guest_access.h Wed Sep 03 12:02:37 2008 +0100 +++ b/xen/include/asm-x86/guest_access.h Wed Sep 03 12:02:39 2008 +0100 @@ -8,7 +8,7 @@ #define __ASM_X86_GUEST_ACCESS_H__ #include -#include +#include #include #include @@ -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))) diff -r e17faaa612f0 xen/arch/x86/domctl.c --- a/xen/arch/x86/domctl.c Wed Sep 03 12:02:37 2008 +0100 +++ b/xen/arch/x86/domctl.c Wed Sep 03 12:02:39 2008 +0100 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff -r e17faaa612f0 xen/arch/x86/domain_build.c --- a/xen/arch/x86/domain_build.c Wed Sep 03 12:02:37 2008 +0100 +++ b/xen/arch/x86/domain_build.c Wed Sep 03 12:03:03 2008 +0100 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include diff -r 2c777e37871b xen/arch/x86/domain.c --- a/xen/arch/x86/domain.c Wed Sep 03 12:03:23 2008 +0100 +++ b/xen/arch/x86/domain.c Wed Sep 03 13:49:26 2008 +0100 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include #include #include #include diff -r 2c777e37871b xen/arch/x86/hvm/hvm.c --- a/xen/arch/x86/hvm/hvm.c Wed Sep 03 12:03:23 2008 +0100 +++ b/xen/arch/x86/hvm/hvm.c Wed Sep 03 13:51:32 2008 +0100 @@ -31,10 +31,11 @@ #include #include #include +#include +#include #include #include #include -#include #include #include #include diff -r 2c777e37871b xen/arch/x86/mm/hap/hap.c --- a/xen/arch/x86/mm/hap/hap.c Wed Sep 03 12:03:23 2008 +0100 +++ b/xen/arch/x86/mm/hap/hap.c Wed Sep 03 13:52:22 2008 +0100 @@ -37,6 +37,7 @@ #include #include #include +#include #include #include diff -r 2c777e37871b xen/arch/x86/traps.c --- a/xen/arch/x86/traps.c Wed Sep 03 12:03:23 2008 +0100 +++ b/xen/arch/x86/traps.c Wed Sep 03 13:49:12 2008 +0100 @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #include --dWYAkE0V1FpFQHQ3 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --dWYAkE0V1FpFQHQ3--