All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amos Kong <akong@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: linux-pci@vger.kernel.org, seabios@seabios.org,
	qemu-devel@nongnu.org, jbarnes@virtuousgeek.org, rjw@sisk.pl,
	alex.williamson@redhat.com, kevin@koconnor.net, liuj97@gmail.com
Subject: Re: [Qemu-devel] [RESEND PATCH v3] hotplug: add device per func in ACPI DSDT tables
Date: Wed, 09 May 2012 17:53:52 +0800	[thread overview]
Message-ID: <4FAA3EB0.1040908@redhat.com> (raw)
In-Reply-To: <4FAA3205.4030300@redhat.com>

On 09/05/12 16:59, Amos Kong wrote:
> On 09/05/12 16:46, Michael S. Tsirkin wrote:
>> On Wed, May 09, 2012 at 03:24:52PM +0800, Amos Kong wrote:
>>> Boot up a Linux VM with 8 pci block devices which
>>> are the 8 functions in one pci slot.
>>> | # qemu-kvm ...
>>> | -drive file=images/u0,if=none,id=drv0,format=qcow2,cache=none \
>>> | -device virtio-blk-pci,drive=drv0,id=v0,multifunction=on,addr=0x03.0 \
>>> | ....
>>> | -drive file=images/u7,if=none,id=drv7,format=qcow2,cache=none \
>>> | -device virtio-blk-pci,drive=drv7,id=v7,multifunction=on,addr=0x03.7 \
>>>
>>> Check devices in guest.
>>> | vm)# ls /dev/vd*
>>> | vda vdb vdc vde vdf vdg vdh
>>> | vm)# lspci |grep block
>>> | 00:03.0 SCSI storage controller: Red Hat, Inc Virtio block device
>>> | ...
>>> | 00:03.7 SCSI storage controller: Red Hat, Inc Virtio block device
>>> |


Discussed with mst, NAK this patch by myself.

>>> Func1~7 still exist in guest after hot-removing the whole slot
>>> through qemu monitor.
>>> | vm)# lspci |grep block (00:03.0 disappeared)
>>> | 00:03.1 SCSI storage controller: Red Hat, Inc Virtio block device
>>> (rev ff)
>>> | ...
>>> | 00:03.7 SCSI storage controller: Red Hat, Inc Virtio block device


In this condition, ALL devices already removed, but the sysinfo
(/proc , /sys) of func1~7 are not cleaned, this is why we can
still see it in 'lspci' output.

And Windows hotplug works fine with current seabios. In thread [1],
Kenji Kaneshige and Bjorn Helgaas accept to fix this in linux pci driver.

So NAK this seabios patch by myself, I will update original pci patch in 
thread [1]
[PATCH] pci: clean all funcs when hot-removing multifunc device


[1] http://marc.info/?t=131597601700003&r=1&w=2

>>> (rev ff)
>>> | vm)# ls /dev/vd* (vda disappeared)
>>> | vdb vdc vde vdf vdg vdh
>>> | vm)# mkfs /dev/vdb
>>> | INFO: task mkfs.ext2:1784 blocked for more than 120 seconds. (task
>>> hung)
>>>
>>>
>>> Currently only func0 is defined in ACPI DSDT table
>>> of seabios, and only hot-adding func0 would cause
>>> a ACPI event for notification. Other funcs except
>>> func0 wouldn't be registered in linux pci driver.
>>> (we can only found func0 in slot->funcs list of
>>> pci driver).
>>
>> Isn't this what your patch 'PCI: Can continually add funcs after adding
>> func0' addresses?
>
> No.
>
> This patch fixes the problem that some funcs could not be removed.
> the question is sending ACPI event for all functions (in same slot)
> or only function 0.

One event is enough to remove all functions, the real problem is in
clean of linux pci driver.

> I found all funcs are defined in ACPI DSDT table in microsoft's example:
> http://www.microsoft.com/china/whdc/system/pnppwr/hotadd/hotplugpci.mspx#EUH
>
> Is it a useful attestation ?

