From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIbV8-0007ou-PV for qemu-devel@nongnu.org; Thu, 21 Mar 2013 05:09:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIbV4-0005yT-7h for qemu-devel@nongnu.org; Thu, 21 Mar 2013 05:09:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18369) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIbV3-0005yF-W4 for qemu-devel@nongnu.org; Thu, 21 Mar 2013 05:09:30 -0400 Message-ID: <514ACE2F.6050804@redhat.com> Date: Thu, 21 Mar 2013 10:09:03 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC][PATCH v15 6/6] pvpanic: pass configurable ioport to seabios List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao Cc: Peter Maydell , Gleb Natapov , "Michael S. Tsirkin" , Jan Kiszka , qemu-devel , Markus Armbruster , Blue Swirl , Orit Wasserman , Juan Quintela , Alexander Graf , Christian Borntraeger , Andrew Jones , Alex Williamson , Sasha Levin , Stefan Hajnoczi , Luiz Capitulino , KAMEZAWA Hiroyuki , Anthony Liguori , Marcelo Tosatti Il 21/03/2013 09:35, Hu Tao ha scritto: > This lets seabios patch the corresponding SSDT entry. > > Signed-off-by: Hu Tao > --- > hw/fw_cfg.h | 2 ++ > hw/pvpanic.c | 14 ++++++++++++++ > 2 files changed, 16 insertions(+) > > diff --git a/hw/fw_cfg.h b/hw/fw_cfg.h > index 05c8df1..07cc941 100644 > --- a/hw/fw_cfg.h > +++ b/hw/fw_cfg.h > @@ -1,6 +1,8 @@ > #ifndef FW_CFG_H > #define FW_CFG_H > > +#include "exec/hwaddr.h" > + > #define FW_CFG_SIGNATURE 0x00 > #define FW_CFG_ID 0x01 > #define FW_CFG_UUID 0x02 > diff --git a/hw/pvpanic.c b/hw/pvpanic.c > index ff0a116..94c3b25 100644 > --- a/hw/pvpanic.c > +++ b/hw/pvpanic.c > @@ -17,6 +17,8 @@ > #include > #include > #include > +#include "hw/fw_cfg.h" > +#include "hw/pc.h" > > /* The bit of supported pv event */ > #define PVPANIC_F_PANICKED 0 > @@ -83,6 +85,18 @@ static int pvpanic_isa_initfn(ISADevice *dev) > memory_region_init_io(&s->io, &pvpanic_ops, s, "pvpanic", 1); > isa_register_ioport(dev, &s->io, s->ioport); > > + if (fw_cfg_piix) { > + fw_cfg_add_file(fw_cfg_piix, "etc/pvpanic-port", > + g_memdup(&s->ioport, sizeof(s->ioport)), > + sizeof(s->ioport)); > + } > + > + if (fw_cfg_q35) { > + fw_cfg_add_file(fw_cfg_q35, "etc/pvpanic-port", > + g_memdup(&s->ioport, sizeof(s->ioport)), > + sizeof(s->ioport)); > + } > + > return 0; > } > You can get fw_cfg with this patch (untested): diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c index 63a1998..ac6f1a1 100644 --- a/hw/fw_cfg.c +++ b/hw/fw_cfg.c @@ -511,6 +511,8 @@ FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t data_port, s->machine_ready.notify = fw_cfg_machine_ready; qemu_add_machine_init_done_notifier(&s->machine_ready); + object_property_add_child(qdev_get_machine(), "fw_cfg", OBJECT(s), NULL); + return s; } and then void *fw_cfg = object_resolve_path("/machine/fw_cfg"); if (fw_cfg) { ... } Note that this must be done only once if you create more than 1 pvpanic device. Also, I would like machine types for 1.5 and newer to create pvpanic by default. Paolo