From: Julien Grall Subject: [PATCH 3/4] xen/public: Don't expose XEN_GUEST_HANDLE_PARAM outside of the hypervisor Date: Fri, 30 Oct 2015 18:13:32 +0000 Message-ID: <1446228813-2593-4-git-send-email-julien.grall@citrix.com> References: <1446228813-2593-1-git-send-email-julien.grall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZsEKC-00088r-Ip for xen-devel@lists.xenproject.org; Fri, 30 Oct 2015 18:22:52 +0000 In-Reply-To: <1446228813-2593-1-git-send-email-julien.grall@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Keir Fraser , ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, Tim Deegan , Ian Jackson , Julien Grall , Jan Beulich List-Id: xen-devel@lists.xenproject.org A XEN_GUEST_HANDLE_PARAM is used to represent a guest pointer passed as an hypercall register. It will always be the size of a native register. This is only used in Xen for type-safety, the guest will directly pass a pointer in the hypercall parameter. Note that for ARM we only hide XEN_GUEST_HANDLE_PARAM. The type __guest_handle_param_* is still exposed because it would result to duplicating the macro to create the type. I find this solution more difficult to read. Signed-off-by: Julien Grall --- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan --- xen/include/public/arch-arm.h | 4 ++++ xen/include/public/arch-x86/xen.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index 477254f..b278bc0 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -188,7 +188,11 @@ #define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name) #define __XEN_GUEST_HANDLE(name) __guest_handle_ ## name #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name) + +#ifdef __XEN__ /* Internal only, should never be exposed to the guest */ #define XEN_GUEST_HANDLE_PARAM(name) __guest_handle_param_ ## name +#endif + #define set_xen_guest_handle_raw(hnd, val) \ do { \ typeof(&(hnd)) _sxghr_tmp = &(hnd); \ diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h index 5187560..8036b3c 100644 --- a/xen/include/public/arch-x86/xen.h +++ b/xen/include/public/arch-x86/xen.h @@ -52,7 +52,11 @@ #define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name) #define __XEN_GUEST_HANDLE(name) __guest_handle_ ## name #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name) + +#ifdef __XEN__ /* Internal only, should never be exposed to the guest */ #define XEN_GUEST_HANDLE_PARAM(name) XEN_GUEST_HANDLE(name) +#endif + #define set_xen_guest_handle_raw(hnd, val) do { (hnd).p = val; } while (0) #define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val) -- 2.1.4