From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: Re: [PATCH] Use fixed-width types in the memory event interface Date: Tue, 29 Jun 2010 15:52:35 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: 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: Patrick Colp , Tim Deegan Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 29/06/2010 15:37, "Patrick Colp" wrote: > A mostly unrelated question: I notice that vcpu_id is set to int32_t > rather than uint32_t. This matches with the vcpu_id field in struct > vcpu, but I'm just curious as to why this isn't an unsigned int in > struct vcpu. Is there ever a time when vcpu_id is negative? I realise > it's unlikely that we'll need to consider 4 billion vcpus (at least > not anytime soon), but just wondering if there's any particular reason > why this is a signed integer instead of an unsigned one. No. K. >=20 > Patrick >=20 >=20 > On 29 June 2010 07:28, Patrick Colp wrote: >> On 29 June 2010 06:47, Tim Deegan wrote: >>> Set the types in the public memory_event header file to use fixed-sized >>> and self-aligned fields rather than "unsigned long". =A0AIUI this feature >>> only works with 64-bit hypervisors but I think this change will be >>> necessary to use 32-on-64 dom0 tools. >>>=20 >>> This breaks compatibility with older builds of the tools, but I can't >>> see any way to avoid it short of __attribute__((__packed__)). >>>=20 >>> I'd like an ack/nack from Patrick on this, please. >>>=20 >>> Signed-off-by: Tim Deegan >>=20 >> Acked-by: Patrick Colp >>=20 >>=20 >>=20 >>> diff -r 7b00193bd033 xen/include/public/mem_event.h >>> --- a/xen/include/public/mem_event.h =A0 =A0Mon Jun 28 17:40:16 2010 +0100 >>> +++ b/xen/include/public/mem_event.h =A0 =A0Tue Jun 29 14:38:06 2010 +0100 >>> @@ -40,14 +40,14 @@ >>>=20 >>>=20 >>> =A0typedef struct mem_event_shared_page { >>> - =A0 =A0int port; >>> + =A0 =A0uint32_t port; >>> =A0} mem_event_shared_page_t; >>>=20 >>> =A0typedef struct mem_event_st { >>> - =A0 =A0unsigned long gfn; >>> - =A0 =A0unsigned long offset; >>> - =A0 =A0unsigned long p2mt; >>> - =A0 =A0int vcpu_id; >>> + =A0 =A0uint64_t gfn; >>> + =A0 =A0uint64_t offset; >>> + =A0 =A0uint32_t p2mt; >>> + =A0 =A0int32_t vcpu_id; >>> =A0 =A0 uint64_t flags; >>> =A0} mem_event_request_t, mem_event_response_t; >>>=20 >>>=20 >>>=20 >>=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel