aboutsummaryrefslogtreecommitdiff
path: root/hw/intc/openpic_kvm.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2014-04-02 11:41:58 +0200
committerPeter Maydell <peter.maydell@linaro.org>2014-04-03 12:43:17 +0100
commit87d8354de3560eb705bcee83142d775f703177a6 (patch)
tree63f6e02a545ab3956370d4e44a0f7c3f7dae8047 /hw/intc/openpic_kvm.c
parent784a5592c9e7721d9035a83570f09a286cf75284 (diff)
PPC: openpic_kvm: Filter memory events properly
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> Message-id: 1396431718-14908-1-git-send-email-agraf@suse.de Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/intc/openpic_kvm.c')
-rw-r--r--hw/intc/openpic_kvm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/intc/openpic_kvm.c b/hw/intc/openpic_kvm.c
index afa604d59b..6635407b8b 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)&reg_base;