All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Hu Tao <hutao@cn.fujitsu.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Gleb Natapov <gleb@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Markus Armbruster <armbru@redhat.com>,
	Blue Swirl <blauwirbel@gmail.com>,
	Orit Wasserman <owasserm@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	Alexander Graf <agraf@suse.de>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Andrew Jones <drjones@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Sasha Levin <levinsasha928@gmail.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [Qemu-devel] [RFC][PATCH v15 6/6] pvpanic: pass configurable ioport to seabios
Date: Thu, 21 Mar 2013 10:09:03 +0100	[thread overview]
Message-ID: <514ACE2F.6050804@redhat.com> (raw)
In-Reply-To: <b82059369efd5ba9bb2b2bed230c4d32e308cf7c.1363847790.git.hutao@cn.fujitsu.com>

Il 21/03/2013 09:35, Hu Tao ha scritto:
> This lets seabios patch the corresponding SSDT entry.
> 
> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
> ---
>  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 <monitor/monitor.h>
>  #include <sysemu/sysemu.h>
>  #include <sysemu/kvm.h>
> +#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

  reply	other threads:[~2013-03-21  9:09 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21  8:35 [Qemu-devel] [PATCH v15 0/6] Add pvpanic device to deal with guest panic event Hu Tao
2013-03-21  8:35 ` [Qemu-devel] [PATCH v15 1/6] add a new runstate: RUN_STATE_GUEST_PANICKED Hu Tao
2013-03-21  8:35 ` [Qemu-devel] [PATCH v15 2/6] add a new qevent: QEVENT_GUEST_PANICKED Hu Tao
2013-03-21  8:35 ` [Qemu-devel] [PATCH v15 3/6] introduce a new qom device to deal with panicked event Hu Tao
2013-03-21  8:35 ` [Qemu-devel] [PATCH v15 4/6] pvpanic: add document of pvpanic Hu Tao
2013-03-21  9:13   ` Paolo Bonzini
2013-03-22  7:15     ` Hu Tao
2013-03-26  3:03     ` [Qemu-devel] [PATCH v15.1 " Hu Tao
2013-03-26  9:21       ` Paolo Bonzini
2013-03-26 15:07       ` Eric Blake
2013-03-28  6:16         ` [Qemu-devel] [PATCH v15.2 " Hu Tao
2013-03-28 12:16           ` Eric Blake
2013-03-28 14:57             ` Paolo Bonzini
2013-03-29  7:15               ` Hu Tao
2013-03-29  7:12             ` Hu Tao
2013-03-22  1:59   ` [Qemu-devel] [PATCH v15 " Eric Blake
2013-03-22  7:15     ` Hu Tao
2013-03-21  8:35 ` [Qemu-devel] [RFC][PATCH v15 5/6] pc_piix, pc_q35: export fw_cfg Hu Tao
2013-03-21  8:35 ` [Qemu-devel] [RFC][PATCH v15 6/6] pvpanic: pass configurable ioport to seabios Hu Tao
2013-03-21  9:09   ` Paolo Bonzini [this message]
2013-03-21  9:08 ` [Qemu-devel] [PATCH v15 1/2] add pvpanic device driver Hu Tao
2013-03-21  9:08 ` [Qemu-devel] [PATCH v15 2/2] patch dsdt to use passed-in pvpanic ioport Hu Tao
2013-03-21  9:11   ` Paolo Bonzini
2013-03-21  9:17     ` Hu Tao
2013-03-22  7:48       ` Gleb Natapov
2013-03-26  1:59         ` Hu Tao
2013-03-26  7:03           ` Paolo Bonzini
2013-03-26  7:24             ` Hu Tao
2013-03-26  7:53               ` Paolo Bonzini
2013-03-26  8:52                 ` [Qemu-devel] [PATCH v15.1] Add pvpanic device driver Hu Tao
2013-03-26  9:08                   ` Paolo Bonzini
2013-03-26  9:14                     ` [Qemu-devel] [PATCH v15.1 resend] " Hu Tao
2013-03-21  9:54   ` [Qemu-devel] [PATCH v15 2/2] patch dsdt to use passed-in pvpanic ioport Michael S. Tsirkin
2013-03-22  7:25     ` Hu Tao
2013-03-21 22:54   ` [Qemu-devel] [SeaBIOS] " Kevin O'Connor
2013-03-22  7:23     ` Hu Tao
2013-03-21  9:13 ` [PATCH v15] pvpanic: pvpanic device driver Hu Tao
2013-03-21  9:13   ` [Qemu-devel] " Hu Tao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=514ACE2F.6050804@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=agraf@suse.de \
    --cc=alex.williamson@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=borntraeger@de.ibm.com \
    --cc=drjones@redhat.com \
    --cc=gleb@redhat.com \
    --cc=hutao@cn.fujitsu.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=lcapitulino@redhat.com \
    --cc=levinsasha928@gmail.com \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=owasserm@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.