Received: from eggs.gnu.org ([2001:4830:134:3::10]:60042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYDvK-0003kZ-Db for qemu-devel@nongnu.org; Wed, 18 Mar 2015 09:22:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYDvE-0003do-KC for qemu-devel@nongnu.org; Wed, 18 Mar 2015 09:22:14 -0400 Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]:34961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYDvE-0003db-6L for qemu-devel@nongnu.org; Wed, 18 Mar 2015 09:22:08 -0400 Received: by webcq43 with SMTP id cq43so32206057web.2 for ; Wed, 18 Mar 2015 06:22:07 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 18 Mar 2015 14:21:46 +0100 Message-Id: <1426684909-95030-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1426684909-95030-1-git-send-email-pbonzini@redhat.com> References: <1426684909-95030-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 5/8] kvm: Switch to unlocked PIO List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jan Kiszka From: Jan Kiszka 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 Signed-off-by: Paolo Bonzini --- 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