(unknown charset) ahci doesn't work with qemu emulation

From: (unknown charset) Andriy Gapon <avg_at_FreeBSD.org>
Date: Sun, 04 Sep 2011 10:32:02 +0300
>From dmesg:
[snip]
ahci0: <Intel ICH9 AHCI SATA controller> mem 0xfebf1000-0xfebf1fff irq 11 at
device 4.0 on pci0
ahci0: attempting to allocate 1 MSI vectors (1 supported)
msi: routing MSI IRQ 256 to local APIC 0 vector 51
ahci0: using IRQ 256 for MSI
ahci0: AHCI v1.00 with 6 1.5Gbps ports, Port Multiplier not supported
ahci0: Caps: NCQ 1.5Gbps 32cmd 6ports
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich0: Caps:
ahcich1: <AHCI channel> at channel 1 on ahci0
ahcich1: Caps:
ahcich2: <AHCI channel> at channel 2 on ahci0
ahcich2: Caps:
ahcich3: <AHCI channel> at channel 3 on ahci0
ahcich3: Caps:
ahcich4: <AHCI channel> at channel 4 on ahci0
ahcich4: Caps:
ahcich5: <AHCI channel> at channel 5 on ahci0
ahcich5: Caps:
[snip]
ahcich0: AHCI reset...
ahcich0: SATA connect time=0us status=00000113
ahcich0: AHCI reset: device found
ahcich0: AHCI reset: device ready after 0ms
(aprobe0:ahcich0:0:0:0): SIGNATURE: 0000
ahcich1: AHCI reset...
ahcich1: SATA connect timeout time=10000us status=00000000
ahcich1: AHCI reset: device not found
uhub0: 3 ports with 3 removable, self powered
ahcich2: AHCI reset...
ahcich2: SATA connect timeout time=10000us status=00000000
ahcich2: AHCI reset: device not found
ahcich3: AHCI reset...
ahcich3: SATA connect timeout time=10000us status=00000000
ahcich3: AHCI reset: device not found
ahcich4: AHCI reset...
ahcich4: SATA connect timeout time=10000us status=00000000
ahcich4: AHCI reset: device not found
ahcich5: AHCI reset...
ahcich5: SATA connect timeout time=10000us status=00000000
ahcich5: AHCI reset: device not found
[snip]
[this takes a lot of time]
ahcich0: Timeout on slot 0 port 0
ahcich0: is 00000005 cs 00000000 ss 00000000 rs 00000001 tfd 50 serr 00000000
cmd 1000c017
ahcich0: AHCI reset...
ahcich0: SATA connect time=0us status=00000113
ahcich0: AHCI reset: device found
ahcich0: AHCI reset: device ready after 0ms
(aprobe0:ahcich0:0:0:0): ATA_IDENTIFY. ACB: ec 00 00 00 00 40 00 00 00 00 00 00
(aprobe0:ahcich0:0:0:0): CAM status: Command timeout
(aprobe0:ahcich0:0:0:0): SIGNATURE: 0000
run_interrupt_driven_hooks: still waiting after 60 seconds for xpt_config
ahcich0: Timeout on slot 0 port 0
ahcich0: is 00000005 cs 00000000 ss 00000000 rs 00000001 tfd 50 serr 00000000
cmd 1000c017
ahcich0: AHCI reset...
ahcich0: SATA connect time=0us status=00000113
ahcich0: AHCI reset: device found
ahcich0: AHCI reset: device ready after 0ms
(aprobe0:ahcich0:0:0:0): ATA_IDENTIFY. ACB: ec 00 00 00 00 40 00 00 00 00 00 00
(aprobe0:ahcich0:0:0:0): CAM status: Command timeout

I guess that this is a problem with the emulation - some unsupported command or
reliance on some specific behavior of a driver (e.g. a Linux driver), but still
would be nice to have it working for testing / experimentation purposes.

Example of how a disk behind an AHCI controller can be specified to qemu-devel:
qemu-system-x86_64 ... -drive id=disk,file=disk.img,if=none -device ahci,id=ahci
-device ide-drive,drive=disk,bus=ahci.0

Please note that SeaBIOS image that is distrbuted with qemu-devel doesn't
support booting from AHCI.  So either kernel should be on a different disk on an
emulated legacy controller or a newer SeaBIOS should be used.  I utilized the
latter approach:
- got sources via git,  instructions here http://www.seabios.org/Download
- built it with gmake
- the only porting change needed is s/elf_i386/elf_i386_fbsd/ in the makefile
- installed out/bio.bin to ${LOCALBASE}/share/qemu/seabios.bin for convenience
- used it with -bios seabios.bin option to qemu

-- 
Andriy Gapon
Received on Sun Sep 04 2011 - 05:32:05 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:17 UTC