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

Re: [Xen-devel] [PATCH 1/2] fix locking in offline_page()



At 14:38 +0000 on 28 Nov (1385645907), Jan Beulich wrote:
> >>> Tim Deegan <tim@xxxxxxx> 11/28/13 11:26 AM >>>
> >At 10:55 +0000 on 27 Nov (1385546118), Jan Beulich wrote:
> >> >>> On 27.11.13 at 11:48, Tim Deegan <tim@xxxxxxx> wrote:
> >> > AIUI the default promotion is to a signed integer if the value will
> >> > fit, i.e.:
> >> >              (unsigned short) 0x8000 
> >> > promoted     (signed int) 0x00008000 
> >> > shifted left (signed int) 0x80000000 (undefined behaviour)
> >> 
> >> Right - but the promotion (as you also show) is done via zero
> >> extension. Hence, plus because of left shifts being ignorant of
> >> signed-ness, no need for a cast.
> >
> >No: left-shifting that set bit into the sign bit of the promoted value
> >is undefined behaviour.  I still don't have my standard reference to
> >hand, but e.g. http://blog.regehr.org/archives/738
> 
> Ah, indeed. I can certainly add a cast there, but as said before
> - the value can't be negative as we only permit 2^^15 domains,

Absolutely.  My reviewed-by stands on the original patch.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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