Skip to content

Commit

Permalink
PPC: openpic_kvm: Filter memory events properly
Browse files Browse the repository at this point in the history
Commit 6f1834a 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>
  • Loading branch information
agraf authored and pm215 committed Apr 3, 2014
1 parent 784a559 commit 87d8354
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hw/intc/openpic_kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 87d8354

Please sign in to comment.