virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: virtualization@lists.linux-foundation.org,
	qemu-devel <qemu-devel@nongnu.org>,
	kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] Using PCI config space to indicate config location
Date: Tue, 09 Oct 2012 08:33:17 +0200	[thread overview]
Message-ID: <5073C52D.20802@redhat.com> (raw)
In-Reply-To: <87sj9oh0pm.fsf@codemonkey.ws>

  Hi,

>> Well, we also want to clean up the registers, so how about:
>>
>> BAR0: legacy, as is.  If you access this, don't use the others.

Ok.

>> BAR1: new format virtio-pci layout.  If you use this, don't use BAR0.
>> BAR2: virtio-cfg.  If you use this, don't use BAR0.

Why use two bars for this?  You can put them into one mmio bar, together
with the msi-x vector table and PBA.  Of course a pci capability
describing the location is helpful for that ;)

>> BAR3: ISR. If you use this, don't use BAR0.

Again, I wouldn't hardcode that but use a capability.

>> I prefer the cases exclusive (ie. use one or the other) as a clear path
>> to remove the legacy layout; and leaving the ISR in BAR0 leaves us with
>> an ugly corner case in future (ISR is BAR0 + 19?  WTF?).

Ok, so we have four register sets:

  (1) legacy layout
  (2) new virtio-pci
  (3) new virtio-config
  (4) new virtio-isr

We can have a vendor pci capability, with a dword for each register set:

  bit  31    -- present bit
  bits 26-24 -- bar
  bits 23-0  -- offset

So current drivers which must support legacy can use this:

  legacy layout     -- present, bar 0, offset 0
  new virtio-pci    -- present, bar 1, offset 0
  new virtio-config -- present, bar 1, offset 256
  new virtio-isr    -- present, bar 0, offset 19

[ For completeness: msi-x capability could add this: ]

  msi-x vector table            bar 1, offset 512
  msi-x pba                     bar 1, offset 768

> We'll never remove legacy so we shouldn't plan on it.  There are
> literally hundreds of thousands of VMs out there with the current virtio
> drivers installed in them.  We'll be supporting them for a very, very
> long time :-)

But new devices (virtio-qxl being a candidate) don't have old guests and
don't need to worry.

They could use this if they care about fast isr:

  legacy layout     -- not present
  new virtio-pci    -- present, bar 1, offset 0
  new virtio-config -- present, bar 1, offset 256
  new virtio-isr    -- present, bar 0, offset 0

Or this if they don't worry about isr performance:

  legacy layout     -- not present
  new virtio-pci    -- present, bar 0, offset 0
  new virtio-config -- present, bar 0, offset 256
  new virtio-isr    -- not present

> I don't think we gain a lot by moving the ISR into a separate BAR.
> Splitting up registers like that seems weird to me too.

Main advantage of defining a register set with just isr is that it
reduces pio address space consumtion for new virtio devices which don't
have to worry about the legacy layout (8 bytes which is minimum size for
io bars instead of 64 bytes).

> If we added an additional constraints that BAR1 was mirrored except for

Why add constraints?  We want something future-proof, don't we?

>> The detection is simple: if BAR1 has non-zero length, it's new-style,
>> otherwise legacy.

Doesn't fly.  BAR1 is in use today for MSI-X support.

> I agree that this is the best way to extend, but I think we should still
> use a transport feature bit.  We want to be able to detect within QEMU
> whether a guest is using these new features because we need to adjust
> migration state accordingly.

Why does migration need adjustments?

[ Not that I want veto a feature bit, but I don't see the need yet ]

cheers,
  Gerd

  parent reply	other threads:[~2012-10-09  6:33 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87zk4c2tqq.fsf@rustcorp.com.au>
2012-10-04 18:49 ` [Qemu-devel] Proposal for virtio standardization Anthony Liguori
     [not found] ` <874nmajcmj.fsf@codemonkey.ws>
2012-10-08  2:21   ` Using PCI config space to indicate config location Rusty Russell
     [not found]   ` <87y5jhpuu2.fsf@rustcorp.com.au>
2012-10-08 13:58     ` [Qemu-devel] " Anthony Liguori
     [not found]     ` <87bogddq0l.fsf@codemonkey.ws>
2012-10-08 14:58       ` Gerd Hoffmann
2012-10-08 15:09         ` Anthony Liguori
2012-10-08 20:13           ` Gerd Hoffmann
2012-10-08 20:55             ` Anthony Liguori
2012-10-08 23:56               ` Rusty Russell
2012-10-09  1:51                 ` Anthony Liguori
2012-10-09  3:16                   ` Rusty Russell
2012-10-09  6:33                   ` Gerd Hoffmann [this message]
2012-10-09 15:26                     ` Anthony Liguori
     [not found]                     ` <87wqyzll8r.fsf@codemonkey.ws>
2012-10-09 20:24                       ` Gerd Hoffmann
2012-10-10  2:54                         ` Rusty Russell
     [not found]                         ` <87zk3v6npm.fsf@rustcorp.com.au>
2012-10-10 13:36                           ` Anthony Liguori
2012-10-10 13:41                             ` Michael S. Tsirkin
2012-10-11  0:43                               ` Rusty Russell
     [not found]                   ` <87haq48hds.fsf@rustcorp.com.au>
2012-10-09 10:17                     ` Avi Kivity
2012-10-09 14:03                       ` Anthony Liguori
2012-10-09 13:56                     ` Anthony Liguori
2012-10-09 21:09                     ` Jamie Lokier
     [not found]                     ` <874nm3ycj8.fsf@codemonkey.ws>
2012-10-10  3:44                       ` Rusty Russell
2012-10-10 11:37                         ` Michael S. Tsirkin
     [not found]                     ` <20121009210901.GY14867@jl-vm1.vm.bytemark.co.uk>
2012-10-10  3:44                       ` Rusty Russell
2012-10-11  0:08                         ` Rusty Russell
2012-10-10  8:34                 ` Michael S. Tsirkin
2012-10-10  8:30     ` Michael S. Tsirkin
2012-10-11  1:18       ` Rusty Russell
2012-10-11 10:23         ` Michael S. Tsirkin
2012-10-11 22:29           ` Rusty Russell
     [not found]           ` <87391k7icv.fsf@rustcorp.com.au>
2012-10-12  9:33             ` Michael S. Tsirkin
2012-10-12  9:51               ` Rusty Russell
2012-10-12 10:02                 ` Michael S. Tsirkin
2012-10-16 13:15                   ` Rusty Russell
     [not found]                   ` <87k3uqpngi.fsf@rustcorp.com.au>
2012-10-16 13:30                     ` Michael S. Tsirkin
2012-10-16 13:52                       ` Rusty Russell
2012-10-09 14:02 ` Proposal for virtio standardization Cornelia Huck
     [not found] ` <20121009160201.5303a7ca@BR9GNB5Z>
2012-10-10  3:46   ` Rusty Russell

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=5073C52D.20802@redhat.com \
    --to=kraxel@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --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;
as well as URLs for NNTP newsgroup(s).