From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40340 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIW9y-00074U-9n for qemu-devel@nongnu.org; Sat, 29 May 2010 20:13:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OIW9x-0005mZ-7O for qemu-devel@nongnu.org; Sat, 29 May 2010 20:13:46 -0400 Received: from mail.codesourcery.com ([38.113.113.100]:55431) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIW9w-0005mC-Ua for qemu-devel@nongnu.org; Sat, 29 May 2010 20:13:45 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] Compile dma only once Date: Sun, 30 May 2010 01:13:08 +0100 References: <201005282034.21254.paul@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201005300113.08998.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org > On Fri, May 28, 2010 at 7:34 PM, Paul Brook wrote: > >> Use a qemu_irq to request CPU exit. > > > > Needing to request a CPU exit at all is just wrong. See previous > > discussions about how any use of qemu_bh_schedule_idle is fundamentally > > broken. > > I agree for the device case. Is the attached patch then OK? No. You can't remove code without understanding why it was there in the first place. I'm pretty sure this will break FDC emulation, or at least make it unfeasibly slow. The underlying problem is that devices (in particular the FDC) don't communicate properly with the DMA engine. Instead they rely on the DMA device polling state at poorly defined intervals. Removing DMA_schedule without removing qemu_bh_schedule_idle is almost certainly wrong. My main objection to you original patch is that it introduces a new API for something that is just plain wrong. At minimum it needs a comment documenting that this function should never be used for anything - It only exists because we're too lazy to fix legacy code. > But what about other uses (with the patch applied): I was just referring to device emulation. qemu_notify_event is also pretty bogus. It is a horrible hack to workaround deficiencies in the network API. Paul