Received: from eggs.gnu.org ([208.118.235.92]:60004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIFGe-0004Jz-Au for qemu-devel@nongnu.org; Wed, 20 Mar 2013 05:25:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIFGc-0007v8-V9 for qemu-devel@nongnu.org; Wed, 20 Mar 2013 05:25:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42761) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIFGc-0007uX-OG for qemu-devel@nongnu.org; Wed, 20 Mar 2013 05:25:06 -0400 From: Markus Armbruster References: <5d85837fd58683b7e13ac78d6d468af6e152a512.1363243596.git.hutao@cn.fujitsu.com> <514194E4.3040208@redhat.com> <20130314091919.GD11223@redhat.com> <51419BCF.8030003@redhat.com> Date: Wed, 20 Mar 2013 10:24:48 +0100 In-Reply-To: (Alexander Graf's message of "Thu, 14 Mar 2013 12:00:56 +0100") Message-ID: <87zjxyl8yn.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v14 3/4] introduce pvevent device to deal with panicked event List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Kevin Wolf , Peter Maydell , Andrew Jones , Anthony Liguori , Marcelo Tosatti , Gleb Natapov , Michael Tsirkin , Hu Tao , Juan Quintela , KAMEZAWA Hiroyuki , qemu-devel qemu-devel , Luiz Capitulino , Blue Swirl , Orit Wasserman , Alex Williamson , Sasha Levin , Stefan Hajnoczi , Jan Kiszka , Paolo Bonzini , Christian Borntraeger , Stefano Stabellini Alexander Graf writes: > On 14.03.2013, at 10:43, Paolo Bonzini wrote: > >> Il 14/03/2013 10:19, Gleb Natapov ha scritto: >>> On Thu, Mar 14, 2013 at 10:14:12AM +0100, Paolo Bonzini wrote: >>>> Il 14/03/2013 09:15, Hu Tao ha scritto: >>>>> pvevent device is used to send guest panic event from guest to qemu. >>>>> >>>>> When guest panic happens, pvevent device driver will write a event >>>>> number to IO port 0x505(which is the IO port occupied by pvevent device, >>>>> by default). On receiving the event, pvevent device will pause guest >>>>> cpu(s), and send a qmp event QEVENT_GUEST_PANICKED. >>>>> >>>>> TODO: make the IO port configurable >>>> >>>> The port is already configurable as far as the device is concerned; when >>>> you add the port to the PC boards you will have to wind up fw-cfg. >>> >>> Why not add fw-cfg when device is created (with -device for instance)? >> >> It depends on what we decide is the supported interface for the device: >> >> * it can be an ISA device; the interface is the I/O port and ACPI > > Is there any particular reason it's an ISA device with a PIO port, > rather than a platform / sysbus device with MMIO access? With the > latter, we could easily reuse the device on other platforms (ppc, arm) > and even the guest driver code for platforms that do ACPI (arm?). As Paolo and Gleb observed, this is the most natural way to do such a device on x86. Other systems may want different connectors, e.g. sysbus/MMIO. We already have devices coming in variants with different connectors, e.g. serial and fdc. They share core code just fine. Some boilerplate gets duplicated, but it's not horrible. There has been talk about modelling such things more nicely in QOM. Opportunity for a QOM expert to tell us more about it :) [...]