All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] SATA CD-ROM booting failure with latest OVMF
@ 2015-07-03 14:15 Hannes Reinecke
  2015-07-04  5:28 ` John Snow
  2015-07-08 22:53 ` John Snow
  0 siblings, 2 replies; 3+ messages in thread
From: Hannes Reinecke @ 2015-07-03 14:15 UTC (permalink / raw
  To: John Snow; +Cc: qemu-devel@nongnu.org, Alexander Graf

Hi all,

I've updated OVMF to use the SATA controller, so that I could
finally use the Q35 machine specification with OVMF.

However, upon doing so I found that the (SATA) CD-ROM wouldn't work
anymore; directories on the CD-ROM can be read, but the file listing
contained only garbage.

After some _very_ tedious debugging I've found this to be an issue
with the ahci driver in qemu; ATAPI PIO transfers seem to be
slightly buggy. Enabling 'atapi_dma' transfers in atapi driver (even
for PIO mode) makes everything work again.

I still fail to see _why_ this is be the case; the logfiles
in both cases are pretty identical. Originally I thought that
somehow the big qemu lock plays a role here, but OVMF accesses
the ahci HBA only ever _after_ all transfers are complete.
And again, access patterns are identical in both cases.

So if anyone has another idea here ...

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		               zSeries & Storage
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] SATA CD-ROM booting failure with latest OVMF
  2015-07-03 14:15 [Qemu-devel] SATA CD-ROM booting failure with latest OVMF Hannes Reinecke
@ 2015-07-04  5:28 ` John Snow
  2015-07-08 22:53 ` John Snow
  1 sibling, 0 replies; 3+ messages in thread
From: John Snow @ 2015-07-04  5:28 UTC (permalink / raw
  To: Hannes Reinecke; +Cc: qemu-devel@nongnu.org, Alexander Graf



On 07/03/2015 10:15 AM, Hannes Reinecke wrote:
> 
> After some _very_ tedious debugging I've found this to be an issue
> with the ahci driver in qemu; ATAPI PIO transfers seem to be
> slightly buggy. Enabling 'atapi_dma' transfers in atapi driver (even
> for PIO mode) makes everything work again.

PIO again! Alright, fun. Try a git bisect, except cheat and try before
and after 1cbdd96813474de4191b0b37b859a5460373093b -- That's my wild guess.

Will check it out Monday, otherwise.

Thanks,
--John

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] SATA CD-ROM booting failure with latest OVMF
  2015-07-03 14:15 [Qemu-devel] SATA CD-ROM booting failure with latest OVMF Hannes Reinecke
  2015-07-04  5:28 ` John Snow
@ 2015-07-08 22:53 ` John Snow
  1 sibling, 0 replies; 3+ messages in thread
From: John Snow @ 2015-07-08 22:53 UTC (permalink / raw
  To: Hannes Reinecke; +Cc: qemu-devel@nongnu.org, Alexander Graf



On 07/03/2015 10:15 AM, Hannes Reinecke wrote:
> Hi all,
> 
> I've updated OVMF to use the SATA controller, so that I could
> finally use the Q35 machine specification with OVMF.
> 
> However, upon doing so I found that the (SATA) CD-ROM wouldn't work
> anymore; directories on the CD-ROM can be read, but the file listing
> contained only garbage.
> 
> After some _very_ tedious debugging I've found this to be an issue
> with the ahci driver in qemu; ATAPI PIO transfers seem to be
> slightly buggy. Enabling 'atapi_dma' transfers in atapi driver (even
> for PIO mode) makes everything work again.
> 
> I still fail to see _why_ this is be the case; the logfiles
> in both cases are pretty identical. Originally I thought that
> somehow the big qemu lock plays a role here, but OVMF accesses
> the ahci HBA only ever _after_ all transfers are complete.
> And again, access patterns are identical in both cases.
> 
> So if anyone has another idea here ...
> 
> Cheers,
> 
> Hannes
> 

I wrote some quick and very hacky CDROM tests to help suss this out, and
the problem is that PIO transfers that go through the ATAPI layer don't
increment the sglist offset variable that AHCI uses. (s->io_buffer_offset.)

Instead of trying to increment it everywhere (like I was trying to do
previously) I figured I could consolidate it back in ahci_commit_buf.

Pro: All DMA, including DMA masquerading as PIO, now works.
Cons: It only works for AHCI, but nobody else apparently uses or cares
about io_buffer_offset.

If I make all of the PIO hooks in AHCI call back to to core.c's
dma_commit_buf I can probably route all DMA (and fake PIO style DMA) for
all HBAs through dma_commit_buf and roll the pointer forward there.

Anyway, Here's the branch with some fixes in it:

https://github.com/jnsnow/qemu/commits/ahci-sig-dev

I'll try to polish up the tests and the core fix before Friday so that
it's in a reviewable state and propose it for inclusion for 2.4 RC1.


Thanks for the report,
--js


PS: The signature fix for OVMF you wrote is now in master, too. Anything
else? :D

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-08 22:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-03 14:15 [Qemu-devel] SATA CD-ROM booting failure with latest OVMF Hannes Reinecke
2015-07-04  5:28 ` John Snow
2015-07-08 22:53 ` John Snow

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.