-- 
			Amos.

  reply	other threads:[~2012-05-09  9:54 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-19  6:53 [SEABIOS PATCH 0/2] fix of hotplug multi-func device Amos Kong
2011-09-19  6:53 ` [SeaBIOS PATCH 1/2] Fix regression of commit 87b533bf Amos Kong
2011-09-19  7:27   ` [SeaBIOS PATCH 2/2] hotplug: Add device per func in ACPI DSDT tables Amos Kong
2011-09-19  9:57     ` [SeaBIOS] " Gleb Natapov
2011-09-19 10:02       ` Michael S. Tsirkin
2011-09-19 10:12         ` Gleb Natapov
2011-09-19 10:32           ` Gleb Natapov
2011-09-19 12:18             ` [SeaBIOS] " Michael S. Tsirkin
2011-09-19 16:27         ` Marcelo Tosatti
2011-09-19 19:08           ` Michael S. Tsirkin
2011-09-20 10:45             ` [SeaBIOS PATCH v2] " Amos Kong
2011-09-20 11:47               ` Marcelo Tosatti
2011-09-21  1:48               ` Kevin O'Connor
2011-09-21  5:39                 ` Amos Kong
2011-09-21 11:09                   ` Michael S. Tsirkin
2011-09-21 12:47                     ` Kevin O'Connor
2011-09-21 13:14                       ` Michael S. Tsirkin
2011-12-06  5:39                         ` [SeaBIOS PATCH v3] " Amos Kong
2011-12-06 11:36                           ` Michael S. Tsirkin
2011-12-07  0:32                             ` Amos Kong
2011-12-14  1:06                               ` Kevin O'Connor
2011-12-19  8:45                                 ` Amos Kong
2012-05-09  7:24                                 ` [RESEND PATCH v3] hotplug: add " Amos Kong
2012-05-09  7:24                                   ` [Qemu-devel] " Amos Kong
2012-05-09  7:35                                   ` Amos Kong
2012-05-09  8:46                                   ` Michael S. Tsirkin
2012-05-09  8:46                                     ` [Qemu-devel] " Michael S. Tsirkin
2012-05-09  8:59                                     ` Amos Kong
2012-05-09  9:53                                       ` Amos Kong [this message]
2012-05-09 13:47                                   ` Alex Williamson
2012-05-09 13:47                                     ` [Qemu-devel] " Alex Williamson
2012-05-09 16:08                                     ` Amos Kong
2012-05-10 16:50                                     ` Jiang Liu
2012-05-10 16:50                                       ` [Qemu-devel] " Jiang Liu
2012-05-10 17:03                                       ` Michael S. Tsirkin
2012-05-10 17:03                                         ` [Qemu-devel] " Michael S. Tsirkin
2012-05-10 17:17                                   ` Jiang Liu
2012-05-10 17:17                                     ` [Qemu-devel] " Jiang Liu
2012-05-10 17:42                                     ` Michael S. Tsirkin
2012-05-10 17:42                                       ` [Qemu-devel] " Michael S. Tsirkin
2012-05-10 17:46                                       ` Jiang Liu
2012-05-10 17:46                                         ` [Qemu-devel] " Jiang Liu
2012-05-10 23:40                                         ` Amos Kong
2012-05-10 23:40                                           ` Amos Kong
2012-05-11 10:14                                         ` [SeaBIOS] " Gleb Natapov
2012-05-11 10:14                                           ` [Qemu-devel] " Gleb Natapov
2012-05-11 15:44                                           ` Jiang Liu
2012-05-11 15:44                                             ` [Qemu-devel] " Jiang Liu
2012-05-11 17:04                                             ` Gleb Natapov
2012-05-11 17:04                                               ` [Qemu-devel] " Gleb Natapov
2011-09-20 10:44           ` [SeaBIOS PATCH] hotplug: Add " Amos Kong
2011-09-20 11:42             ` Marcelo Tosatti
2011-09-20  8:00   ` [SeaBIOS PATCH v2] Fix regression of commit 87b533bf Amos Kong
2011-09-20 23:52     ` Kevin O'Connor
     [not found] ` <20110919065347.22802.53640.stgit@t>
     [not found]   ` <20110919093644.GC4501@redhat.com>
2011-09-19  9:49     ` [SeaBIOS PATCH 2/2] hotplug: Add device per func in ACPI DSDT tables Michael S. Tsirkin
2011-09-19 10:04     ` 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=4FAA3EB0.1040908@redhat.com \
    --to=akong@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=kevin@koconnor.net \
    --cc=linux-pci@vger.kernel.org \
    --cc=liuj97@gmail.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjw@sisk.pl \
    --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.