qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [Bug 1608802] [NEW] READ_DMA (0xC8) comman


From: Benjamin David Lunt
Subject: Re: [Qemu-block] [Qemu-devel] [Bug 1608802] [NEW] READ_DMA (0xC8) command does not work correctly
Date: Tue, 2 Aug 2016 11:09:24 -0700

----- Original Message -----
Am 02.08.2016 um 08:52 hat Stefan Weil geschrieben:
Am 02.08.2016 um 08:11 schrieb Stefan Weil:
> Public bug reported:
>
> The QEMU PC emulation of DMA does not behave like real hardware or other
> virtualization software.
>
> >From the original bug report (Benjamin David Lunt):
>
>     Back to the READ_DMA command, it is my conclusion that the
>     READ_DMA command, more precisely, the BUS Master part of QEMU is
>     in error.  The tests that people have done to see if it works, is
>     probably the guest finding out that DMA doesn't work and defaulting
>     to PIO, but since the read was successful visually to the user, the
>     user assumed the READ_DMA command works, where the guest actually
>     defaulted back to PIO transfers without notice.
>
>     My code works on real hardware (numerous machines), Bochs, and Oracle's
>     Virtual Box.
>
>     ...
>
>     I have a small test suite, zipped and included at:
>     www.fysnet.net/temp/c8bug.zip
>
>     Within this zip file is a.img. This is a freeDOS bootable
>     floppy.  Emulate it with QEMU and then at the DOS prompt, run
>     c8bug.exe.

Hi John,

I got this bug report only recently from a Windows user,
but it also occurs on Linux.

As I don't know whether this is a regression or whether
it is relevant for QEMU 2.7, it would be good if you and
maybe more people could have a look on that problem,
too.

I don't think it's a regression. I commented with more detail in the bug
report, and despite the test case being buggy it seems to be true that
qemu doesn't get the flags completely right (we should set either BSY or
DRQ, but we do set both). Apparently none of the common drivers check
for this, though, so it never made any difference.

Kevin

I agree that the controller is either BSY && !DRQ or !BSY && DRQ.
This is explained in section 9.7 of ATAPI v6, Page 354 (doc page 340).

My test was to simply show that the status remains 0xD8.
BSY *and* DRQ always set.

If a patch is made to make QEMU either BSY && !DRQ or !BSY && DRQ
after the DMA command, then I believe it will be correct.

I would guess that the common drivers, as you put it, don't check
for the status at all, but simply wait to see if an interrupt fires.

Thank you,
Ben




reply via email to

[Prev in Thread] Current Thread [Next in Thread]