From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Cc: scottwood@freescale.com, Peter Maydell <peter.maydell@linaro.org>,
prasadjoshi.linux@gmail.com, qemu-ppc@nongnu.org,
afaerber@suse.de
Subject: [Qemu-devel] [PATCH 2.0] PPC: openpic_kvm: Filter memory events properly
Date: Wed, 2 Apr 2014 11:41:58 +0200 [thread overview]
Message-ID: <1396431718-14908-1-git-send-email-agraf@suse.de> (raw)
Commit 6f1834a2b exposed a bug in openpic_kvm where we don't filter
for memory events that only happen to the region we want to know
events about.
Add proper filtering, fixing the e500plat target with KVM.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
hw/intc/openpic_kvm.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/intc/openpic_kvm.c b/hw/intc/openpic_kvm.c
index afa604d..6635407 100644
--- a/hw/intc/openpic_kvm.c
+++ b/hw/intc/openpic_kvm.c
@@ -118,6 +118,11 @@ static void kvm_openpic_region_add(MemoryListener *listener,
abort();
}
+ /* Ignore events on regions that are not us */
+ if (section->mr != &opp->mem) {
+ return;
+ }
+
reg_base = section->offset_within_address_space;
attr.group = KVM_DEV_MPIC_GRP_MISC;
@@ -140,6 +145,11 @@ static void kvm_openpic_region_del(MemoryListener *listener,
uint64_t reg_base = 0;
int ret;
+ /* Ignore events on regions that are not us */
+ if (section->mr != &opp->mem) {
+ return;
+ }
+
attr.group = KVM_DEV_MPIC_GRP_MISC;
attr.attr = KVM_DEV_MPIC_BASE_ADDR;
attr.addr = (uint64_t)(unsigned long)®_base;
--
1.8.1.4
next reply other threads:[~2014-04-02 9:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-02 9:41 Alexander Graf [this message]
2014-04-02 17:52 ` [Qemu-devel] [PATCH 2.0] PPC: openpic_kvm: Filter memory events properly Scott Wood
2014-04-03 11:59 ` Peter Maydell
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=1396431718-14908-1-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=afaerber@suse.de \
--cc=peter.maydell@linaro.org \
--cc=prasadjoshi.linux@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=scottwood@freescale.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 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).