All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Joerg Roedel <Joerg.Roedel@amd.com>,
	Paul Brook <paul@codesourcery.com>,
	Alexander Graf <agraf@suse.de>,
	QEMU-devel Developers <qemu-devel@nongnu.org>,
	Blue Swirl <blauwirbel@gmail.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	tj@kernel.org, Sebastian Herbszt <herbszt@gmx.de>,
	Roland Elek <elek.roland@gmail.com>
Subject: [Qemu-devel] Re: [PATCH 03/13] ide: Split out BMDMA code from ATA core
Date: Wed, 08 Dec 2010 15:46:50 +0100	[thread overview]
Message-ID: <4CFF9A5A.4040205@redhat.com> (raw)
In-Reply-To: <AANLkTikWmNqhsWwNtW2HY0sE+iNQfLE80ZwE1DUZTcCQ@mail.gmail.com>

Am 08.12.2010 15:40, schrieb Stefan Hajnoczi:
> On Wed, Dec 8, 2010 at 2:35 PM, Kevin Wolf <kwolf@redhat.com> wrote:
>> Am 08.12.2010 15:26, schrieb Stefan Hajnoczi:
>>> On Wed, Dec 8, 2010 at 12:13 PM, Alexander Graf <agraf@suse.de> 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

  reply	other threads:[~2010-12-08 14:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-08 12:13 [Qemu-devel] [PATCH 00/13] AHCI emulation support v8 Alexander Graf
2010-12-08 12:13 ` [Qemu-devel] [PATCH 01/13] ide: split ide command interpretation off Alexander Graf
2010-12-08 13:31   ` [Qemu-devel] " Stefan Hajnoczi
2010-12-08 12:13 ` [Qemu-devel] [PATCH 02/13] ide: fix whitespace gap in ide_exec_cmd Alexander Graf
2010-12-08 13:32   ` [Qemu-devel] " Stefan Hajnoczi
2010-12-08 14:59   ` Kevin Wolf
2010-12-08 12:13 ` [Qemu-devel] [PATCH 03/13] ide: Split out BMDMA code from ATA core Alexander Graf
2010-12-08 14:26   ` [Qemu-devel] " Stefan Hajnoczi
2010-12-08 14:32     ` Alexander Graf
2010-12-08 14:35     ` Kevin Wolf
2010-12-08 14:40       ` Stefan Hajnoczi
2010-12-08 14:46         ` Kevin Wolf [this message]
2010-12-09 12:31   ` Kevin Wolf
2010-12-08 12:13 ` [Qemu-devel] [PATCH 04/13] bmdma: split out irq setting Alexander Graf
2010-12-08 12:13 ` [Qemu-devel] [PATCH 05/13] bmdma: move header definitions out Alexander Graf
2010-12-08 12:13 ` [Qemu-devel] [PATCH 06/13] ide: add ncq identify data for ahci sata drives Alexander Graf
2010-12-08 12:13 ` [Qemu-devel] [PATCH 07/13] pci: add storage class for sata Alexander Graf
2010-12-08 12:13 ` [Qemu-devel] [PATCH 08/13] pci: add ich7 pci id Alexander Graf
2010-12-08 12:13 ` [Qemu-devel] [PATCH 09/13] ahci: add ahci emulation Alexander Graf
2010-12-08 21:14   ` [Qemu-devel] " Stefan Hajnoczi
2010-12-09 15:48     ` Alexander Graf
2010-12-09 15:53       ` Kevin Wolf
2010-12-09 16:18         ` Alexander Graf
2010-12-10  9:35           ` Kevin Wolf
2010-12-08 12:13 ` [Qemu-devel] [PATCH 10/13] config: move ide core and pci to pci.mak Alexander Graf
2010-12-08 12:13 ` [Qemu-devel] [PATCH 11/13] config: add ahci for pci capable machines Alexander Graf
2010-12-08 12:13 ` [Qemu-devel] [PATCH 12/13] ahci: set SATA Mode Select Alexander Graf
2010-12-08 12:13 ` [Qemu-devel] [PATCH 13/13] ahci: set pci revision id Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CFF9A5A.4040205@redhat.com \
    --to=kwolf@redhat.com \
    --cc=Joerg.Roedel@amd.com \
    --cc=agraf@suse.de \
    --cc=blauwirbel@gmail.com \
    --cc=elek.roland@gmail.com \
    --cc=herbszt@gmx.de \
    --cc=kraxel@redhat.com \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.