kvm: Switch to unlocked PIO

Do not take the BQL before dispatching PIO requests of KVM VCPUs.
Instead, address_space_rw will do it if necessary. This enables
completely BQL-free PIO handling in KVM mode for upcoming devices with
fine-grained locking.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1434646046-27150-8-git-send-email-pbonzini@redhat.com>
This commit is contained in:
Jan Kiszka 2015-06-18 18:47:24 +02:00 committed by Paolo Bonzini
parent 4b8523ee89
commit 80b7d2efb6

@ -1804,13 +1804,12 @@ int kvm_cpu_exec(CPUState *cpu)
switch (run->exit_reason) { switch (run->exit_reason) {
case KVM_EXIT_IO: case KVM_EXIT_IO:
DPRINTF("handle_io\n"); DPRINTF("handle_io\n");
qemu_mutex_lock_iothread(); /* Called outside BQL */
kvm_handle_io(run->io.port, attrs, kvm_handle_io(run->io.port, attrs,
(uint8_t *)run + run->io.data_offset, (uint8_t *)run + run->io.data_offset,
run->io.direction, run->io.direction,
run->io.size, run->io.size,
run->io.count); run->io.count);
qemu_mutex_unlock_iothread();
ret = 0; ret = 0;
break; break;
case KVM_EXIT_MMIO: case KVM_EXIT_MMIO: