From: Avi Kivity <avi@redhat.com>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: Blue Swirl <blauwirbel@gmail.com>,
Peter Maydell <peter.maydell@linaro.org>,
qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] gt64xxx: fix crash in gt64120_pci_mapping()
Date: Wed, 24 Aug 2011 22:09:41 +0300 [thread overview]
Message-ID: <1314212981-30211-1-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <20110824183949.GC17167@zapo>
The map/unmap code was assymetric - unmap used the local MemoryRegion while
map used isa_mmio_init(), which cannot handle dynamic mappings.
Fix by using isa_mmio_setup() and the local MemoryRegion.
Signed-off-by: Avi Kivity <avi@redhat.com>
---
Untested.
hw/gt64xxx.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/hw/gt64xxx.c b/hw/gt64xxx.c
index 6af9782..1c34253 100644
--- a/hw/gt64xxx.c
+++ b/hw/gt64xxx.c
@@ -297,7 +297,11 @@ static void gt64120_pci_mapping(GT64120State *s)
s->PCI0IO_start = s->regs[GT_PCI0IOLD] << 21;
s->PCI0IO_length = ((s->regs[GT_PCI0IOHD] + 1) - (s->regs[GT_PCI0IOLD] & 0x7f)) << 21;
isa_mem_base = s->PCI0IO_start;
- isa_mmio_init(s->PCI0IO_start, s->PCI0IO_length);
+ if (s->PCI0IO_length) {
+ isa_mmio_setup(&s->PCI0IO_mem, s->PCI0IO_length);
+ memory_region_add_subregion(get_system_memory(), s->PCI0IO_start,
+ &s->PCI0IO_mem);
+ }
}
}
--
1.7.5.3
next prev parent reply other threads:[~2011-08-24 19:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-23 17:55 [Qemu-devel] PPC* and Sparc32 crash Blue Swirl
2011-08-23 17:59 ` Peter Maydell
2011-08-23 19:19 ` Edgar E. Iglesias
2011-08-24 17:49 ` Blue Swirl
2011-08-24 18:14 ` Edgar E. Iglesias
2011-08-24 18:16 ` Edgar E. Iglesias
2011-08-24 18:39 ` Edgar E. Iglesias
2011-08-24 19:09 ` Avi Kivity [this message]
2011-08-24 19:17 ` [Qemu-devel] [PATCH] gt64xxx: fix crash in gt64120_pci_mapping() Edgar E. Iglesias
2011-08-24 17:54 ` [Qemu-devel] PPC* and Sparc32 crash Blue Swirl
2011-08-24 18:05 ` Peter Maydell
2011-08-24 9:41 ` Avi Kivity
2011-08-24 17:48 ` Blue Swirl
2011-08-24 18:20 ` Avi Kivity
2011-08-24 18:40 ` [Qemu-devel] [PATCH] ppc_oldworld, ppc_newworld: fix escc BAR related crash Avi Kivity
2011-08-24 18:43 ` [Qemu-devel] PPC* and Sparc32 crash Avi Kivity
2011-08-24 19:43 ` Blue Swirl
2011-08-24 19:59 ` Avi Kivity
2011-08-24 20:02 ` Blue Swirl
2011-08-25 4:43 ` Avi Kivity
2011-08-25 17:33 ` Blue Swirl
2011-08-25 19:31 ` Avi Kivity
2011-08-25 20:17 ` Blue Swirl
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=1314212981-30211-1-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=peter.maydell@linaro.org \
--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).