ahci: fix FIS I bit and PIO Setup FIS interrupt
commitae79c2db150e17757ee1be080481be675a15ccea
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 25 Jun 2018 20:50:48 +0000 (25 16:50 -0400)
committerJohn Snow <jsnow@redhat.com>
Mon, 25 Jun 2018 20:50:48 +0000 (25 16:50 -0400)
treee97e97af5a2e41126a88e51aff3b4a882b3b12df
parent35e238c9330669882487f9929e0aa97900431853
ahci: fix FIS I bit and PIO Setup FIS interrupt

The "I" bit in PIO Setup and D2H FISes is exclusively a device concept
and the irqstatus register in the controller does not matter.  The SATA
spec says when it should be one; for D2H FISes in practice it is always
set, while the PIO Setup FIS has several subcases that are documented in
the patch.

Also, the PIO Setup FIS interrupt is actually generated _after_ data
has been received.

Someone should probably spend some time reading the SATA specification and
figuring out the more obscure fields in the PIO Setup FIS, but this is enough
to fix SeaBIOS booting from ATAPI CD-ROMs over an AHCI controller.

Fixes: 956556e131e35f387ac482ad7b41151576fef057
Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 20180622165159.19863-1-pbonzini@redhat.com
[Minor edit to avoid ATAPI comment ambiguity. --js]
Signed-off-by: John Snow <jsnow@redhat.com>
hw/ide/ahci.c
hw/ide/ahci_internal.h
tests/libqos/ahci.c
tests/libqos/ahci.h