Received: from [140.186.70.92] (port=47928 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQLHO-0005kl-0W for qemu-devel@nongnu.org; Wed, 08 Dec 2010 09:46:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQLHM-0000aE-UF for qemu-devel@nongnu.org; Wed, 08 Dec 2010 09:46:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQLHM-0000a5-Jx for qemu-devel@nongnu.org; Wed, 08 Dec 2010 09:46:00 -0500 Message-ID: <4CFF9A5A.4040205@redhat.com> Date: Wed, 08 Dec 2010 15:46:50 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1291810400-11309-1-git-send-email-agraf@suse.de> <1291810400-11309-4-git-send-email-agraf@suse.de> <4CFF97BF.4090901@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 03/13] ide: Split out BMDMA code from ATA core List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Joerg Roedel , Paul Brook , Alexander Graf , QEMU-devel Developers , Blue Swirl , Gerd Hoffmann , tj@kernel.org, Sebastian Herbszt , Roland Elek Am 08.12.2010 15:40, schrieb Stefan Hajnoczi: > On Wed, Dec 8, 2010 at 2:35 PM, Kevin Wolf wrote: >> Am 08.12.2010 15:26, schrieb Stefan Hajnoczi: >>> On Wed, Dec 8, 2010 at 12:13 PM, Alexander Graf wrote: >>>> @@ -486,8 +440,8 @@ void ide_dma_error(IDEState *s) >>>> ide_transfer_stop(s); >>>> s->error = ABRT_ERR; >>>> s->status = READY_STAT | ERR_STAT; >>>> - ide_dma_set_inactive(s->bus->bmdma); >>>> - s->bus->bmdma->status |= BM_STATUS_INT; >>>> + ide_set_inactive(s); >>>> + s->bus->dma.ops->set_status(s->bus->dma.opaque, BM_STATUS_INT); >>> >>> Is BM_STATUS_INT constant naming appropriate for a general DMA >>> abstraction? Perhaps DMA_STATUS_INT. >> >> BM_STATUS_INT is a bit in the status register of busmaster IDE. So in >> theory it shouldn't appear in generic ATA code, but I'm not sure how >> much of this we can fix at this point. >> >>> Instead of fleshing out these functions, how about initializing >>> dma.ops to NULL? The program crashes should anyone try to do DMA >>> before setting a real IDEDMAOps pointer. That's not as robust as >>> limping along with non-working IDE, but should be straightforward to >>> debug if it ever happens. It also requires less code. >> >> Allowing the guest to crash qemu is not an option. We'd have to check >> for NULL in all commands that initiate a DMA transfer. > > You're right, I wasn't aware that the ops gets a chance to execute > before we initialize them to BMDMA. For example with ISA we never intialize it at all. Kevin