From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Subject: [PATCH v1] kvm: drop wrong assertion creating problems with pflash Date: Wed, 20 Sep 2017 16:50:25 +0200 Message-ID: <20170920145025.19403-1-david@redhat.com> Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , kvm@vger.kernel.org, david@redhat.com, Gerd Hoffmann To: qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56671 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751548AbdITOuf (ORCPT ); Wed, 20 Sep 2017 10:50:35 -0400 Sender: kvm-owner@vger.kernel.org List-ID: pflash toggles mr->romd_mode. So this assert does not always hold. 1) a device was added with !mr->romd_mode, therefore effectively not creating a kvm slot as we want to trap every access (add = false). 2) mr->romd_mode was toggled on before remove it. There is now actually no slot to remove and the asser is wrong. So let's just drop the assert. Reported-by: Gerd Hoffmann Signed-off-by: David Hildenbrand --- accel/kvm/kvm-all.c | 1 - 1 file changed, 1 deletion(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index b0181d7220..4f1997deec 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -722,7 +722,6 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, mem = kvm_lookup_matching_slot(kml, start_addr, size); if (!add) { if (!mem) { - g_assert(!memory_region_is_ram(mr) && !writeable && !mr->romd_mode); return; } if (mem->flags & KVM_MEM_LOG_DIRTY_PAGES) { -- 2.13.5