All of lore.kernel.org
 help / color / mirror / Atom feed
From: julien.grall@linaro.org (Julien Grall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] xen/block: Correctly define structures in public headers on ARM32 and ARM64
Date: Tue, 03 Dec 2013 16:19:55 +0000	[thread overview]
Message-ID: <529E04AB.5060304@linaro.org> (raw)
In-Reply-To: <20131203160018.67542a53@alan.etchedpixels.co.uk>

On 12/03/2013 04:00 PM, One Thousand Gnomes wrote:
> On Tue,  3 Dec 2013 15:40:37 +0000
> Julien Grall <julien.grall@linaro.org> wrote:
> 
>> 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.
> 
> How does a guest ascertain which API to use ?
> 
> How does the patch ensure new kernels on existing hypervisor versions
> don't break ?

As Ian said on the thread "xen-block: correctly define structures in
public headers" (see thread https://lkml.org/lkml/2013/12/3/155), the
ABI is not yet fixed for ARM.

> 
> What is the failure case given the alignment change seems potentially to
> produce valid but incorrect I/O requests - can it cause corruption ?

The request ID will likely be wrong, so the guest won't accept the
request. It should not corrupt the block device.

> It seems to me you should be defining
> 
> struct blkif_request_rw_v2
> 
> and using the correct version according to which API the hypervisor
> requires, not just breaking it.

This API doesn't involve the hypervisor. It's only a way to talk between
DOM0 and a guest. Without this change you will break compatibility with
other OSes.

-- 
Julien Grall

WARNING: multiple messages have this Message-ID (diff)
From: Julien Grall <julien.grall@linaro.org>
To: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Cc: xen-devel@lists.xenproject.org, patches@linaro.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Roger Pau Monne <roger.pau@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH v2] xen/block: Correctly define structures in public headers on ARM32 and ARM64
Date: Tue, 03 Dec 2013 16:19:55 +0000	[thread overview]
Message-ID: <529E04AB.5060304@linaro.org> (raw)
In-Reply-To: <20131203160018.67542a53@alan.etchedpixels.co.uk>

On 12/03/2013 04:00 PM, One Thousand Gnomes wrote:
> On Tue,  3 Dec 2013 15:40:37 +0000
> Julien Grall <julien.grall@linaro.org> wrote:
> 
>> 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.
> 
> How does a guest ascertain which API to use ?
> 
> How does the patch ensure new kernels on existing hypervisor versions
> don't break ?

As Ian said on the thread "xen-block: correctly define structures in
public headers" (see thread https://lkml.org/lkml/2013/12/3/155), the
ABI is not yet fixed for ARM.

> 
> What is the failure case given the alignment change seems potentially to
> produce valid but incorrect I/O requests - can it cause corruption ?

The request ID will likely be wrong, so the guest won't accept the
request. It should not corrupt the block device.

> It seems to me you should be defining
> 
> struct blkif_request_rw_v2
> 
> and using the correct version according to which API the hypervisor
> requires, not just breaking it.

This API doesn't involve the hypervisor. It's only a way to talk between
DOM0 and a guest. Without this change you will break compatibility with
other OSes.

-- 
Julien Grall

  parent reply	other threads:[~2013-12-03 16:19 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03 15:40 [PATCH v2] xen/block: Correctly define structures in public headers on ARM32 and ARM64 Julien Grall
2013-12-03 15:40 ` Julien Grall
2013-12-03 16:00 ` One Thousand Gnomes
2013-12-03 16:00 ` One Thousand Gnomes
2013-12-03 16:00   ` One Thousand Gnomes
2013-12-03 16:19   ` Julien Grall
2013-12-03 16:19   ` Julien Grall [this message]
2013-12-03 16:19     ` Julien Grall
2013-12-03 16:32     ` One Thousand Gnomes
2013-12-03 16:32       ` One Thousand Gnomes
2013-12-03 16:41       ` Ian Campbell
2013-12-03 16:41       ` Ian Campbell
2013-12-03 16:41         ` Ian Campbell
2013-12-03 17:03         ` One Thousand Gnomes
2013-12-03 17:03           ` One Thousand Gnomes
2013-12-03 18:03           ` Konrad Rzeszutek Wilk
2013-12-03 18:03             ` Konrad Rzeszutek Wilk
2013-12-03 18:03           ` Konrad Rzeszutek Wilk
2013-12-03 17:03         ` One Thousand Gnomes
2013-12-03 16:32     ` One Thousand Gnomes
2013-12-03 17:10 ` David Vrabel
2013-12-03 17:10 ` David Vrabel
2013-12-03 17:10   ` David Vrabel
2013-12-03 18:01   ` Konrad Rzeszutek Wilk
2013-12-03 18:01     ` Konrad Rzeszutek Wilk
2013-12-03 18:01   ` Konrad Rzeszutek Wilk
2013-12-12 14:19 ` [Xen-devel] " Ian Campbell
2013-12-12 14:19   ` Ian Campbell
2013-12-12 15:11   ` Roger Pau Monné
2013-12-12 15:11     ` Roger Pau Monné
2013-12-12 15:11   ` Roger Pau Monné
2013-12-12 14:19 ` Ian Campbell
  -- strict thread matches above, loose matches on Subject: below --
2013-12-03 15:40 Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=529E04AB.5060304@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.