WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [RFC] Re: [Xen-devel] [PATCH] fix xenctl_cpumap translation to handl

To: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>, Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: Re: [RFC] Re: [Xen-devel] [PATCH] fix xenctl_cpumap translation to handle bitops accessed like arrays
From: Keir Fraser <keir@xxxxxxxxxxxxx>
Date: Thu, 21 Dec 2006 19:51:00 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 21 Dec 2006 11:50:47 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20AD633C-685E-4325-A6C1-1D81D7265C74@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcclOVaflWt7tpEsEduRBAANk04WTA==
Thread-topic: [RFC] Re: [Xen-devel] [PATCH] fix xenctl_cpumap translation to handle bitops accessed like arrays
User-agent: Microsoft-Entourage/11.3.2.061213
On 21/12/06 5:32 pm, "Jimi Xenidis" <jimix@xxxxxxxxxxxxxx> wrote:

>> How about functions long_to_byte_bitmap(bitmap, nr_bits) and
>> byte_to_long_bitmap(bitmap, nr_bits) defined in asm/bitops.h?
> 
> hmm, as I see it we have 3 interfaces that should remain compatible.
>   1) The hvcall which uses a byte array
>   2) The libxc calls where 2 use uint64_t and one uses uint32_t
>   3) The xm/xc.c call which constructs a python list using "C"
> ordering of the uint*_t word
> 
> so we would need similar interfaces in libxc and we would need a
> byte_to_uint{64,32}(), unless you want to change the libxc interfaces
> as well.

I am suggesting we change just the hypervisor interface to expect a
byte-oriented bitmap. So the libxc interfaces can stay as they are, but the
libxc functions will need to do conversion from uint32_t/uint64_t to a
byte-oriented bitmap. There is no loss of backward compatibility here for
ia64 or x86 as little-endian systems do not care whether a bitmap is byte-
word- or longword-oriented -- they're all identical.

> I see now (I'm not that familiar with x86) that bitops in x86 are
> "consistent" with "C" shifting so x86 experience no change, however
> is it worth optimizing this?

The way you are doing the conversion would be fine. I'm mainly aiming for a
clean abstraction and formalising the concept of a 'byte-oriented bitmap' is
the best way of doing this that I can see right now.

 -- Keir


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel