From: Scott Wood <scottwood@freescale.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Wood Scott-B07421 <B07421@freescale.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
Alexander Graf <agraf@suse.de>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Yoder Stuart-B08248 <B08248@freescale.com>,
"avi@redhat.com" <avi@redhat.com>,
"Joerg.Roedel@amd.com" <Joerg.Roedel@amd.com>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] RFC: vfio / device assignment -- layout of device fd files
Date: Tue, 30 Aug 2011 11:54:15 -0500 [thread overview]
Message-ID: <4E5D15B7.4010007@freescale.com> (raw)
In-Reply-To: <1314680115.2859.449.camel@bling.home>
On 08/29/2011 11:55 PM, Alex Williamson wrote:
> Thanks for the example. Is it always the case that you need a path and
> an index? If so, why are they separate sub-regions instead of combined
> into a DT_INFO sub-region?
You'll always need both. DTPATH was put into a separate subrecord
because it is of variable length. Putting it at the end of DTINDEX
would inhibit DTINDEX's extensibility.
> On Mon, 2011-08-29 at 18:14 -0500, Scott Wood wrote:
>> On 08/29/2011 05:46 PM, Alex Williamson wrote:
>>> I could imagine a platform device described by ACPI that might want to
>>> differentiate. The physical device doesn't get moved of course, but
>>> guest drivers might care how the device is described if we need to
>>> rebuild those ACPI tables. ACPI might even be a good place to leverage
>>> these data structures... /me ducks.
>>
>> ACPI info could be another subrecord type, but in the device tree
>> system-bus case we generally don't have this information at the generic
>> infrastructure level. Drivers are expected to know how their devices'
>> regions should be mapped.
>
> The device tree tells them how they're mapped, right?
> Or maybe more precisely, the device tree tells them where they're mapped and it
> doesn't really matter whether they're 32bit or 64bit because they can't
> be moved.
The device tree says where they're mapped. The concept of "32/64bit"
doesn't really apply to a fixed mapping -- or if not fixed, there may be
arbitrary constraints, and the OS should just treat it as fixed.
> Maybe this is sub-region material. It just feels wrong to enumerate a
> region and not be able to include any basic properties beyond offset and
> size in a common field.
offset, size, and whether you can use mmap() are the only things we
could think of that were universal. The rest can go in subrecords.
>>> Put their instance numbers outside of the BAR region? We have a fixed
>>> REGION space on PCI, so we could just define BAR0 == instance 0, BAR1 ==
>>> instance 1... ROM == instance 6, CONFIG == instance 0xF (or 7).
>>
>> Seems more awkward than just having each region say what it is. What do
>> you do to fill in the gaps?
>
> You don't, instance numbers would just be non-contiguous.
OK, maybe I'm not understanding what you mean by instance numbers -- I
thought you were talking about the order in which they appear. If you
mean to put an index field in the common REGION struct, I'd prefer not
to. It would lack meaning without the context of some particular
encoding scheme. Better to put it in a typed subrecord where we can be
explicit about what it means.
> The reason I cringe at PCI_INFO sub-regions is that all the info is already available
> in PCI config space
BAR index isn't. I'm neutral on whether it makes sense to include BAR type.
> We also have MSI/X
> interrupts on PCI. Do we need to describe those via info records or
> parse PCI config space and know that vfio-pci device fds support the
> VFIO_PCI_DEVICE_SET_MSI_FDS ioctl?
I'm not very familiar with MSI-X, but if it's workable without it then
probably no need.
-Scott
next prev parent reply other threads:[~2011-08-30 16:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-29 16:51 [Qemu-devel] RFC: vfio / device assignment -- layout of device fd files Yoder Stuart-B08248
2011-08-29 19:04 ` Anthony Liguori
2011-08-29 19:32 ` Scott Wood
2011-08-29 19:51 ` Alex Williamson
2011-08-29 21:58 ` Scott Wood
2011-08-29 22:46 ` Alex Williamson
2011-08-29 23:14 ` Scott Wood
2011-08-30 4:55 ` Alex Williamson
2011-08-30 16:54 ` Scott Wood [this message]
2011-09-01 20:00 ` Michael S. Tsirkin
2011-09-01 20:26 ` Scott Wood
2011-09-02 15:57 ` Michael S. Tsirkin
2011-09-02 17:50 ` Scott Wood
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=4E5D15B7.4010007@freescale.com \
--to=scottwood@freescale.com \
--cc=B07421@freescale.com \
--cc=B08248@freescale.com \
--cc=Joerg.Roedel@amd.com \
--cc=agraf@suse.de \
--cc=alex.williamson@redhat.com \
--cc=avi@redhat.com \
--cc=david@gibson.dropbear.id.au \
--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).