From: "Michael S. Tsirkin" <mst@redhat.com>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
linux-kernel <linux-kernel@vger.kernel.org>,
kvm <kvm@vger.kernel.org>,
virtualization <virtualization@lists.linux-foundation.org>,
Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: virtio-pci new configuration proposal
Date: Fri, 4 Nov 2011 16:23:38 +0200 [thread overview]
Message-ID: <20111104142338.GB24452@redhat.com> (raw)
In-Reply-To: <1320414804.3334.13.camel@lappy>
On Fri, Nov 04, 2011 at 03:53:24PM +0200, Sasha Levin wrote:
> On Fri, 2011-11-04 at 15:51 +0200, Michael S. Tsirkin wrote:
> > On Fri, Nov 04, 2011 at 02:32:19PM +0200, Sasha Levin wrote:
> > > On Fri, 2011-11-04 at 13:40 +0200, Michael S. Tsirkin wrote:
> > > > On Fri, Nov 04, 2011 at 08:14:43PM +1030, Rusty Russell wrote:
> > > > > > > 3) If we're changing the queue layout, it's a chance to fix a
> > > > > > > longstanding bug: let the guest notify the host of preferred
> > > > > > > queue size and alignment.
> > > > > >
> > > > > > Yup, we can do that.
> > > >
> > > > We don't need to change all of layout for that - just add another field
> > > > in the common config structure to supply the alignment.
> > >
> > > How would you do it without changing the layout? Add another optional
> > > field at the end which will shift offsets based on whether the host and
> > > guest support this new feature or not?
> > >
> > > This leads to 3 different things which now shift config offsets around.
> >
> > No. Just put the field at offset 24 from the offset specified
> > by VIRTIO_PCI_CAP_COMMON_CFG.
>
> Two questions here:
>
> - What about backwards compatibility? How would the config space look
> when we're not using the new layout?
Exactly as it does now. You don't get to tweak alignment then.
> - How does it work with 64 bit features which are also located there?
Basically each field gets an offset. E.g.
24 - features
28 - queue alignment
> > > As you said, the PCI cap list was introduced both to save space (which
> > > is not the motivation here), and because it's a very efficient
> >
> > It's actually pretty inefficient - there's an overhead of 3 bytes for
> > each vendor specific option.
>
> It's efficient because while you pay a small price for each optional
> option it also means that that option is optional and won't clutter the
> config space if it's not really in use.
I guess my assumption is that most options will be in use,
not discarded dead-ends.
> Think of how the PCI config space would look if all those caps wouldn't
> have been optional and would instead all of them would have just have
> been attached to the end of the config space.
It started out this way, but then they started running out
of space - it's only 256 bytes - so the capability mechanism
was invented.
> >
> > > and easy way to manage optional features without requiring tricks
> > > which move offsets around like we do now.
> >
> > Tricks with offsets only appeared because we had datapath, device
> > specific and common config in the same place.
> > feature list isn't needed to fix that.
> >
> > > --
> > >
> > > Sasha.
>
> --
>
> Sasha.
next prev parent reply other threads:[~2011-11-04 14:22 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-02 18:49 virtio-pci new configuration proposal Sasha Levin
2011-11-02 19:08 ` Michael S. Tsirkin
2011-11-02 19:07 ` Sasha Levin
2011-11-02 19:14 ` Michael S. Tsirkin
2011-11-03 1:58 ` Rusty Russell
2011-11-03 8:33 ` Sasha Levin
2011-11-03 12:46 ` Michael S. Tsirkin
2011-11-03 13:19 ` Sasha Levin
2011-11-03 13:48 ` Michael S. Tsirkin
2011-11-04 9:44 ` Rusty Russell
2011-11-04 11:40 ` Michael S. Tsirkin
2011-11-04 12:32 ` Sasha Levin
2011-11-04 13:51 ` Michael S. Tsirkin
2011-11-04 13:53 ` Sasha Levin
2011-11-04 14:23 ` Michael S. Tsirkin [this message]
2011-11-04 14:53 ` Sasha Levin
2011-11-06 7:30 ` Michael S. Tsirkin
2011-11-06 20:24 ` Sasha Levin
2011-11-06 21:38 ` Michael S. Tsirkin
2011-11-07 5:16 ` Rusty Russell
2011-11-07 21:14 ` Michael S. Tsirkin
2011-11-07 23:53 ` Rusty Russell
2011-11-08 6:32 ` Michael S. Tsirkin
2011-11-08 10:21 ` Rusty Russell
2011-11-08 21:31 ` Michael S. Tsirkin
2011-11-08 14:15 ` Sasha Levin
2011-11-03 11:03 ` Michael S. Tsirkin
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=20111104142338.GB24452@redhat.com \
--to=mst@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=virtualization@lists.linux-foundation.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