qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [Qemu-devel] [PULL 075/118] macio: handle non-block ATAPI


From: Alexander Graf
Subject: Re: [Qemu-ppc] [Qemu-devel] [PULL 075/118] macio: handle non-block ATAPI DMA transfers
Date: Tue, 24 Jun 2014 13:02:01 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0


On 24.06.14 12:53, BALATON Zoltan wrote:
On Mon, 23 Jun 2014, Mark Cave-Ayland wrote:
On 23/06/14 20:26, BALATON Zoltan wrote:

(add Kevin to CC)

I'm afraid as you're the only person that can boot MorphOS this far
then we need you to diagnose and suggest a suitable alternative by
comparing the before and after output. Since MacOS is already a
supported client then if no solution can be found then it is likely
that this patch will be reverted :(

So should I revert the patch for now? We're already in soft freeze.

Well let's see if Zoltan can make any headway with debugging over the next few days; if there's no progress by the weekend then sadly my recommendation would be to revert in time for -rc0 as this definitely causes intermittent boot failures in Darwin for me.

It would be nicer if it could be fixed instead of reverting. You could
help detangling the macio.c code for a start.

Just to clarify here: the macio/DBDMA code is quite complicated, but this is because this device has to work around to the fact that currently the DMA I/O routines currently need sector alignment whereas macio requires byte-level alignment. There has been quite a lot of work at the lower levels to support byte-level alignment (see Kevin's series at http://lists.gnu.org/archive/html/qemu-devel/2014-01/msg02163.html) but until we can specify transfers to byte granularity in the dma_bdrv_*() APIs then there isn't much we can do to clean up the macio.c code.

Kevin, are there any plans to bubble the byte-granularity block layer changes up to the dma_bdrv_*() APIs in the near future?

Please bear in mind that QEMU supports a large number of OSs, and there is already an enthusiastic group of people using Alex's OS X work (see emaculation for many examples) so introducing an intermittent fault on a supported OS is not an option here.

I should also re-emphasise that Alex/Andreas work on many different parts of QEMU, and my work is currently unsponsored so while we are all keen to improve QEMU to the point where it can emulate new OSs such as MorphOS, it's not the case that we can simply drop what we are doing at the time to focus on an issue that affects a single OS which is new and currently unsupported.

I also work unsponsored on this and not sure how long can I still find time for it. I've already spent much more with this than I originally planned as I'm doing it since end of this February already. So I'd like my work so far to get upstream so that if I have to finish it's not lost and others could use and build on it. If there's no chance that this can be achieved by 2.1 then you could revert this patch and get back to it in 2.2 but that would delay things by months again. My patches are on the list for quite some time so it's not like I'm asking you to work on this in the last minute and this bug was reported on May 4th. I appreciate your help so far very much and don't exepct this to be highest priority but I'd like to make some progress too.

Now I think it's fair to say that I've spent quite a few hours helping you and coming up with the original version of this patch, and I'm glad that you

Now doubt about that, thank you very much again.

are now seeing success with this. But what is important to us right now heading towards a release is that patches don't cause any regressions.

All I can say is that debugging this stuff isn't easy, particularly with MorphOS which has some rather unusual behaviours. But what we really need from you now over the next few days is for you to compare the debug output between the working and non-working cases and figure out if we can fix this in time for the 2.1 release. You have everything you need (including my acceptance test of booting both MorphOS and Darwin ISOs), so time to take a deep breath and begin what should be a challenging yet ultimately rewarding debugging process :)

I'm still working on finding a solution for the exception problems with OpenBIOS that prevent MorphOS from working and I failed to understand the whole working of macio, DBDMA and the whole block layer so far

That one's reasonably simple. On a real Mac, we have different chips implementing IDE and DMA.

Traditionally in a non-DMA system, you would have an IDE controller that has a small buffer. When you issue a command, that buffer would get filled and you can poke the IDE controller byte-by-byte to retrieve that buffer.

Then people realized that this doesn't perform too well, so they started implementing DMA controllers. The DBDMA controller does this task of poking the IDE controller for you. So instead of hogging the CPU with byte-by-byte transfers from the IDE controller, you now occupy the DMA controller with them, freeing the CPU to do other work.

The way DBDMA works is that you put in something similar to a scatter-gather list: A list of chunks to read / write and where in memory those chunks live. DBDMA then goes over its list and does the pokes. So for example if the list is

  [ memaddr = 0x12000 | len = 500 ]
  [ memaddr = 0x13098 | len = 12 ]

then it reads 500 bytes from IDE, writes them at memory offset 0x12000 and after that reads another 12 bytes from IDE and puts them at memory offset 0x13098.

The reason we have such complicated code for real DMA is that we can't model this easily with our direct block-to-memory API. That one can only work on a 512 byte granularity. So when we see unaligned accesses like above, we have to split them out and handle them lazily.


Alex




reply via email to

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