Compiling with CONFIG_AHCI disabled does indeed load the Option ROM and let me use the card. Everything works fine in the guest, but when the guest actually starts reading and writing to drives on the card it manages to bring the Xen host down. Probably not SeaBIOS's fault.
On Fri, Dec 8, 2017 at 7:48 AM, Kevin O'Connor kevin@koconnor.net wrote:
On Sun, Nov 26, 2017 at 06:28:01PM -0800, Adam Novak wrote:
I've installed a SI-PEX40064 SATA controller card http://www.sybausa.com/index.php?route=product/product&product_id=156 in my system that I am trying to use with PCI passthrough via Xen, in order to give a guest VM its own real SATA controller so as to not have to deal with virtual disks. Moreover, I want to boot off of a disk attached to the card.
The card implements (or pretends to implement) AHCI, so SeaBIOS starts up and can see the attached disk. But SeaBIOS gets a timeout communicating with the disk:
|eff9d000| WARNING - Timeout at ahci_port_setup:469! |eff9d000| AHCI/2: device not ready (tf 0x58)
The card has a PCI Option ROM, and I think the Option ROM needs to be loaded for the card to work and/or be bootable. But SeaBIOS refuses to load the Option ROM. (My real physical system with Asus EFI firmware and CSM enabled does load the Option ROM for the card when it is installed.) I dug into the code, and it looks like it's the same issue as is mentioned here:
https://mail.coreboot.org/pipermail/seabios/2017-June/011425.html
Basically, a device is not checked for an option ROM (or an fw_fcg/CBFS-based Option ROM file), and its option ROM is not loaded, if pci->have_driver is set for the device. That field gets set for anything that apparently implements AHCI, so the Option ROMs for AHCI controllers are skipped, even if they are useful. Removing that check causes the option ROM for my card to be loaded, and allows the bootloader stored on the disk attached to the card to start up.
That check is there because it would not be correct for both an option rom and a native driver to simultaneously attempt to register the same drive. Basically, there can be only one driver for a PCI card - either a native SeaBIOS one or an Option ROM.
What happens if you compile SeaBIOS with CONFIG_AHCI disabled?
-Kevin