From: Julien Grall Subject: [PATCH] xen/arm64: Correctly align VFP regs Date: Thu, 10 Apr 2014 12:43:57 +0100 Message-ID: <1397130237-2328-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WYDOo-0001UD-In for xen-devel@lists.xenproject.org; Thu, 10 Apr 2014 11:44:06 +0000 Received: by mail-ee0-f44.google.com with SMTP id e49so2972564eek.3 for ; Thu, 10 Apr 2014 04:44:04 -0700 (PDT) List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: stefano.stabellini@citrix.com, Chen Baozi , Julien Grall , tim@xen.org, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org On arm64, VFP instructions requires vfpregs to be 128-byte aligned. By chance, the field is already correctly aligned. In the case if someone decides to add a new field before, Xen will receive a data abort as soon as it saves/restores VFP. We are safe on arm32 as the only constraint is to be 32-byte aligned. Reported-by: Chen Baozi Signed-off-by: Julien Grall --- I think this patch is a good candidate for backporting to Xen 4.4 --- xen/include/asm-arm/arm64/vfp.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/include/asm-arm/arm64/vfp.h b/xen/include/asm-arm/arm64/vfp.h index 373f156..6ab5d36 100644 --- a/xen/include/asm-arm/arm64/vfp.h +++ b/xen/include/asm-arm/arm64/vfp.h @@ -1,9 +1,12 @@ #ifndef _ARM_ARM64_VFP_H #define _ARM_ARM64_VFP_H +/* ARM64 VFP instruction requires fpregs address to be 128-byte aligned */ +#define __vfp_aligned __attribute__((aligned(16))) + struct vfp_state { - uint64_t fpregs[64]; + uint64_t fpregs[64] __vfp_aligned; uint32_t fpcr; uint32_t fpexc32_el2; uint32_t fpsr; -- 1.7.10.4