From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v2 24/30] tools/libxc: Modify bitmap operations to take void pointers Date: Wed, 17 Feb 2016 15:06:11 -0500 Message-ID: <20160217200611.GL24109@char.us.oracle.com> References: <1454679743-18133-1-git-send-email-andrew.cooper3@citrix.com> <1454679743-18133-25-git-send-email-andrew.cooper3@citrix.com> <20160208162304.GA99992@deinos.phlegethon.org> <1454949407.17191.17.camel@citrix.com> <56BB0BD0.6020009@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <56BB0BD0.6020009@citrix.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: Andrew Cooper Cc: Ian Jackson , Wei Liu , Tim Deegan , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org On Wed, Feb 10, 2016 at 10:07:12AM +0000, Andrew Cooper wrote: > On 08/02/16 16:36, Ian Campbell wrote: > > On Mon, 2016-02-08 at 16:23 +0000, Tim Deegan wrote: > >> At 13:42 +0000 on 05 Feb (1454679737), Andrew Cooper wrote: > >>> The type of the pointer to a bitmap is not interesting; it does not > >>> affect the > >>> representation of the block of bits being pointed to. > >> It does affect the alignment, though. Is this safe on ARM? > > Good point. These constructs in the patch: > > > > + const unsigned long *addr = _addr; > > > > Would be broken if _addr were not suitably aligned for an unsigned long. > > > > That probably rules out this approach unfortunately. > > What about reworking libxc bitops in terms of unsigned char? That > should cover all alignment issues. See 3cab67ac83b1d56c3daedd9c4adfed497a114246 "+/* + * xc_bitops.h has macros that do this as well - however they assume that + * the bitmask is word aligned but xc_cpumap_t is only guaranteed to be + * byte aligned and so we need byte versions for architectures which do + * not support misaligned accesses (which is basically everyone + * but x86, although even on x86 it can be inefficient). + */ " > > ~Andrew > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel