From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH v2] xen: fix alignment for bitops Date: Thu, 17 Apr 2014 11:22:27 +0100 Message-ID: <534FAB63.60709@citrix.com> References: <1397634938-5470-1-git-send-email-murzin.v@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WajSh-0002io-Nl for xen-devel@lists.xenproject.org; Thu, 17 Apr 2014 10:22:31 +0000 In-Reply-To: <1397634938-5470-1-git-send-email-murzin.v@gmail.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: Vladimir Murzin Cc: xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, Ian.Campbell@citrix.com, JBeulich@suse.com, david.vrabel@citrix.com List-Id: xen-devel@lists.xenproject.org On 16/04/14 08:55, Vladimir Murzin wrote: > Bitops operations like set/clear/change mandate world aligned pointer, mainly > because architectures specific implementation. > > Looks that DEFINE_PER_CPU does required alignment for cpu_control_block; > however, local copy used for bitops might not be world aligned. > > For arm64 it ends up with unaligned access trap... Thanks. Does this version work for you? David 8<---------------------- xen/events/fifo: fix alignment for bitops on local ready word Bitops operations like set_bit(), clear_bit(), and test_bit() require word aligned pointers, because of architectures specific implementations. Looks that DEFINE_PER_CPU does required alignment for cpu_control_block; however, local copy of the ready word might not be word aligned. For arm64 it ends up with unaligned access trap at: if (head == 0) clear_bit(priority, BM(ready)); Use unsigned long for "ready" to make sure it is word aligned. Signed-off-by: Vladimir Murzin Signed-off-by: David Vrabel