From: Hollis Blanchard Subject: Re: Re: [RFC PATCH 03/35] Add Xen interface header files Date: Tue, 09 May 2006 15:40:03 -0500 Message-ID: <1147207204.19485.91.camel@basalt.austin.ibm.com> References: <20060509084945.373541000@sous-sol.org> <20060509085147.903310000@sous-sol.org> <20060509151516.GA16332@infradead.org> <1147203309.19485.62.camel@basalt.austin.ibm.com> <4460F1F0.7000602@us.ibm.com> <1a90328eb62b7b9924c4cfe38b228a10@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1a90328eb62b7b9924c4cfe38b228a10@cl.cam.ac.uk> 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: Ian Pratt , Xen Developers List-Id: xen-devel@lists.xenproject.org On Tue, 2006-05-09 at 21:01 +0100, Keir Fraser wrote: > On 9 May 2006, at 20:48, Anthony Liguori wrote: > > > Is this strictly true though? The ABI for Power and x86 are not > > necessarily dependent on each other. One could just as easily define > > a typedef like: > > > > #if defined(__ppc__) > > typedef uint64_t guest_handle_t; > > #elif defined(__x86__) > > typedef unsigned long guest_handle_t; > > #endif > > > > I thought the use of GUEST_HANDLE was to maintain type safety. It > > certainly helps the issue you point out but it's not strictly > > necessary. > > > > IMHO, this trick makes the code pretty ugly. I'd rather see it > > disappear in favor of something more akin to the above. > > Well, I originally thought it was to allow hiding of machine-address > scatter-gather lists for PPC (instead of passing virtual addresses). I > seem to recall that's what Hollis said at the time. Clearly hiding > something like that does need some macro magic. If it's not for that > then I'm not at all for keeping it. It is indeed rather fugly. The scatter/gather lists are still needed, but they are hidden inside copy_to/from_guest(). If you change "unsigned long *" to an integer-based guest_handle_t, you will lose type-checking when accessing it, and I believe that's why you created these macros. I'm not particularly worried about type-checking, so I'd be happy to see them go, as long as we still have typedefs. -- Hollis Blanchard IBM Linux Technology Center