From: Tim Deegan Subject: Re: [PATCH 1/2] fix locking in offline_page() Date: Thu, 28 Nov 2013 16:11:17 +0100 Message-ID: <20131128151117.GI36239@deinos.phlegethon.org> References: <5295B64E0200007800107636@nat28.tlf.novell.com> <5295BAA5020000780010765A@nat28.tlf.novell.com> <5295C2F5.8010207@citrix.com> <5295D2120200007800107709@nat28.tlf.novell.com> <20131127103404.GB51509@deinos.phlegethon.org> <5295DAD7020000780010777C@nat28.tlf.novell.com> <20131127104839.GD51509@deinos.phlegethon.org> <5295DDA602000078001077AC@nat28.tlf.novell.com> <20131128102554.GA36239@deinos.phlegethon.org> <5297556302000078000A8018@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vm3FU-0002KG-Ss for xen-devel@lists.xenproject.org; Thu, 28 Nov 2013 15:11:25 +0000 Content-Disposition: inline In-Reply-To: <5297556302000078000A8018@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, keir@xen.org, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org At 14:38 +0000 on 28 Nov (1385645907), Jan Beulich wrote: > >>> Tim Deegan 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 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.