> On Fri, May 28, 2010 at 7:34 PM, Paul Brook <p...@codesourcery.com> 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