From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amos Kong Subject: Re: [SeaBIOS PATCH v3] hotplug: Add device per func in ACPI DSDT tables Date: Mon, 19 Dec 2011 16:45:48 +0800 Message-ID: <4EEEF9BC.3040103@redhat.com> References: <20111206113601.GD6774@redhat.com> <96aa3930-4eea-4d27-bde4-d0432a340de9@zmail13.collab.prod.int.phx2.redhat.com> <20111214010645.GA2044@morn.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Michael S. Tsirkin" , seabios@seabios.org, kvm@vger.kernel.org, alex williamson , mtosatti@redhat.com, bhelgaas@google.com, kaneshige.kenji@jp.fujitsu.com To: "Kevin O'Connor" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:28606 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750930Ab1LSIiL (ORCPT ); Mon, 19 Dec 2011 03:38:11 -0500 In-Reply-To: <20111214010645.GA2044@morn.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On 14/12/11 09:06, Kevin O'Connor wrote: > On Tue, Dec 06, 2011 at 07:32:55PM -0500, Amos Kong wrote: >> ----- Original Message ----- >>> On Tue, Dec 06, 2011 at 01:39:35PM +0800, Amos Kong wrote: >>>> Only func 0 is registered to guest driver (we can >>>> only found func 0 in slot->funcs list of driver), >>>> the other functions could not be cleaned when >>>> hot-removing the whole slot. This patch adds >>>> device per function in ACPI DSDT tables. >>>> Notify only when func0 is added and removed. >>>> >>>> Have tested with linux/winxp/win7, hot-adding/hot-remving, >>>> single/multiple function device, they are all fine(all >>>> added devices can be removed). >>>> >>> This includes some bits I wrote but this is not an ack >>> of the patch yet :) >>> >>> I find it surprising that this works: a function >>> has _EJ0 so would not guest expect that ejecting >>> a single one will only remove it, and not all functions? >> >> Removing single func is not supported by specific, and current code >> (qemu/kernel pci driver) process hot-remove with the whole slot. >> We could not hot-remove single func with/without this patch. >> >> Register _EJ0() for each func, then all the funcs will be record >> into the function list of the slot. > > Just as an update - it's not clear to me what this patch does, and it > seems like Michael had some concerns. > > Also, it doesn't seem right to hardcode the generation of that many > devices (248) in the AML code. Hi Kevin, When we hot-unplug a pci device, all functions in same slot should be unpluged in one time. Hot-plug/unpluging nics for winXp VM is fine(all funcs can be removed). But hot-unpluging nics of linux VM exists problem(only function 0 is removed), Because not all the functions are registered in slot->funcs list in guest kernel. What we can do to resolve this problem: 1. remove all the functions when hot-unplug one function in the slot http://marc.info/?l=kvm&m=131597620101566&w=2 [PATCH] pci: clean all funcs when hot-removing multifunc device 2. register all the functions to slot->funcs list, then we don't need to change guest pci driver. http://marc.info/?l=kvm&m=132314964618843&w=2 [SeaBIOS PATCH v3] hotplug: Add device per func in ACPI DSDT tables mst, any more comment? Thanks, Amos > So, unless there are further comments I'm going to hold off on this > patch. > > -Kevin > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html