From patchwork Thu Mar 21 09:09:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 229595 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id ED2B62C007C for ; Thu, 21 Mar 2013 20:15:14 +1100 (EST) Received: from localhost ([::1]:44235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIbaa-0006ca-Pq for incoming@patchwork.ozlabs.org; Thu, 21 Mar 2013 05:15:12 -0400 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 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2L99Dld006894 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 21 Mar 2013 05:09:13 -0400 Received: from yakj.usersys.redhat.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2L993xb005467; Thu, 21 Mar 2013 05:09:04 -0400 Message-ID: <514ACE2F.6050804@redhat.com> Date: Thu, 21 Mar 2013 10:09:03 +0100 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Hu Tao References: In-Reply-To: X-Enigmail-Version: 1.5.1 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 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 Subject: Re: [Qemu-devel] [RFC][PATCH v15 6/6] pvpanic: pass configurable ioport to seabios X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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): 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 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; }