All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amos Kong <akong@redhat.com>
To: qemu-devel@nongnu.org, kvm@vger.kernel.org
Cc: Alex Williamson <alex.williamson@redhat.com>,
	seabios@seabios.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: About hotplug multifunction
Date: Wed, 23 Nov 2011 17:06:29 +0800	[thread overview]
Message-ID: <4ECCB795.8060107@redhat.com> (raw)
In-Reply-To: <1466280941.590770.1315552101666.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>

On 09/09/11 15:08, Amos Kong wrote:
> Hello all,
>
> I'm working on hotplug pci multifunction.
>
> 1. qemu cmdline:
> ./x86_64-softmmu/qemu-system-x86_64 -snapshot -m 2000 /home/kvm_autotest_root/images/rhel61-64-virtio.qcow2 -vnc :0 -monitor unix:/tmp/a,server,nowait --enable-kvm -net none
>
> 2. script to add virtio-blk devices:
> for i in `seq 1 7` 0;do
> qemu-img create /tmp/resize$i.qcow2 1G -f qcow2
> echo drive_add 0x6.$i id=drv$i,if=none,file=/tmp/resize$i.qcow2 | nc -U /tmp/a
> echo device_add virtio-blk-pci,id=dev$i,drive=drv$i,addr=0x6.$i,multifunction=on | nc -U /tmp/a
> done
>
> 3. script to add virio-nic devices:
> for i in `seq 1 7` 0;do
> echo netdev_add tap,id=drv$i | nc -U /tmp/a
> echo device_add virtio-net-pci,id=dev$i,netdev=drv$i,addr=0x6.$i,multifunction=on | nc -U /tmp/a
> done
>
> 4. current qemu behaviors
> 4.1. add func 1~7 one by one, then add func 0
> virtio-nic : success, all funcs are added
> virtio-blk : success
>
> 4.2. add func 0~7 one by one
> virtio-nic : failed, only func 0 is added
> virtio-blk : success
>
> 4.3. removing any single func in monitor
> virtio-nic: func 0 are not found in 'lspci', func 1~7 also exist. eth1~eth7 also exist.
> virtio-blk: func 0 are not found in 'lspci', func 1~7 also exist. the device. /dev/vda disappears,
>                vdb,vdc,vde,vdf,vdg,vdh,vdi,vdj also exist. If I re-add 8 funcs to guest, they all works.
>                # lspci (00:06.1 ~ 00:06.7 exist, 00:06.0 doesn't exit)
>                00:06.1 SCSI storage controller: Red Hat, Inc Virtio block device (rev ff)
>
> qemu sends an acpi event to guest, then guest will remove all funcs in the slot.
> linux-2.6/drivers/pci/hotplug/acpiphp_glue.c:
> static int disable_device(struct acpiphp_slot *slot) {
>      list_for_each_entry(func,&slot->funcs, sibling) {
>          ...

Hello all,

I re-tested the multifunction hotplug of winxp,rhel6,win7 guest. 
(upstream qemu-kvm)

For all the guests, func0 needs to be added, otherwise no func can be 
found in guest.
RHEL6 needs to add fun0 in the end, otherwise, the funcs added after 
hot-adding func0 could not be found in guest.
For winxp,win7, add func0 in any time, all the funcs can be found in guest.

This is the test result( hogplug order of funcs & funcs can be found in 
guest):
hotplug order   xp      win7    rhel6
------------    --      ----    -----
func 0~7        0~7     0~7     0~7
func 0~5        0~6     0~6     0~6
func 1~4,0,5    0~5     0~5     0~4
func 1~4        no      no      no

It looks like the 'problem' of linux guest, or could we accept to add 
func0 after adding other funcs for linux guest?

Thanks,
Amos

> Questions:
> 1. why func1~7 still can be found after hot-remove? is it same as real hardware?
> 2. why the func 1~7 could not be added to guest (addingfunc 0~7 one by one)?
> 3. how about this interface to hotplug/hot-unplug multifunction:
>     1) Add func 1-7 by monitor, add func 0, then send an acpi event to notice guest
>     2) Remove func0, send an acpi event to guest. (all funcs can be removed)
> 4. what does "reversion 0xff" stand for?
>
> Thanks in advance,
> Amos

WARNING: multiple messages have this Message-ID (diff)
From: Amos Kong <akong@redhat.com>
To: qemu-devel@nongnu.org, kvm@vger.kernel.org
Cc: Alex Williamson <alex.williamson@redhat.com>,
	seabios@seabios.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] About hotplug multifunction
Date: Wed, 23 Nov 2011 17:06:29 +0800	[thread overview]
Message-ID: <4ECCB795.8060107@redhat.com> (raw)
In-Reply-To: <1466280941.590770.1315552101666.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>

