From: Tim Deegan Subject: Re: [PATCH V2] xen/arm64: Assembly optimized bitops from Linux Date: Wed, 5 Jun 2013 11:17:38 +0100 Message-ID: <20130605101738.GB42977@ocelot.phlegethon.org> References: <1370424895-15746-1-git-send-email-ian.campbell@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: <1370424895-15746-1-git-send-email-ian.campbell@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: Ian Campbell Cc: julien.grall@citrix.com, stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 10:34 +0100 on 05 Jun (1370428495), Ian Campbell wrote: > This patch replaces the previous hashed lock implementaiton of bitops with > assembly optimized ones taken from Linux v3.10-rc4. > > The Linux derived ASM only supports 8 byte aligned bitmaps (which under Linux > are unsigned long * rather than our void *). We do have actually uses of 4 > byte alignment (i.e. the bitmaps in struct xmem_pool) which trigger alignment > faults. > > Therefore adjust the assembly to work in 4 byte increments, which involved: > - bit offset now bits 4:0 => mask #31 not #63 > - use wN register not xN for load/modify/store loop. > > There is no need to adjust the shift used to calculate the word offset, the > difference is already acounted for in the #63->#31 change. > > NB: Xen's build system cannot cope with the change from .c to .S file, > remove xen/arch/arm/arm64/lib/.bitops.o.d or clean your build tree. > > Signed-off-by: Ian Campbell Acked-by: Tim Deegan