From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] fix xenctl_cpumap translation to handle bitops accessed like arrays Date: Mon, 18 Dec 2006 09:26:07 +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 , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 17/12/06 5:53 pm, "Jimi Xenidis" wrote: > On PowerPC (and other big endian and/or RISC architectures) bit > offsets in a bitmap are actually represented by a bit-offset from an > element in an array rather than a bit-offset from the base memory > pointer, see xen/include/asm-powerpc/bitops.h for a complete > explanation. > > This complicates the conversion of cpumask_t from/to xenctl_cpumap. > > The following patch allows an architecture to declare that bitops are > "by long" rather than "by bit" and use an alternate scheme for > encoding. If the array-element type matters on big-endian systems then the tools really need fixing: one libxc operation passes down a uint32_t unit; another a uint64_t. Perhaps we should fix so they pass down 8-bit units (as the type of xenctl_cpumap_t would suggest) and then we could have byte_to_long_bitmap and long_to_byte_bitmap in Xen (which might encourage us to pull proper endianness headers into Xen). -- Keir