From: Jan Kiszka <jan.kiszka@siemens.com>
To: Julien Grall <julien.grall@citrix.com>
Cc: Stefano.Stabellini@eu.citrix.com, qemu-devel@nongnu.org, avi@redhat.com
Subject: Re: [Qemu-devel] [PATCH V5 2/8] hw/acpi_piix4.c: replace register_ioport*
Date: Thu, 23 Aug 2012 20:01:18 +0200 [thread overview]
Message-ID: <50366FEE.70502@siemens.com> (raw)
In-Reply-To: <1fa099f2f1c404e8b562a2ad32a39a784c68be1c.1345549695.git.julien.grall@citrix.com>
On 2012-08-22 14:27, Julien Grall wrote:
> This patch replaces all register_ioport* with the new memory API. It permits
> to use the new Memory stuff like listener.
>
> Signed-off-by: Julien Grall <julien.grall@citrix.com>
> ---
> hw/acpi_piix4.c | 160 ++++++++++++++++++++++++++++++++++++++++++------------
> 1 files changed, 124 insertions(+), 36 deletions(-)
>
...
> @@ -198,8 +212,10 @@ static void pm_io_space_update(PIIX4PMState *s)
>
> /* XXX: need to improve memory and ioport allocation */
> PIIX4_DPRINTF("PM: mapping to 0x%x\n", pm_io_base);
> - iorange_init(&s->ioport, &pm_iorange_ops, pm_io_base, 64);
> - ioport_register(&s->ioport);
> +
> + memory_region_init_io(&s->pm_io, &pm_io_ops, s, "piix4-pm", 64);
> + memory_region_add_subregion(pci_address_space_io(&s->dev),
> + pm_io_base, &s->pm_io);
This was broken before, but now I'm worried a guest can even crash qemu
by updating an existing mapping. So you will have to
- initialize pm_io only once
- track the active address
- remove a registered region before registering a new one
Didn't look at the spec, but I bet that (config[0x80] & 1) == 0 means
disable this mapping. Should be fixed as well if that is true.
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2012-08-23 18:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 12:27 [Qemu-devel] [PATCH V5 0/8] memory: unifiy ioport registration Julien Grall
2012-08-22 12:27 ` [Qemu-devel] [PATCH V5 1/8] isa: add isa_address_space_io Julien Grall
2012-08-24 16:10 ` Andreas Färber
2012-08-28 15:42 ` Julien Grall
2012-08-28 17:08 ` Jan Kiszka
2012-08-22 12:27 ` [Qemu-devel] [PATCH V5 2/8] hw/acpi_piix4.c: replace register_ioport* Julien Grall
2012-08-23 18:01 ` Jan Kiszka [this message]
2012-08-26 9:10 ` Jan Kiszka
2012-08-26 9:36 ` Jan Kiszka
2012-08-22 12:27 ` [Qemu-devel] [PATCH V5 3/8] hw/cirrus_vga.c: " Julien Grall
2012-08-24 13:44 ` Jan Kiszka
2012-08-24 14:49 ` Julien Grall
2012-08-24 15:01 ` Jan Kiszka
2012-08-26 9:19 ` Jan Kiszka
2012-08-22 12:27 ` [Qemu-devel] [PATCH V5 4/8] hw/serial.c: " Julien Grall
2012-08-22 12:27 ` [Qemu-devel] [PATCH V5 5/8] hw/pc.c: " Julien Grall
2012-08-22 12:27 ` [Qemu-devel] [PATCH V5 6/8] hw/dma.c: " Julien Grall
2012-08-22 12:27 ` [Qemu-devel] [PATCH V5 7/8] hw/apm.c: " Julien Grall
2012-08-22 12:27 ` [Qemu-devel] [PATCH V5 8/8] smb: replace_register_ioport* Julien Grall
2012-08-24 16:19 ` Jan Kiszka
2012-08-23 18:06 ` [Qemu-devel] [PATCH V5 0/8] memory: unifiy ioport registration Jan Kiszka
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=50366FEE.70502@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=Stefano.Stabellini@eu.citrix.com \
--cc=avi@redhat.com \
--cc=julien.grall@citrix.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).