Skip to contentSkip to conversation

kvm: drop wrong assertion creating problems with pflash

PATCH Applied David Hildenbrand 3 participants 3 messages Sep 20, 2017 – Sep 21, 2017 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm: drop wrong assertion creating problems with pflash

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.

---
 accel/kvm/kvm-all.c | 1 -
 1 file changed, 1 deletion(-)
accel/kvm/kvm-all.c +0 -1
index b0181d7220..4f1997deec 100644
@@ -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) {
Signature · 1 line
2.13.5
Tested-by on v1 1/1
#1 lore raw
Quoted 8 lines · David Hildenbrand

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.

Works without any obvious bad side effects.

cheers,
Gerd

maintainer Applied
#2 lore raw
Quoted 8 lines · Gerd Hoffmann
Quoted 7 lines · David Hildenbrand

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.

Quoted 5 lines
Quoted 1 line

So let's just drop the assert.

Works without any obvious bad side effects.

Queued, thanks.

Paolo