From patchwork Tue Dec 3 15:09:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 21967 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 D3E6E202AE for ; Tue, 3 Dec 2013 15:09:50 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id h16sf47941119oag.8 for ; Tue, 03 Dec 2013 07:09:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=7z7qF4QcJu/JqF0r60JhjXGgQm0iD/ONLfUDleeDRSI=; b=JtHD/PW0rVHK2/lOwEhUJm3qpHidwvXy9zU8Gf9JZWPo0smAQ13KTe+HKcNmSju3Hw QlWiGR5DBKKQD0ZQr/vdNZWmwHwyCg7AF85t6VKzBiBA1sf6rt2q9U0AmVUXe0KwI0Cq 20/46MNBbl3yOD2mmp9J1kGDk8VmGmY1D0IrXTVpGm9V6NaxGYEBokjL2XgScYHwJmBo SHNCCdWEgY5rEFe8ahbnQDCSQ7CAoXW5tQ8J4XmMcOV640e6kbSrMvNt3eQGhqyRpiGr GPCqq9AxKxegw3dS2EZp5gikrnTmnxM8sqP6IyKzm8fN1wu8eBq4Sb2fk1bpXdneqDLO cPeg== X-Gm-Message-State: ALoCoQk3O//wIPx8jzCu5wzYCJPvBf1HUsNqQsueXfVz9Y8Upnhg2l4IdwwXy1QpYSzVKg6iSMfL X-Received: by 10.50.79.201 with SMTP id l9mr1187234igx.4.1386083390420; Tue, 03 Dec 2013 07:09:50 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.120.164 with SMTP id ld4ls611429qeb.51.gmail; Tue, 03 Dec 2013 07:09:50 -0800 (PST) X-Received: by 10.52.98.99 with SMTP id eh3mr4516999vdb.29.1386083390305; Tue, 03 Dec 2013 07:09:50 -0800 (PST) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id ta5si31450251veb.107.2013.12.03.07.09.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 07:09:50 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.175 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.175; Received: by mail-vc0-f175.google.com with SMTP id ld13so9720208vcb.6 for ; Tue, 03 Dec 2013 07:09:50 -0800 (PST) X-Received: by 10.52.113.97 with SMTP id ix1mr8803121vdb.9.1386083390023; Tue, 03 Dec 2013 07:09:50 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp215536vcz; Tue, 3 Dec 2013 07:09:49 -0800 (PST) X-Received: by 10.14.37.66 with SMTP id x42mr3154244eea.83.1386083389049; Tue, 03 Dec 2013 07:09:49 -0800 (PST) Received: from mail-ea0-f175.google.com (mail-ea0-f175.google.com [209.85.215.175]) by mx.google.com with ESMTPS id o46si3398164eef.44.2013.12.03.07.09.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 07:09:49 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.175 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.175; Received: by mail-ea0-f175.google.com with SMTP id z10so10070221ead.34 for ; Tue, 03 Dec 2013 07:09:48 -0800 (PST) X-Received: by 10.15.111.201 with SMTP id cj49mr6824467eeb.56.1386083388300; Tue, 03 Dec 2013 07:09:48 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id z42sm11345203eeo.17.2013.12.03.07.09.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Dec 2013 07:09:47 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Cc: patches@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Julien Grall , Roger Pau Monne , Konrad Rzeszutek Wilk , David Vrabel , Boris Ostrovsky , Ian Campbell , Stefano Stabellini Subject: [PATCH] xen/block: Correctly define structures in public headers on ARM32 and ARM64 Date: Tue, 3 Dec 2013 15:09:42 +0000 Message-Id: <1386083382-7306-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 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.175 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On ARM (32 bits and 64 bits), the double-word is 8-bytes aligned. This will result on different structure from Xen and Linux repositories. As Linux is using __packed__ attribute, it must have a 4-bytes padding before each "id" field. This change breaks guest block support with older kernel. IMHO, it's acceptable because Xen on ARM is still on Tech Preview and the hypercall ABI is not yet freezed. Signed-off-by: Julien Grall Cc: Roger Pau Monne Cc: Konrad Rzeszutek Wilk Cc: David Vrabel Cc: Boris Ostrovsky Cc: Ian Campbell Cc: Stefano Stabellini --- This patch is the rework of "xen-block: correctly define structures in public headers" sent by Roger (see https://lkml.org/lkml/2013/12/3/155). --- include/xen/interface/io/blkif.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index 65e1209..08e8e9d 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h @@ -146,7 +146,7 @@ struct blkif_request_segment_aligned { struct blkif_request_rw { uint8_t nr_segments; /* number of segments */ blkif_vdev_t handle; /* only for read/write requests */ -#ifdef CONFIG_X86_64 +#if defined(CONFIG_X86_64) || defined(CONFIG_ARM) || defined(CONFIG_ARM64) uint32_t _pad1; /* offsetof(blkif_request,u.rw.id) == 8 */ #endif uint64_t id; /* private guest value, echoed in resp */ @@ -163,7 +163,7 @@ struct blkif_request_discard { uint8_t flag; /* BLKIF_DISCARD_SECURE or zero. */ #define BLKIF_DISCARD_SECURE (1<<0) /* ignored if discard-secure=0 */ blkif_vdev_t _pad1; /* only for read/write requests */ -#ifdef CONFIG_X86_64 +#if defined(CONFIG_X86_64) || defined(CONFIG_ARM) || defined(CONFIG_ARM64) uint32_t _pad2; /* offsetof(blkif_req..,u.discard.id)==8*/ #endif uint64_t id; /* private guest value, echoed in resp */ @@ -175,7 +175,7 @@ struct blkif_request_discard { struct blkif_request_other { uint8_t _pad1; blkif_vdev_t _pad2; /* only for read/write requests */ -#ifdef CONFIG_X86_64 +#if defined(CONFIG_X86_64) || defined(CONFIG_ARM) || defined(CONFIG_ARM64) uint32_t _pad3; /* offsetof(blkif_req..,u.other.id)==8*/ #endif uint64_t id; /* private guest value, echoed in resp */ @@ -184,7 +184,7 @@ struct blkif_request_other { struct blkif_request_indirect { uint8_t indirect_op; uint16_t nr_segments; -#ifdef CONFIG_X86_64 +#if defined(CONFIG_X86_64) || defined(CONFIG_ARM) || defined(CONFIG_ARM64) uint32_t _pad1; /* offsetof(blkif_...,u.indirect.id) == 8 */ #endif uint64_t id; @@ -192,7 +192,7 @@ struct blkif_request_indirect { blkif_vdev_t handle; uint16_t _pad2; grant_ref_t indirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST]; -#ifdef CONFIG_X86_64 +#if defined(CONFIG_X86_64) || defined(CONFIG_ARM) || defined(CONFIG_ARM64) uint32_t _pad3; /* make it 64 byte aligned */ #else uint64_t _pad3; /* make it 64 byte aligned */