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: Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: Re: [RFC] Re: [Xen-devel] [PATCH] fix xenctl_cpumap translation to handle bitops accessed like arrays
From: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Date: Sun, 21 Jan 2007 11:10:08 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 21 Jan 2007 08:09:47 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C1D3DB5B.7BE1%keir@xxxxxxxxxxxxx>
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>
References: <C1D3DB5B.7BE1%keir@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
From the patch that you committed, AFAICT this function does not do anything:

void bitmap_byte_to_long(unsigned long *lp, const uint8_t *bp, int nbits)
{
        unsigned long l;
        int i, j, b;

        for (i = 0, b = 0; nbits > 0; i++, b += sizeof(l)) {
                l = 0;
                for (j = 0; (j < sizeof(l)) && (nbits > 0); j++) {
                        l <<= 8;
                        l |= bp[b+j];
                        nbits -= 8;
                }
                lp[i] = l;
        }
}

On Jan 17, 2007, at 8:55 AM, Keir Fraser wrote:




On 17/1/07 12:50, "Jimi Xenidis" <jimix@xxxxxxxxxxxxxx> wrote:

Actually, your
'no-op' long_to_byte_bitmap() implementation does not memcpy -- why
is that?

This is a little (possibly dirty) attempt to avoid a copy if no
conversion is required.
As long as the caller uses the return value all is well.
I'd happy to make it a memcpy() and feel better about it.

Yes please.

 K.



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