Skip to contentSkip to conversation

target-arm: kvm: use AddressSpace-specific listener

PATCH Applied Paolo Bonzini 2 participants 4 messages Sep 30, 2016 – Oct 17, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-arm: kvm: use AddressSpace-specific listener

The only address space where the GIC devices are added is address_space_memory. There is no need to use a global MemoryListener.

This removes the only user of global MemoryListeners.

---
 target-arm/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-arm/kvm.c +1 -1
index dbe393c..41f2038 100644
@@ -283,7 +283,7 @@ void kvm_arm_register_device(MemoryRegion *mr, uint64_t devid, uint64_t group,
     }
 
     if (QSLIST_EMPTY(&kvm_devices_head)) {
-        memory_listener_register(&devlistener, NULL);
+        memory_listener_register(&devlistener, &address_space_memory);
         qemu_add_machine_init_done_notifier(&notify);
     }
     kd = g_new0(KVMDevice, 1);
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Paolo Bonzini

The only address space where the GIC devices are added is address_space_memory. There is no need to use a global MemoryListener.

This removes the only user of global MemoryListeners.

---
 target-arm/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-arm/kvm.c +0 -0
index dbe393c..41f2038 100644

target-arm/kvm.c void kvm_arm_register_device(MemoryRegion *mr, uint64_t devid, uint64_t group, · line 289

Quoted 8 lines
target-arm/kvm.c +1 -1
@@ -283,7 +283,7 @@ void kvm_arm_register_device(MemoryRegion *mr, uint64_t devid, uint64_t group,
     }
 
     if (QSLIST_EMPTY(&kvm_devices_head)) {
-        memory_listener_register(&devlistener, NULL);
+        memory_listener_register(&devlistener, &address_space_memory);
         qemu_add_machine_init_done_notifier(&notify);
     }
     kd = g_new0(KVMDevice, 1);

The code effectively assumes there's only one address space the devices will live in anyway...

thanks
-- PMM

#2 lore raw
Quoted 28 lines · Peter Maydell
Quoted 16 lines · Paolo Bonzini

The only address space where the GIC devices are added is address_space_memory. There is no need to use a global MemoryListener.

This removes the only user of global MemoryListeners.

---
 target-arm/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-arm/kvm.c +0 -0
index dbe393c..41f2038 100644

target-arm/kvm.c void kvm_arm_register_device(MemoryRegion *mr, uint64_t devid, uint64_t group, · line 289

Quoted 8 lines
target-arm/kvm.c +1 -1
@@ -283,7 +283,7 @@ void kvm_arm_register_device(MemoryRegion *mr, uint64_t devid, uint64_t group,
     }
 
     if (QSLIST_EMPTY(&kvm_devices_head)) {
-        memory_listener_register(&devlistener, NULL);
+        memory_listener_register(&devlistener, &address_space_memory);
         qemu_add_machine_init_done_notifier(&notify);
     }
     kd = g_new0(KVMDevice, 1);
Quoted 2 lines

The code effectively assumes there's only one address space the devices will live in anyway...

Applied to target-arm.next, thanks.

-- PMM

#3 lore raw
In reply to Paolo Bonzini
Quoted 25 lines · Paolo Bonzini

The only address space where the GIC devices are added is address_space_memory. There is no need to use a global MemoryListener.

This removes the only user of global MemoryListeners.

---
 target-arm/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-arm/kvm.c +1 -2
index dbe393c..41f2038 100644
@@ -283,7 +283,7 @@ void kvm_arm_register_device(MemoryRegion *mr, uint64_t devid, uint64_t group,
     }
 
     if (QSLIST_EMPTY(&kvm_devices_head)) {
-        memory_listener_register(&devlistener, NULL);
+        memory_listener_register(&devlistener, &address_space_memory);
         qemu_add_machine_init_done_notifier(&notify);
     }
     kd = g_new0(KVMDevice, 1);
--
Quoted 1 line

2.7.4

Belatedly noticed this doesn't build on ARM hosts because there's no #include "exec/address-spaces.h". Will fix up in target-arm.next tree.

thanks
-- PMM