On 26/05/14 09:32, Alexander Graf wrote:
The macio IDE controller has some pretty nasty magic in its
implementation to
allow for unaligned sector accesses. We used to handle these accesses
synchronously inside the IO callback handler.
However, the block infrastructure changed below our feet and now it's
impossible
to call a synchronous block read/write from the aio callback handler
of a
previous block access.
Work around that limitation by making the unaligned handling bits
also go
through our asynchronous handler.
This fixes booting Mac OS X for me.
Hmmm nasty. I've never had a problem booting my two Darwin test
images, but I've quickly tried the patch on my complete set of test
suite booting up to the installer and haven't seen any regressions yet.
Incidentally, whilst investigating Zoltan's bug with the ATAPI DMA I
looked into where we were with byte-aligned DMA, and with Kevin's
patches applied it's fairly close.
The underlying bdrv_*() functions now use the unaligned-aware
functions, and the DMA API takes a QEMUSGList as input which is good.
However, moving down between the layers we switch back to a
BlockDriverState before calling the unaligned functions so we lose the
SGList and switch to lba/count again.
It looks like most of it is there, it just needs a few tweaks to get
the SGList all the way down the unaligned functions. And I will
definitely be happy on the day we get to rip out all of the unaligned
code from macio :)