From: Keir Fraser Subject: Re: [PATCH] add canonical address checks to HVM Date: Fri, 01 Dec 2006 10:12:12 +0000 Message-ID: References: <456DAFBE.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <456DAFBE.76E4.0078.0@novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 29/11/06 15:05, "Jan Beulich" wrote: > +#ifdef __x86_64__ > +#define IS_CANO_ADDRESS(add) (((long)(add) >> 47) == ((long)(add) >> 63)) > +#else > +#define IS_CANO_ADDRESS(add) 1 > +#endif > + Is there any guarantee that right-shift is signed when using gcc? How about (int16_t)((add) >> 48) == -(int)(((add) >> 47) & 1) ?? -- Keir