From patchwork Thu Apr 10 11:43:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 28156 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E51DB20671 for ; Thu, 10 Apr 2014 11:45:24 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id i7sf17483483oag.4 for ; Thu, 10 Apr 2014 04:45:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-post:list-help :list-subscribe:mime-version:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive :content-type:content-transfer-encoding; bh=IaZlH7a1OtThI95x57iICJkjpAq3vLpoA3585INgklA=; b=VeBhO8UDRMQoPeexboEscQYGljZQQ2iLJcbtrojE94GizjiMMVuysaLr7yr0VvpxNz jK6Wqfew6Rx/qhcLcC41tJFcEhSj0zx8tNs2dQyAiJbWsNCYu5KOpB43qNkpw9cE7FRC ugQj9QoZ6XPzAHRjUKo01g8FQfiyaA1U+/1i8v1VZreY+s8JOgDID+R0OHfRw8ckOTmL 464CMOeYCYFlMnZwUTe9x3DBs/gvR6AI/cR3jDxaStDl2Ftc+1bZFE7WF4FM78cXRl9G JCUi7rXeS7APWu6aFauldYPFJ6936RJ8nKanWXr2v6k54udFbTBVswv+tBkpb4sPDpvz He5Q== X-Gm-Message-State: ALoCoQkW3qUVyYhGPt8TnZHpCvNhUAvXP7dni7UjjbT0FdbS6QcgDUumY0yUE1k+liVJHaXK/fVn X-Received: by 10.50.70.66 with SMTP id k2mr5497104igu.7.1397130323939; Thu, 10 Apr 2014 04:45:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.141 with SMTP id g13ls1090300qge.76.gmail; Thu, 10 Apr 2014 04:45:23 -0700 (PDT) X-Received: by 10.221.55.133 with SMTP id vy5mr14116752vcb.17.1397130323758; Thu, 10 Apr 2014 04:45:23 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id sr19si647018vcb.71.2014.04.10.04.45.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 04:45:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id ik5so3390184vcb.0 for ; Thu, 10 Apr 2014 04:45:23 -0700 (PDT) X-Received: by 10.52.119.197 with SMTP id kw5mr11662833vdb.5.1397130323668; Thu, 10 Apr 2014 04:45:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp52358vcb; Thu, 10 Apr 2014 04:45:23 -0700 (PDT) X-Received: by 10.229.214.74 with SMTP id gz10mr19766413qcb.19.1397130323291; Thu, 10 Apr 2014 04:45:23 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id o2si1754836qag.6.2014.04.10.04.45.22 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 10 Apr 2014 04:45:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WYDOp-0001UM-Vn; Thu, 10 Apr 2014 11:44:07 +0000 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: from [193.109.254.147:11633] by server-3.bemta-14.messagelabs.com id C9/2E-22179-50486435; Thu, 10 Apr 2014 11:44:05 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-12.tower-27.messagelabs.com!1397130245!7486956!1 X-Originating-IP: [74.125.83.44] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20402 invoked from network); 10 Apr 2014 11:44:05 -0000 Received: from mail-ee0-f44.google.com (HELO mail-ee0-f44.google.com) (74.125.83.44) by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 10 Apr 2014 11:44:05 -0000 Received: by mail-ee0-f44.google.com with SMTP id e49so2972564eek.3 for ; Thu, 10 Apr 2014 04:44:04 -0700 (PDT) X-Received: by 10.14.69.201 with SMTP id n49mr365575eed.106.1397130244805; Thu, 10 Apr 2014 04:44:04 -0700 (PDT) Received: from belegaer.uk.xensource.com ([185.25.64.249]) by mx.google.com with ESMTPSA id w12sm9323794eez.36.2014.04.10.04.44.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Apr 2014 04:44:04 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 10 Apr 2014 12:43:57 +0100 Message-Id: <1397130237-2328-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 Cc: stefano.stabellini@citrix.com, Chen Baozi , Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH] xen/arm64: Correctly align VFP regs X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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;