From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH RFC v2 6/6] KVM: introduce a new API for getting dirty bitmaps Date: Fri, 23 Apr 2010 15:12:55 +0200 Message-ID: <201004231512.55240.arnd@arndb.de> References: <20100420195349.dab60b1d.yoshikawa.takuya@oss.ntt.co.jp> <201004231446.07880.arnd@arndb.de> <4BD19831.5000405@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: Alexander Graf , Fernando Luis =?utf-8?q?V=C3=A1zquez_Cao?= , Takuya Yoshikawa , mtosatti-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kvm-ia64-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Avi Kivity Return-path: In-Reply-To: <4BD19831.5000405-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Sender: kvm-ppc-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: kvm.vger.kernel.org On Friday 23 April 2010, Avi Kivity wrote: > Ah so the 31st bit is optional as far as userspace is concerned? What > does it mean? (just curious) On data pointers it's ignored. When you branch to a function, this bit determines whether the target function is run in 24 or 31 bit mode. This allows linking to legacy code on older operating systems that also support 24 bit libraries. > What happens on the opposite conversion? is it restored? > > What about > > int compare_pointer(void *a, void *b) > { > unsigned long ai = (unsigned long)a; > void *aia = (void *)ai; > > return a == b; /* true if a and b point to the same object */ > } Some instructions set the bit, others clear it, so aia and a may not be bitwise identical. > Does gcc mask the big in pointer comparisons as well? Yes. To stay in the above example: a == aia; /* true */ (unsigned long)a == (unsigned long)aia; /* true */ *(unsigned long *)&a == *(unsigned long *)&aia; /* undefined on s390 */ Arnd