diff mbox

Re: [PATCH 00/12] AHCI emulation support v4

Message ID 4CF7786F.4060501@redhat.com
State New
Headers show

Commit Message

Gerd Hoffmann Dec. 2, 2010, 10:43 a.m. UTC
On 12/02/10 00:29, Alexander Graf wrote:
>
> On 24.11.2010, at 12:44, Gerd Hoffmann wrote:
>
>> On 11/23/10 15:34, Alexander Graf wrote:
>>> This patch adds support for AHCI emulation. I have tested and verified it works
>>> in Linux, OpenBSD, Windows Vista and Windows 7.
>>
>> Also seabios ;)
>> http://cgit.freedesktop.org/~kraxel/seabios/log/?h=ahci
>
> I broke that one with v7 of the ahci patchset apparently. Sorry about that :). Since Linux and Windows still happily boot, it's probably something missing on your side :(.

No.  DMA is broken (probably non-ncq only).

Commit c29947bbb0978d312074ec73be968bfab1b6c977 broke your way of 
kicking dma.

/me papered over it with the attached patch.  The RightWay[tm] to fix it 
is probably to put a "bmdma_cmd_writeb(bm, 0, 0)" to the approximate 
place.  Or refactor ide dma in a way that you don't need to kick it in 
such a hackish way in the first place.

cheers,
   Gerd

Comments

Alexander Graf Dec. 2, 2010, 10:48 a.m. UTC | #1
On 02.12.2010, at 11:43, Gerd Hoffmann wrote:

> On 12/02/10 00:29, Alexander Graf wrote:
>> 
>> On 24.11.2010, at 12:44, Gerd Hoffmann wrote:
>> 
>>> On 11/23/10 15:34, Alexander Graf wrote:
>>>> This patch adds support for AHCI emulation. I have tested and verified it works
>>>> in Linux, OpenBSD, Windows Vista and Windows 7.
>>> 
>>> Also seabios ;)
>>> http://cgit.freedesktop.org/~kraxel/seabios/log/?h=ahci
>> 
>> I broke that one with v7 of the ahci patchset apparently. Sorry about that :). Since Linux and Windows still happily boot, it's probably something missing on your side :(.
> 
> No.  DMA is broken (probably non-ncq only).
> 
> Commit c29947bbb0978d312074ec73be968bfab1b6c977 broke your way of kicking dma.
> 
> /me papered over it with the attached patch.  The RightWay[tm] to fix it is probably to put a "bmdma_cmd_writeb(bm, 0, 0)" to the approximate place.  Or refactor ide dma in a way that you don't need to kick it in such a hackish way in the first place.

Ugh. Thanks for digging through that. I agree, the way DMA is handled atm is very bogus and not pretty at all. Maybe we should try to refactor it so dbdma can be used as well? Not sure how all of that works yet though.


Alex
diff mbox

Patch

diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 7a415db..a36a2ef 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1164,6 +1164,7 @@  static void ahci_dma_start(IDEState *s, BlockDriverCompletionFunc *dma_cb)
     bm->cur_addr = 0;
     bm->sector_num = ide_get_sector(s);
     bm->nsector = s->nsector;
+    bm->cmd = 0;
     bmdma_cmd_writeb(bm, 0, 1);
 }