From: Keir Fraser Subject: Re: [RFC] Re: [PATCH] fix xenctl_cpumap translation to handle bitops accessed like arrays Date: Wed, 17 Jan 2007 12:20:49 +0000 Message-ID: References: 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.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jimi Xenidis , Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 16/1/07 23:26, "Jimi Xenidis" wrote: > Sorry for taking so long with this, please comment on the following: > > The following patch adds the ability to convert form "long" based > bitmaps to "byte" base bitmaps for portability. This is only has the > hypervisor side, but the definitions are such that the same prototype > can be use by XC and Xen. > > Sadly it adds a copy on the xenctl_cpumap_to_cpumask(), but it minimally > impacts the common paths. Fine interface. On the Xen side the prototypes should go in xen/bitmap.h and the implementations in common/bitmap.c. I've added the Linux byteorder functions so in bitmap.c you ifdef on __BIG_ENDIAN and then use le32_to_cpu or le64_to_cpu (depending on BITS_PER_LONG). There's a question over whether we should do this transformation in-place on the bitmap, or use the copying semantics that you've chosen. I guess the latter is cleaner. Actually, your 'no-op' long_to_byte_bitmap() implementation does not memcpy -- why is that? On the guest side you'll need to dup the function prototypes and implementations in libxenctrl. Trying to share prototypes or anything via the public headers is just skanky. Add a comment to xenctl_cpumap to explain the format (explain it is 'little endian' or 'byte oriented' with an ascii diagram) and leave it at that. -- Keir