From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38040 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PAEZj-0007GR-2V for qemu-devel@nongnu.org; Mon, 25 Oct 2010 00:22:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PAEZg-0006kN-Ob for qemu-devel@nongnu.org; Mon, 25 Oct 2010 00:22:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21628) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PAEZg-0006kJ-I2 for qemu-devel@nongnu.org; Mon, 25 Oct 2010 00:22:20 -0400 Date: Mon, 25 Oct 2010 06:15:37 +0200 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] Re: [PATCH v6 07/12] pcie/hotplug: introduce pushing attention button command Message-ID: <20101025041537.GB1491@redhat.com> References: <2f5cb93039ab90a7b267334dd5e2e94b7a550b9f.1287562197.git.yamahata@valinux.co.jp> <20101020100011.GE10783@redhat.com> <20101022143849.GC23469@redhat.com> <20101025032957.GQ31309@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101025032957.GQ31309@valinux.co.jp> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: skandasa@cisco.com, lmr@redhat.com, etmartin@cisco.com, wexu2@cisco.com, Markus Armbruster , qemu-devel@nongnu.org, kraxel@redhat.com On Mon, Oct 25, 2010 at 12:29:57PM +0900, Isaku Yamahata wrote: > On Fri, Oct 22, 2010 at 04:38:49PM +0200, Michael S. Tsirkin wrote: > > On Fri, Oct 22, 2010 at 01:35:47PM +0200, Markus Armbruster wrote: > > > "Michael S. Tsirkin" writes: > > > > > > > On Wed, Oct 20, 2010 at 05:18:56PM +0900, Isaku Yamahata wrote: > > > >> glue pcie_push_attention_button command. > > > >> > > > >> Signed-off-by: Isaku Yamahata > > > > > > > > So as a high level command, I think we need to > > > > think about how to tie this into pci_add/pci_del. > > > > Right? > > > [...] > > > > > > Do we have consensus how our set of commands for hot plug should look > > > like? We talked about it, but did we reach consensus? If yes, did we > > > write it down somewhere? > > > > I think for simple things yes: > > - command to send hotplug notification to the guest > > - command to immediately add/remove the device > > - event to notify about guest ack > > - way to poll status: did guest ack last command? > > I'm not sure about guest ack. Let me check my understanding. Your understanding is correct. > The current qemu pci hot plug has its own hot plug controler, > PIIX4_PM, which relies on ACPI. > > - command to add the device into the slot > This corresponds to physically inserting the device into the slot. > - qemu pci hot plug case: device_add/pci_add command. > The qemu pci hot plug controller, PIIX4_PM, detects the insertion, > then notify the guest OS of the event via ACPI, _L01. > The guest OS would start to probe the device. > > - pci express native hot plug case: device_add/pci_add command. > The pcie hot plug controller detects the the insertion, > then notify the guest OS of the event via interrupt. > The guest OS would start to probe the device. > > - command to remove the device from the slot > This corresponds to physically removing the device from the slot. > - qemu pci hot plug case: No corresponding command. > There is no way to remove the pci card forcibly from the slot. > > - pci express native hot plug case: device_del/pci_del > After the removal of the card, the hot plug controller notifies > the guest OS via interrupt. > > - command to send hotplug notification to the guest > command to push attention button. > This corresponds to pushing the button near the slot. > - qemu pci hot plug case: device_del/pci_del command > Maybe the button is called an eject button. > When the button is pushed, the hot plug controller notifies > the guest OS via ACPI, _L01. > Then, guest OS reacts the event by calling ACPI \_SB.PCI0.S._EJ0 > method. It program the hot plug controller to eject the device > in the given slot. As a result, the device is removed from the slot. > If the guest OS doesn't call _EJ0 (nor programs the controller directly), > the device stays there. > There is no way to remove the pci card without the guest OS > intervention. > > - pci express native hot plug case: > pcie_push_attention_button command with my patch series. > The hot plug controller raise the interrupt to the guest OS. > There is no specified action from the OS. Right. So what is suggested is that we have A. a single command to push the attention button B. a single command to remove pci card without guest OS interaction C. a way to interact with the guest management tools or human monitor will be able to tie A,B,C together in various interesting ways What I am also saying is that the same command should be able to work for pci and express I think. > - a way to get the slot status > new command for QMP/HMP? or enhance info pci? > > - QMP event for qemu to notify the slot status change > e.g. when LED status is changed, qmp event will be sent. > > > Existing ones will keep function: > > - send notification and when acked remove device > > - add device and send notification > > These are useful for human monitor but maybe not > > for management. > > > > > > -- > > MST > > > > -- > yamahata