From: Julien Grall Date: Thu, 10 Apr 2014 11:43:57 +0000 (+0100) Subject: xen/arm64: Correctly align VFP regs X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5206 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9b4e96724eeb916f2cd311d9133f00c216caa321;p=xen.git xen/arm64: Correctly align VFP regs 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 Acked-by: Ian Campbell --- diff --git a/xen/include/asm-arm/arm64/vfp.h b/xen/include/asm-arm/arm64/vfp.h index 373f156b2e..6ab5d36c6c 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;