From: Scott Wood <scottwood@freescale.com>
To: Stuart Yoder <b08248@gmail.com>
Cc: kvm@vger.kernel.org, Benjamin Herrenschmidt <benh@au.ibm.com>,
qemu-devel@nongnu.org, agraf@suse.de, alex.williamson@redhat.com,
avi@redhat.com
Subject: Re: [Qemu-devel] RFC [v2]: vfio / device assignment -- layout of device fd files
Date: Mon, 26 Sep 2011 19:25:16 -0500 [thread overview]
Message-ID: <4E8117EC.1020406@freescale.com> (raw)
In-Reply-To: <CALRxmdB4n5Yaye4+uVQHf8=Mx=XT8eJOC614oUQTUohz0RJN8w@mail.gmail.com>
On 09/26/2011 02:57 PM, Stuart Yoder wrote:
> On Mon, Sep 26, 2011 at 2:51 AM, David Gibson
>> Um, not to put too fine a point on it, this is madness.
>>
>> Yes, it's very flexible and can thereby cover a very wide range of
>> cases. But it's much, much too complex. Userspace has to parse a
>> complex, multilayered data structure, with variable length elements
>> just to get an address at which to do IO. I can pretty much guarantee
>> that if we went with this, most userspace programs using this
>> interface would just ignore this metadata and directly map the
>> offsets at which they happen to know the kernel will put things for
>> the type of device they care about.
Then they deserve to break when those offsets change, just like with all
the other bad assumptions poorly written code tends to make.
Really, it should not be that hard to parse this. A loop with a switch
statement for toplevel records, and another loop with a switch statement
for each context in which subrecords can appear.
>> _At least_ for PCI, I think the original VFIO layout of each BAR at a
>> fixed, well known offset is much better.
This is what grew out of attempting to address the needs of assigning
non-PCI devices based on the device tree. Personally, I'd rather be
dealing with this for PCI devices as well.
>> Despite its limitations,
>> just advertising a "device type" ID which describes one of a few fixed
>> layouts would be preferable to this.
That's already more information than the original VFIO layout provided.
> So, is your issue really the variable length nature of what was
> proposed?
>
> I don't think it would be that hard to make the different resources
> fixed length. I think we have 2 types of resources now-- address
> regions and interrupts.
>
> The only thing that get's a bit tricky is device tree paths, which
> are obviously variable length.
>
> We could put a description of all the resources in an array with
> each element being something like 4KB??
I'm not sure what that would improve. If the user wants to put a limit
on the size of a certain field it's willing to handle, so be it. It'll
break in the same set of cases that would be unexpressable with such a
limitation in the interface, except that since the breakage is not in
the interface, it's more easily fixable.
-Scott
prev parent reply other threads:[~2011-09-27 0:25 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-09 13:11 [Qemu-devel] RFC [v2]: vfio / device assignment -- layout of device fd files Stuart Yoder
2011-09-09 13:16 ` Stuart Yoder
2011-09-19 15:16 ` Alex Williamson
2011-09-19 19:37 ` Scott Wood
2011-09-19 21:07 ` Alex Williamson
2011-09-19 21:15 ` Scott Wood
2011-09-26 7:51 ` David Gibson
2011-09-26 10:04 ` Alexander Graf
2011-09-26 18:34 ` Alex Williamson
2011-09-26 20:03 ` Stuart Yoder
2011-09-26 20:42 ` Alex Williamson
2011-09-26 23:59 ` Scott Wood
2011-09-27 0:45 ` Alex Williamson
2011-09-27 21:28 ` Scott Wood
2011-09-28 2:40 ` Alex Williamson
2011-09-28 8:58 ` Alexander Graf
2011-09-30 8:55 ` David Gibson
2011-09-30 8:50 ` David Gibson
2011-09-30 8:46 ` David Gibson
2011-09-30 16:37 ` Alex Williamson
2011-09-30 21:59 ` Alex Williamson
2011-09-30 8:40 ` David Gibson
2011-09-26 19:57 ` Stuart Yoder
2011-09-27 0:25 ` Scott Wood [this message]
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=4E8117EC.1020406@freescale.com \
--to=scottwood@freescale.com \
--cc=agraf@suse.de \
--cc=alex.williamson@redhat.com \
--cc=avi@redhat.com \
--cc=b08248@gmail.com \
--cc=benh@au.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.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).