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: [Xen-devel] [patch] unwanted sign extending

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] [patch] unwanted sign extending
From: "Scott Parish" <srparish@xxxxxxxxxx>
Date: Wed, 22 Jun 2005 11:20:29 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Scott Parish <srparish@xxxxxxxxxx>
Delivery-date: Wed, 22 Jun 2005 12:11:01 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <42B92BFA020000780001D082@xxxxxxxxxxxxxxxxxxxxx>
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: <20050621201030.GB16276@xxxxxxxxxx> <42B92BFA020000780001D082@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
On Wed, Jun 22, 2005 at 01:14:34AM -0600, Jan Beulich wrote:

> I'd think that for correctness this should also be done to
> alloc_l2_table. And I also think that this is still wrong for 64 bits:
> Shifting left an unsigned yields an unsigned, and since 'i' can range
> from 0 to 511 and the shift count is 30, the result is going to be
> truncated. That is, the code should be
>
>         vaddr = (unsigned long)i << L3_PAGETABLE_SHIFT;
>
> (and again, for consistency it should also be done so in
> alloc_l2_table).

Good point

sRp

-- 
Scott Parish
Signed-off-by: srparish@xxxxxxxxxx

Attachment: no-sign-extend-2.diff
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>