On 09/09/11 15:08, Amos Kong wrote:
> Hello all,
>
> I'm working on hotplug pci multifunction.
>
> 1. qemu cmdline:
> ./x86_64-softmmu/qemu-system-x86_64 -snapshot -m 2000 /home/kvm_autotest_root/images/rhel61-64-virtio.qcow2 -vnc :0 -monitor unix:/tmp/a,server,nowait --enable-kvm -net none
>
> 2. script to add virtio-blk devices:
> for i in `seq 1 7` 0;do
> qemu-img create /tmp/resize$i.qcow2 1G -f qcow2
> echo drive_add 0x6.$i id=drv$i,if=none,file=/tmp/resize$i.qcow2 | nc -U /tmp/a
> echo device_add virtio-blk-pci,id=dev$i,drive=drv$i,addr=0x6.$i,multifunction=on | nc -U /tmp/a
> done
>
> 3. script to add virio-nic devices:
> for i in `seq 1 7` 0;do
> echo netdev_add tap,id=drv$i | nc -U /tmp/a
> echo device_add virtio-net-pci,id=dev$i,netdev=drv$i,addr=0x6.$i,multifunction=on | nc -U /tmp/a
> done
>
> 4. current qemu behaviors
> 4.1. add func 1~7 one by one, then add func 0
> virtio-nic : success, all funcs are added
> virtio-blk : success
>
> 4.2. add func 0~7 one by one
> virtio-nic : failed, only func 0 is added
> virtio-blk : success
>
> 4.3. removing any single func in monitor
> virtio-nic: func 0 are not found in 'lspci', func 1~7 also exist. eth1~eth7 also exist.
> virtio-blk: func 0 are not found in 'lspci', func 1~7 also exist. the device. /dev/vda disappears,
>                vdb,vdc,vde,vdf,vdg,vdh,vdi,vdj also exist. If I re-add 8 funcs to guest, they all works.
>                # lspci (00:06.1 ~ 00:06.7 exist, 00:06.0 doesn't exit)
>                00:06.1 SCSI storage controller: Red Hat, Inc Virtio block device (rev ff)
>
> qemu sends an acpi event to guest, then guest will remove all funcs in the slot.
> linux-2.6/drivers/pci/hotplug/acpiphp_glue.c:
> static int disable_device(struct acpiphp_slot *slot) {
>      list_for_each_entry(func,&slot->funcs, sibling) {
>          ...

Hello all,

I re-tested the multifunction hotplug of winxp,rhel6,win7 guest. 
(upstream qemu-kvm)

For all the guests, func0 needs to be added, otherwise no func can be 
found in guest.
RHEL6 needs to add fun0 in the end, otherwise, the funcs added after 
hot-adding func0 could not be found in guest.
For winxp,win7, add func0 in any time, all the funcs can be found in guest.

This is the test result( hogplug order of funcs & funcs can be found in 
guest):
hotplug order   xp      win7    rhel6
------------    --      ----    -----
func 0~7        0~7     0~7     0~7
func 0~5        0~6     0~6     0~6
func 1~4,0,5    0~5     0~5     0~4
func 1~4        no      no      no

It looks like the 'problem' of linux guest, or could we accept to add 
func0 after adding other funcs for linux guest?

Thanks,
Amos

> Questions:
> 1. why func1~7 still can be found after hot-remove? is it same as real hardware?
> 2. why the func 1~7 could not be added to guest (addingfunc 0~7 one by one)?
> 3. how about this interface to hotplug/hot-unplug multifunction:
>     1) Add func 1-7 by monitor, add func 0, then send an acpi event to notice guest
>     2) Remove func0, send an acpi event to guest. (all funcs can be removed)
> 4. what does "reversion 0xff" stand for?
>
> Thanks in advance,
> Amos

  parent reply	other threads:[~2011-11-23  9:06 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1749303074.590739.1315551830460.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2011-09-09  7:08 ` About hotplug multifunction Amos Kong
2011-09-09  7:08   ` [Qemu-devel] " Amos Kong
2011-09-09  7:32   ` Michael S. Tsirkin
2011-09-09  7:32     ` [Qemu-devel] " Michael S. Tsirkin
2011-09-09 17:05     ` Alex Williamson
2011-09-09 17:05       ` [Qemu-devel] " Alex Williamson
2011-09-09 18:34       ` Marcelo Tosatti
2011-09-09 18:34         ` [Qemu-devel] " Marcelo Tosatti
2011-09-11  9:23         ` Michael S. Tsirkin
2011-09-11  9:23           ` [Qemu-devel] " Michael S. Tsirkin
2011-09-11 15:01           ` Marcelo Tosatti
2011-09-11 15:01             ` [Qemu-devel] " Marcelo Tosatti
2011-09-11 18:51             ` Michael S. Tsirkin
2011-09-11 18:51               ` [Qemu-devel] " Michael S. Tsirkin
2011-09-12 10:21               ` Marcelo Tosatti
2011-09-12 10:21                 ` [Qemu-devel] " Marcelo Tosatti
2011-09-12 10:56                 ` Marcelo Tosatti
2011-09-12 10:56                   ` [Qemu-devel] " Marcelo Tosatti
2011-09-12 12:24                   ` Michael S. Tsirkin
2011-09-12 12:24                     ` [Qemu-devel] " Michael S. Tsirkin
2011-09-13 12:23                     ` Amos Kong
2011-09-13 12:23                       ` [Qemu-devel] " Amos Kong
2011-09-13 14:24                       ` Amos Kong
2011-09-13 14:24                         ` [Qemu-devel] " Amos Kong
2011-09-09 17:43   ` Isaku Yamahata
2011-09-09 17:43     ` [Qemu-devel] " Isaku Yamahata
2011-09-11  9:05     ` Michael S. Tsirkin
2011-09-11  9:05       ` [Qemu-devel] " Michael S. Tsirkin
2011-09-13  5:57       ` Isaku Yamahata
2011-09-13  5:57         ` [Qemu-devel] " Isaku Yamahata
2011-09-13  6:52         ` Gleb Natapov
2011-09-13  6:52           ` Gleb Natapov
2011-09-13  7:00           ` Isaku Yamahata
2011-09-13  7:00             ` Isaku Yamahata
2011-09-13 10:00           ` Michael S. Tsirkin
2011-09-13 10:00             ` Michael S. Tsirkin
2011-09-13 10:05           ` Michael S. Tsirkin
2011-09-13 10:05             ` Michael S. Tsirkin
2011-09-13 10:05             ` Gleb Natapov
2011-09-13 10:05               ` Gleb Natapov
2011-11-23  9:06   ` Amos Kong [this message]
2011-11-23  9:06     ` Amos Kong

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=4ECCB795.8060107@redhat.com \
    --to=akong@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.