From: George Dunlap <george.dunlap@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
"Ian Jackson" <ian.jackson@eu.citrix.com>,
"Paulina Szubarczyk" <paulinaszubarczyk@gmail.com>,
"David Vrabel" <david.vrabel@citrix.com>,
"Anthony Perard" <anthony.perard@citrix.com>,
xen-devel <xen-devel@lists.xenproject.org>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v3 1/2] Interface for grant copy operation in libs.
Date: Tue, 5 Jul 2016 17:27:58 +0100 [thread overview]
Message-ID: <CAFLBxZZqyXsdET3ZxJNW_ocraSZfEhOPTLKP-RWupOOUbU=M7w@mail.gmail.com> (raw)
In-Reply-To: <20160622145243.GG1790@citrix.com>
On Wed, Jun 22, 2016 at 3:52 PM, Wei Liu <wei.liu2@citrix.com> wrote:
>> I think the best solution is to allow the osdep code to provide the
>> implementation of xengnttab_grant_copy_segment_t, allowing the Linux
>> code to do:
>>
>> typedef ioctl_gntdev_grant_copy_segment xengnttab_grant_copy_segment_t
>>
>> You should still provide the generic structure as well, for those
>> platforms that don't provide their own optimized version.
>>
>
> We can't do that (yet). This means we open the door for divergence on
> different platforms.
>
> Basically this approach requires each platform to do the same thing
> (typedef) This implies any application that uses libxengnttab will need
> to test what platform it runs on. It is just pushing the issue somewhere
> else.
>
> Still, I think I would wait a bit for other people to weight in because
> I'm not sure if my concern is wrong headed.
I tend to be sympathetic to David's argument here. The library has to
provide some ABI to callers; and it has to know the appropriate Linux
ABI in order to translate from the library ABI to the Linux ABI. If
it happens to know these are the same, I don't see a reason not to
"translate" it by just by casting the pointer.
If we want to declare the library ABI in a stand-alone fashion (i.e.,
instead of just doing a typedef, so that the library definition is the
same on all platforms), then having some compile-time checking to make
sure that the layouts of the two structures are identical makes sense.
Beyond that, I'm not sure what the extra copying really buys us.
-George
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-07-05 16:28 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-22 8:38 [PATCH v3 0/2] qemu-qdisk: Implementation of grant copy operation Paulina Szubarczyk
2016-06-22 8:38 ` [PATCH v3 1/2] Interface for grant copy operation in libs Paulina Szubarczyk
2016-06-22 9:37 ` David Vrabel
2016-06-22 9:53 ` Paulina Szubarczyk
2016-06-22 11:24 ` Wei Liu
2016-06-22 14:19 ` Paulina Szubarczyk
2016-06-22 11:21 ` Wei Liu
2016-06-22 12:37 ` David Vrabel
2016-06-22 13:29 ` Wei Liu
2016-06-22 13:52 ` David Vrabel
2016-06-22 14:52 ` Wei Liu
2016-06-22 16:49 ` Wei Liu
2016-07-06 15:49 ` Roger Pau Monné
2016-07-05 16:27 ` George Dunlap [this message]
2016-07-08 13:18 ` Wei Liu
2016-07-13 9:12 ` Wei Liu
2016-06-22 8:38 ` [PATCH v3 2/2] qdisk - hw/block/xen_disk: grant copy implementation Paulina Szubarczyk
2016-07-13 12:34 ` Paulina Szubarczyk
2016-07-14 10:37 ` Wei Liu
2016-07-15 10:28 ` Paulina Szubarczyk
2016-07-15 11:15 ` Wei Liu
2016-07-15 17:11 ` Anthony PERARD
2016-07-19 10:16 ` Paulina Szubarczyk
2016-07-15 16:55 ` Anthony PERARD
2016-07-19 10:51 ` Paulina Szubarczyk
2016-07-19 9:12 ` Roger Pau Monné
2016-07-19 10:12 ` Paulina Szubarczyk
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='CAFLBxZZqyXsdET3ZxJNW_ocraSZfEhOPTLKP-RWupOOUbU=M7w@mail.gmail.com' \
--to=george.dunlap@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=david.vrabel@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=paulinaszubarczyk@gmail.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).