From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwBh0-0003V0-UT for qemu-devel@nongnu.org; Wed, 03 Dec 2014 10:18:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwBgu-0005V6-PA for qemu-devel@nongnu.org; Wed, 03 Dec 2014 10:18:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwBgu-0005Uz-I2 for qemu-devel@nongnu.org; Wed, 03 Dec 2014 10:18:08 -0500 Message-ID: <547F29AB.7020806@redhat.com> Date: Wed, 03 Dec 2014 16:18:03 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <5437C7C1.2010106@redhat.com> <1412942996-29645-1-git-send-email-jslaby@suse.cz> <543BCCFC.6050904@redhat.com> <547F2824.7080001@suse.cz> In-Reply-To: <547F2824.7080001@suse.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/1] pci-host: add educational driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jiri Slaby , qemu-devel@nongnu.org On 03/12/2014 16:11, Jiri Slaby wrote: > On 10/13/2014, 03:00 PM, Paolo Bonzini wrote: >>> +static void edu_dma_timer(void *opaque) >>> +{ >>> + EduState *edu = opaque; >>> + bool raise_irq = false; >>> + >>> + qemu_mutex_lock(&edu->dma_mutex); >> >> dma_mutex and mutex and irq_mutex are not necessary. All I/O happens >> under the big QEMU lock (qemu_lock/unlock_iothread). I can certainly >> imagine that edu.c would be one of the first devices we make >> thread-safe, but... not yet. :) > > Hi, > > I finally got to it. I want to make sure that I understand this > correctly. So even timers are protected by the "BQL"? Everything, unless you create a separate thread. Paolo