Do not take the BQL before dispatching MMIO requests of KVM VCPUs. Instead, call the unlocked version of address_space_rw. This enables completely BQL-free MMIO handling in KVM mode for upcoming devices with fine-grained locking.
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- kvm-all.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 2848e5b..fa0cfed 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1813,12 +1813,11 @@ int kvm_cpu_exec(CPUState *cpu) break; case KVM_EXIT_MMIO: DPRINTF("handle_mmio\n"); - qemu_mutex_lock_iothread(); - cpu_physical_memory_rw(run->mmio.phys_addr, - run->mmio.data, - run->mmio.len, - run->mmio.is_write); - qemu_mutex_unlock_iothread(); + address_space_rw_unlocked(&address_space_memory, + run->mmio.phys_addr, + run->mmio.data, + run->mmio.len, + run->mmio.is_write); ret = 0; break; case KVM_EXIT_IRQ_WINDOW_OPEN: -- 2.3.0