From patchwork Thu Jul 2 08:20:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 490502 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8E55B14029E for ; Thu, 2 Jul 2015 18:22:03 +1000 (AEST) Received: from localhost ([::1]:35186 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAZkv-0004yy-EE for incoming@patchwork.ozlabs.org; Thu, 02 Jul 2015 04:22:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAZkD-0003km-DR for qemu-devel@nongnu.org; Thu, 02 Jul 2015 04:21:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAZk9-0003A3-ER for qemu-devel@nongnu.org; Thu, 02 Jul 2015 04:21:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAZk5-00038a-Ut for qemu-devel@nongnu.org; Thu, 02 Jul 2015 04:21:13 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id A1644B893D; Thu, 2 Jul 2015 08:21:09 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t628Kq9i005673; Thu, 2 Jul 2015 04:21:07 -0400 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 2 Jul 2015 10:20:49 +0200 Message-Id: <1435825251-674-8-git-send-email-pbonzini@redhat.com> In-Reply-To: <1435825251-674-1-git-send-email-pbonzini@redhat.com> References: <1435825251-674-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Jan Kiszka , famz@redhat.com Subject: [Qemu-devel] [PATCH 7/9] kvm: Switch to unlocked PIO X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka 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 Signed-off-by: Paolo Bonzini --- kvm-all.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index ca428ca..ad5ac5e 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1804,13 +1804,12 @@ int kvm_cpu_exec(CPUState *cpu) switch (run->exit_reason) { case KVM_EXIT_IO: DPRINTF("handle_io\n"); - qemu_mutex_lock_iothread(); + /* Called outside BQL */ kvm_handle_io(run->io.port, attrs, (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: