[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [patch] unwanted sign extending

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


Scott Parish
Signed-off-by: srparish@xxxxxxxxxx

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

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.