From: Tim Deegan Subject: Re: [PATCH] HVM guests are allowed to use the entire virtual address space for Date: Tue, 25 May 2010 16:14:32 +0100 Message-ID: <20100525151432.GA15976@whitby.uk.xensource.com> References: <0b3b2b31e962561390ca.1274798999@waitaha.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8t9RHnE3ZwKMSgU+" Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline At 16:04 +0100 on 25 May (1274803495), Keir Fraser wrote: > I think this is already handled correctly by guest_access.h, which is what > really matters. Nowadays copy_{to,from}_user (but not __copy_{to,from}_user) > are mainly for private usage only by the guest-access macros, and just a few > other arch-dependent PV_specific bits of code. Of course the __ versions are > still generally useful as 'copy but catch any fault' functions. OK, can I suggest the attached change instead? It brings the compat guest-handle macros in line with the normal ones. Signed-off-by: Tim Deegan There are a few more callers of access_ok() around but at first glance they seem all to be PV-only. Cheers, Tim. -- Tim Deegan Principal Software Engineer, XenServer Engineering Citrix Systems UK Ltd. (Company #02937203, SL9 0BG) --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: attachment; filename="compat-handle" diff -r 10ad9b50b4ca xen/include/xen/compat.h --- a/xen/include/xen/compat.h Tue May 25 11:28:58 2010 +0100 +++ b/xen/include/xen/compat.h Tue May 25 16:13:54 2010 +0100 @@ -90,8 +90,9 @@ * Allows use of faster __copy_* functions. */ #define compat_handle_okay(hnd, nr) \ + (paging_mode_external(current->domain) || \ compat_array_access_ok((void *)(full_ptr_t)(hnd).c, (nr), \ - sizeof(**(hnd)._)) + sizeof(**(hnd)._))) #define __copy_to_compat_offset(hnd, off, ptr, nr) ({ \ const typeof(*(ptr)) *_s = (ptr); \ --8t9RHnE3ZwKMSgU+ 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 --8t9RHnE3ZwKMSgU+--