From: Jan Kiszka <jan.kis...@siemens.com> Do not take the BQL before dispatching PIO requests of KVM VCPUs. Instead, call the unlocked version of address_space_rw. This enables completely BQL-free PIO handling in KVM mode for upcoming devices with fine-grained locking.
Signed-off-by: Jan Kiszka <jan.kis...@siemens.com> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- kvm-all.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 8da1deb..2848e5b 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1647,8 +1647,8 @@ static void kvm_handle_io(uint16_t port, void *data, int direction, int size, uint8_t *ptr = data; for (i = 0; i < count; i++) { - address_space_rw(&address_space_io, port, ptr, size, - direction == KVM_EXIT_IO_OUT); + address_space_rw_unlocked(&address_space_io, port, ptr, size, + direction == KVM_EXIT_IO_OUT); ptr += size; } } @@ -1804,13 +1804,11 @@ int kvm_cpu_exec(CPUState *cpu) switch (run->exit_reason) { case KVM_EXIT_IO: DPRINTF("handle_io\n"); - qemu_mutex_lock_iothread(); kvm_handle_io(run->io.port, (uint8_t *)run + run->io.data_offset, run->io.direction, run->io.size, run->io.count); - qemu_mutex_unlock_iothread(); ret = 0; break; case KVM_EXIT_MMIO: -- 2.3.0