Received: from [140.186.70.92] (port=51517 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PADlE-0006cR-Pz for qemu-devel@nongnu.org; Sun, 24 Oct 2010 23:30:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PADl4-0006y1-Ct for qemu-devel@nongnu.org; Sun, 24 Oct 2010 23:30:12 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:50638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PADl3-0006wV-Qk for qemu-devel@nongnu.org; Sun, 24 Oct 2010 23:30:02 -0400 Date: Mon, 25 Oct 2010 12:29:57 +0900 From: Isaku Yamahata Subject: Re: [Qemu-devel] Re: [PATCH v6 07/12] pcie/hotplug: introduce pushing attention button command Message-ID: <20101025032957.GQ31309@valinux.co.jp> References: <2f5cb93039ab90a7b267334dd5e2e94b7a550b9f.1287562197.git.yamahata@valinux.co.jp> <20101020100011.GE10783@redhat.com> <20101022143849.GC23469@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101022143849.GC23469@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: skandasa@cisco.com, lmr@redhat.com, etmartin@cisco.com, wexu2@cisco.com, Markus Armbruster , qemu-devel@nongnu.org, kraxel@redhat.com 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. 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. - 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