From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>,
Gerhard Wiesinger <lists@wiesinger.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH 2/2] memory: crack wide ioport accesses into smaller ones when needed
Date: Thu, 11 Aug 2011 10:40:26 +0300 [thread overview]
Message-ID: <1313048426-17273-3-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1313048426-17273-1-git-send-email-avi@redhat.com>
The memory API supports cracking wide accesses into narrower ones
when needed; but this was no implemented for the pio address space,
causing lsi53c895a's IO BAR to malfunction.
Fix by correctly cracking wide accesses when needed.
Signed-off-by: Avi Kivity <avi@redhat.com>
---
memory.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/memory.c b/memory.c
index 3c18e70..81032b6 100644
--- a/memory.c
+++ b/memory.c
@@ -400,7 +400,11 @@ static void memory_region_iorange_read(IORange *iorange,
}
return;
}
- *data = mr->ops->read(mr->opaque, offset, width);
+ *data = 0;
+ access_with_adjusted_size(offset, data, width,
+ mr->ops->impl.min_access_size,
+ mr->ops->impl.max_access_size,
+ memory_region_read_accessor, mr);
}
static void memory_region_iorange_write(IORange *iorange,
@@ -418,7 +422,10 @@ static void memory_region_iorange_write(IORange *iorange,
}
return;
}
- mr->ops->write(mr->opaque, offset, data, width);
+ access_with_adjusted_size(offset, &data, width,
+ mr->ops->impl.min_access_size,
+ mr->ops->impl.max_access_size,
+ memory_region_write_accessor, mr);
}
static const IORangeOps memory_region_iorange_ops = {
--
1.7.5.3
next prev parent reply other threads:[~2011-08-11 7:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-11 7:40 [Qemu-devel] [PATCH 0/2] Fix wide ioport access cracking Avi Kivity
2011-08-11 7:40 ` [Qemu-devel] [PATCH 1/2] memory: abstract cracking of write access ops into a function Avi Kivity
2011-08-11 7:40 ` Avi Kivity [this message]
2011-08-11 8:25 ` [Qemu-devel] [PATCH 0/2] Fix wide ioport access cracking Gerhard Wiesinger
2011-08-11 8:27 ` Avi Kivity
2011-08-11 8:29 ` Avi Kivity
2011-08-11 9:01 ` Gerhard Wiesinger
2011-08-11 9:44 ` Avi Kivity
2011-08-11 16:08 ` Gerhard Wiesinger
2011-08-11 16:20 ` Avi Kivity
2011-08-11 16:22 ` Avi Kivity
2011-08-11 19:01 ` Gerhard Wiesinger
2011-08-22 10:46 ` Avi Kivity
2011-08-11 16:11 ` Gerhard Wiesinger
2011-08-11 16:15 ` Avi Kivity
2011-08-22 14:42 ` Anthony Liguori
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=1313048426-17273-3-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=kvm@vger.kernel.org \
--cc=lists@wiesinger.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).