From owner-freebsd-current@FreeBSD.ORG Sun Sep 4 07:32:05 2011 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F7A31065674; Sun, 4 Sep 2011 07:32:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4BB7F8FC14; Sun, 4 Sep 2011 07:32:04 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA09612; Sun, 04 Sep 2011 10:32:03 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1R07BS-000LQD-OK; Sun, 04 Sep 2011 10:32:02 +0300 Message-ID: <4E632972.7080409@FreeBSD.org> Date: Sun, 04 Sep 2011 10:32:02 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0.1) Gecko/20110901 Thunderbird/6.0.1 MIME-Version: 1.0 To: FreeBSD-Current X-Enigmail-Version: undefined Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit Cc: Alexander Motin Subject: ahci doesn't work with qemu emulation X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Sep 2011 07:32:05 -0000 >From dmesg: [snip] ahci0: 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: at channel 0 on ahci0 ahcich0: Caps: ahcich1: at channel 1 on ahci0 ahcich1: Caps: ahcich2: at channel 2 on ahci0 ahcich2: Caps: ahcich3: at channel 3 on ahci0 ahcich3: Caps: ahcich4: at channel 4 on ahci0 ahcich4: Caps: ahcich5: 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