From: Ian Campbell Subject: Re: [PATCH 10/10] arm: parameter guest handles are 32 bit on 32 bit hypervisor Date: Wed, 17 Oct 2012 14:53:56 +0100 Message-ID: <1350482036.2460.73.camel@zakaz.uk.xensource.com> References: <1350314418.18058.72.camel@zakaz.uk.xensource.com> <1350314444-17148-10-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: "Keir (Xen.org)" , "Tim (Xen.org)" , Jan Beulich , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Wed, 2012-10-17 at 14:50 +0100, Stefano Stabellini wrote: > On Mon, 15 Oct 2012, Ian Campbell wrote: > > Handles within structs remain 64 bit such that they are consistently > > sized on both 32 and 64 bit. > > > > Signed-off-by: Ian Campbell > > --- > > xen/include/public/arch-arm.h | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h > > index ac493a5..ff02d15 100644 > > --- a/xen/include/public/arch-arm.h > > +++ b/xen/include/public/arch-arm.h > > @@ -74,7 +74,7 @@ > > #define __XEN_GUEST_HANDLE(name) __guest_handle_64_ ## name > > #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name) > > /* this is going to be changed on 64 bit */ > > -#define XEN_GUEST_HANDLE_PARAM(name) XEN_GUEST_HANDLE(name) > > +#define XEN_GUEST_HANDLE_PARAM(name) __guest_handle_ ## name > > #define set_xen_guest_handle_raw(hnd, val) \ > > do { \ > > typeof(&(hnd)) _sxghr_tmp = &(hnd); \ > > I am confused. > > I am not sure what version of my patch "xen: introduce > XEN_GUEST_HANDLE_PARAM" you have based this series upon, because the > latest one I have sent, certainly contains this change: That stuff is in "xen: introduce XEN_GUEST_HANDLE_PARAM". I had to defer the final switch until after the transition to HANDLE_PARAM was complete in order to avoid breaking the build in the interim. > > > diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h > index 2ae6548..4c6d607 100644 > --- a/xen/include/public/arch-arm.h > +++ b/xen/include/public/arch-arm.h > @@ -51,18 +51,36 @@ > > #define XEN_HYPERCALL_TAG 0XEA1 > > +#define uint64_aligned_t uint64_t __attribute__((aligned(8))) > > #ifndef __ASSEMBLY__ > -#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \ > - typedef struct { type *p; } __guest_handle_ ## name > +#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \ > + typedef union { type *p; unsigned long q; } \ > + __guest_handle_ ## name; \ > + typedef union { type *p; uint64_aligned_t q; } \ > + __guest_handle_64_ ## name; > > +/* > + * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field > + * in a struct in memory. On ARM is always 8 bytes sizes and 8 bytes > + * aligned. > + * XEN_GUEST_HANDLE_PARAM represent a guest pointer, when passed as an > + * hypercall argument. It is 4 bytes on aarch and 8 bytes on aarch64. > + */ > #define __DEFINE_XEN_GUEST_HANDLE(name, type) \ > ___DEFINE_XEN_GUEST_HANDLE(name, type); \ > ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type) > #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) __guest_handle_64_ ## name > #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name) > -#define set_xen_guest_handle_raw(hnd, val) do { (hnd).p = val; } while (0) > +/* this is going to be changes on 64 bit */ > +#define XEN_GUEST_HANDLE_PARAM(name) __guest_handle_ ## name >