qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* FreeBSD 13.2 installer does not see AHCI devices on aarch64/sbsa-ref and x86-64/q35
@ 2023-09-26 11:23 Marcin Juszkiewicz
  2023-09-26 12:05 ` Niklas Cassel
  0 siblings, 1 reply; 8+ messages in thread
From: Marcin Juszkiewicz @ 2023-09-26 11:23 UTC (permalink / raw)
  To: QEMU Developers
  Cc: qemu-arm, Niklas Cassel, John Snow, qemu-block, Damien Le Moal,
	Leif Lindholm, Ard Biesheuvel

I work on SBSA Reference Platform (sbsa-ref) at Linaro. And yesterday I
wanted to check how non-Linux operating systems work on sbsa-ref machine.

One of them was FreeBSD 13.2 - the latest one. Fetched bootonly ISO
image [1] and booted system.

1. https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.2/FreeBSD-13.2-RELEASE-arm64-aarch64-bootonly.iso

QEMU command line arguments:

-drive if=ide,file=disks/FreeBSD-13.2-RELEASE-arm64-aarch64-bootonly.iso,media=cdrom
-machine sbsa-ref
-m 4096
-smp 2
-cpu neoverse-n1
-drive file=fat:rw:/home/marcin/devel/linaro/sbsa-qemu/sbsa-ref-status/disks/virtual/,format=raw
-drive format=raw,file=/home/marcin/devel/linaro/sbsa-qemu/sbsa-ref-status/disks/full-debian.hddimg
-watchdog-action none
-no-reboot
-monitor telnet::45454,server,nowait
-serial stdio
-device igb
-nographic
-drive if=pflash,file=SBSA_FLASH0.fd,format=raw
-drive if=pflash,file=SBSA_FLASH1.fd,format=raw


Firmware loaded FreeBSD loader, kernel booted but it does not see
any AHCI devices:

ahci0: <AHCI SATA controller> iomem 0x60100000-0x6010ffff irq 1 on acpi0
ahci0: AHCI v1.00 with 6 1.5Gbps ports, Port Multiplier not supported
ahci0: Caps: 64bit NCQ 1.5Gbps 32cmd 6ports
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich0: Caps:
[..]
ahcich0: AHCI reset...
ahcich0: SATA connect time=0us status=00000113
ahcich0: AHCI reset: device found
ahcich0: AHCI reset: device ready after 0ms
ahcich1: AHCI reset...
ahcich1: SATA connect time=0us status=00000113
ahcich1: AHCI reset: device found
ahcich1: AHCI reset: device ready after 0ms
ahcich2: AHCI reset...
ahcich2: SATA connect time=0us status=00000113
ahcich2: AHCI reset: device found
ahcich2: AHCI reset: device ready after 0ms
[..]
Trying to mount root from cd9660:/dev/iso9660/13_2_RELEASE_AARCH64_BO [ro]...
Root mount waiting for: CAM
[..]
Root mount waiting for: CAM
ahcich0: Poll timeout on slot 1 port 0
ahcich0: is 00000000 cs 00000002 ss 00000000 rs 00000002 tfd 170 serr 00000000 cmd 0000c017

And finally it gives up.


v8.1.1 was bad, v8.0.5 was bad so I did git bisecting.
Which gave me this commit:

commit 7bcd32128b227cee1fb39ff242d486ed9fff7648
Author: Niklas Cassel <niklas.cassel@wdc.com>
Date:   Fri Jun 9 16:08:40 2023 +0200

     hw/ide/ahci: simplify and document PxCI handling

     The AHCI spec states that:
     For NCQ, PxCI is cleared on command queued successfully.



I built x86_64-softmmu target and checked both "pc" and "q35"
machines.

./build/x86_64-softmmu/qemu-system-x86_64
-cdrom FreeBSD-13.2-RELEASE-amd64-bootonly.iso
-m 2048 -serial stdio  -monitor telnet::45454,server,nowait

PC target ("-M pc") booted fine. But Q35 ("-M q35") failed
similar way as aarch64/sbsa-ref did:

ahci0: <Intel ICH9 AHCI SATA controller> port 0xc060-0xc07f mem 0xfebd5000-0xfebd5fff irq 16 at device 31.2 on pci0
ahci0: attempting to allocate 1 MSI vectors (1 supported)
msi: routing MSI IRQ 26 to local APIC 0 vector 52
ahci0: using IRQ 26 for MSI
ahci0: AHCI v1.00 with 6 1.5Gbps ports, Port Multiplier not supported
ahci0: Caps: 64bit 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:
[..]
ahcich2: AHCI reset...
ahcich2: SATA connect time=0us status=00000113
ahcich2: AHCI reset: device found
ahcich2: AHCI reset: device ready after 0ms
[..]
Trying to mount root from cd9660:/dev/iso9660/13_2_RELEASE_AMD64_BO [ro]...
ahcich2: Poll timeout on slot 1 port 0
ahcich2: is 00000000 cs 00000002 ss 00000000 rs 00000002 tfd 170 serr 00000000 cmd 0000c017
(aprobe2:ahcich2:0:0:0): SOFT_RESET. ACB: 00 00 00 00 00 00 00 00 00 00 00 00
(aprobe2:ahcich2:0:0:0): CAM status: Command timeout
(aprobe2:ahcich2:0:0:0): Error 5, Retries exhausted
ahcich2: Poll timeout on slot 2 port 0
ahcich2: is 00000000 cs 00000006 ss 00000000 rs 00000004 tfd 170 serr 00000000 cmd 0000c017
(aprobe2:ahcich2:0:0:0): SOFT_RESET. ACB: 00 00 00 00 00 00 00 00 00 00 00 00
(aprobe2:ahcich2:0:0:0): CAM status: Command timeout
(aprobe2:ahcich2:0:0:0): Error 5, Retries exhausted
mountroot: waiting for device /dev/iso9660/13_2_RELEASE_AMD64_BO...
Mounting from cd9660:/dev/iso9660/13_2_RELEASE_AMD64_BO failed with error 19.

Same thing happens with current qemu HEAD:

commit 494a6a2cf7f775d2c20fd6df9601e30606cc2014
Merge: 29578f5757 b821109583
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date:   Mon Sep 25 10:10:30 2023 -0400

     Merge tag 'pull-request-2023-09-25' of https://gitlab.com/thuth/qemu into staging


Any ideas?


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

* Re: FreeBSD 13.2 installer does not see AHCI devices on aarch64/sbsa-ref and x86-64/q35
  2023-09-26 11:23 FreeBSD 13.2 installer does not see AHCI devices on aarch64/sbsa-ref and x86-64/q35 Marcin Juszkiewicz
@ 2023-09-26 12:05 ` Niklas Cassel
  2023-09-26 16:35   ` John Snow
  2023-10-03 17:11   ` Michael Tokarev
  0 siblings, 2 replies; 8+ messages in thread
From: Niklas Cassel @ 2023-09-26 12:05 UTC (permalink / raw)
  To: Marcin Juszkiewicz, QEMU Developers
  Cc: qemu-arm, John Snow, qemu-block, Damien Le Moal, Leif Lindholm,
	Ard Biesheuvel

[-- Attachment #1: Type: text/plain, Size: 4992 bytes --]

Hello Marcin,

I will have a look at this.


Kind regards,
Niklas



On 26 September 2023 13:23:46 CEST, Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> wrote:
>I work on SBSA Reference Platform (sbsa-ref) at Linaro. And yesterday I
>wanted to check how non-Linux operating systems work on sbsa-ref machine.
>
>One of them was FreeBSD 13.2 - the latest one. Fetched bootonly ISO
>image [1] and booted system.
>
>1. https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.2/FreeBSD-13.2-RELEASE-arm64-aarch64-bootonly.iso
>
>QEMU command line arguments:
>
>-drive if=ide,file=disks/FreeBSD-13.2-RELEASE-arm64-aarch64-bootonly.iso,media=cdrom
>-machine sbsa-ref
>-m 4096
>-smp 2
>-cpu neoverse-n1
>-drive file=fat:rw:/home/marcin/devel/linaro/sbsa-qemu/sbsa-ref-status/disks/virtual/,format=raw
>-drive format=raw,file=/home/marcin/devel/linaro/sbsa-qemu/sbsa-ref-status/disks/full-debian.hddimg
>-watchdog-action none
>-no-reboot
>-monitor telnet::45454,server,nowait
>-serial stdio
>-device igb
>-nographic
>-drive if=pflash,file=SBSA_FLASH0.fd,format=raw
>-drive if=pflash,file=SBSA_FLASH1.fd,format=raw
>
>
>Firmware loaded FreeBSD loader, kernel booted but it does not see
>any AHCI devices:
>
>ahci0: <AHCI SATA controller> iomem 0x60100000-0x6010ffff irq 1 on acpi0
>ahci0: AHCI v1.00 with 6 1.5Gbps ports, Port Multiplier not supported
>ahci0: Caps: 64bit NCQ 1.5Gbps 32cmd 6ports
>ahcich0: <AHCI channel> at channel 0 on ahci0
>ahcich0: Caps:
>[..]
>ahcich0: AHCI reset...
>ahcich0: SATA connect time=0us status=00000113
>ahcich0: AHCI reset: device found
>ahcich0: AHCI reset: device ready after 0ms
>ahcich1: AHCI reset...
>ahcich1: SATA connect time=0us status=00000113
>ahcich1: AHCI reset: device found
>ahcich1: AHCI reset: device ready after 0ms
>ahcich2: AHCI reset...
>ahcich2: SATA connect time=0us status=00000113
>ahcich2: AHCI reset: device found
>ahcich2: AHCI reset: device ready after 0ms
>[..]
>Trying to mount root from cd9660:/dev/iso9660/13_2_RELEASE_AARCH64_BO [ro]...
>Root mount waiting for: CAM
>[..]
>Root mount waiting for: CAM
>ahcich0: Poll timeout on slot 1 port 0
>ahcich0: is 00000000 cs 00000002 ss 00000000 rs 00000002 tfd 170 serr 00000000 cmd 0000c017
>
>And finally it gives up.
>
>
>v8.1.1 was bad, v8.0.5 was bad so I did git bisecting.
>Which gave me this commit:
>
>commit 7bcd32128b227cee1fb39ff242d486ed9fff7648
>Author: Niklas Cassel <niklas.cassel@wdc.com>
>Date:   Fri Jun 9 16:08:40 2023 +0200
>
>    hw/ide/ahci: simplify and document PxCI handling
>
>    The AHCI spec states that:
>    For NCQ, PxCI is cleared on command queued successfully.
>
>
>
>I built x86_64-softmmu target and checked both "pc" and "q35"
>machines.
>
>./build/x86_64-softmmu/qemu-system-x86_64
>-cdrom FreeBSD-13.2-RELEASE-amd64-bootonly.iso
>-m 2048 -serial stdio  -monitor telnet::45454,server,nowait
>
>PC target ("-M pc") booted fine. But Q35 ("-M q35") failed
>similar way as aarch64/sbsa-ref did:
>
>ahci0: <Intel ICH9 AHCI SATA controller> port 0xc060-0xc07f mem 0xfebd5000-0xfebd5fff irq 16 at device 31.2 on pci0
>ahci0: attempting to allocate 1 MSI vectors (1 supported)
>msi: routing MSI IRQ 26 to local APIC 0 vector 52
>ahci0: using IRQ 26 for MSI
>ahci0: AHCI v1.00 with 6 1.5Gbps ports, Port Multiplier not supported
>ahci0: Caps: 64bit 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:
>[..]
>ahcich2: AHCI reset...
>ahcich2: SATA connect time=0us status=00000113
>ahcich2: AHCI reset: device found
>ahcich2: AHCI reset: device ready after 0ms
>[..]
>Trying to mount root from cd9660:/dev/iso9660/13_2_RELEASE_AMD64_BO [ro]...
>ahcich2: Poll timeout on slot 1 port 0
>ahcich2: is 00000000 cs 00000002 ss 00000000 rs 00000002 tfd 170 serr 00000000 cmd 0000c017
>(aprobe2:ahcich2:0:0:0): SOFT_RESET. ACB: 00 00 00 00 00 00 00 00 00 00 00 00
>(aprobe2:ahcich2:0:0:0): CAM status: Command timeout
>(aprobe2:ahcich2:0:0:0): Error 5, Retries exhausted
>ahcich2: Poll timeout on slot 2 port 0
>ahcich2: is 00000000 cs 00000006 ss 00000000 rs 00000004 tfd 170 serr 00000000 cmd 0000c017
>(aprobe2:ahcich2:0:0:0): SOFT_RESET. ACB: 00 00 00 00 00 00 00 00 00 00 00 00
>(aprobe2:ahcich2:0:0:0): CAM status: Command timeout
>(aprobe2:ahcich2:0:0:0): Error 5, Retries exhausted
>mountroot: waiting for device /dev/iso9660/13_2_RELEASE_AMD64_BO...
>Mounting from cd9660:/dev/iso9660/13_2_RELEASE_AMD64_BO failed with error 19.
>
>Same thing happens with current qemu HEAD:
>
>commit 494a6a2cf7f775d2c20fd6df9601e30606cc2014
>Merge: 29578f5757 b821109583
>Author: Stefan Hajnoczi <stefanha@redhat.com>
>Date:   Mon Sep 25 10:10:30 2023 -0400
>
>    Merge tag 'pull-request-2023-09-25' of https://gitlab.com/thuth/qemu into staging
>
>
>Any ideas?

[-- Attachment #2: Type: text/html, Size: 5670 bytes --]

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

* Re: FreeBSD 13.2 installer does not see AHCI devices on aarch64/sbsa-ref and x86-64/q35
  2023-09-26 12:05 ` Niklas Cassel
@ 2023-09-26 16:35   ` John Snow
  2023-10-03 17:07     ` John Snow
  2023-10-03 17:11   ` Michael Tokarev
  1 sibling, 1 reply; 8+ messages in thread
From: John Snow @ 2023-09-26 16:35 UTC (permalink / raw)
  To: Niklas Cassel
  Cc: Marcin Juszkiewicz, QEMU Developers, qemu-arm, Qemu-block,
	Damien Le Moal, Leif Lindholm, Ard Biesheuvel, Michael Tokarev

[-- Attachment #1: Type: text/plain, Size: 5535 bytes --]

On Tue, Sep 26, 2023, 8:06 AM Niklas Cassel <nks@flawful.org> wrote:

> Hello Marcin,
>
> I will have a look at this.
>
>
> Kind regards,
> Niklas
>

Thanks. You have my blessing in advance to get any hot fixes for this
merged ASAP, as long as another block maintainer is willing to give it an
ACK. (I'll try to be prompt. Please send me a message on IRC to get my
attention if you need to. Sorry I'm so hard to get hold of.)

Also CC mjt - we might need a fix for stable if you merged these patches.



>
>
> On 26 September 2023 13:23:46 CEST, Marcin Juszkiewicz <
> marcin.juszkiewicz@linaro.org> wrote:
>
>> I work on SBSA Reference Platform (sbsa-ref) at Linaro. And yesterday I
>> wanted to check how non-Linux operating systems work on sbsa-ref machine.
>>
>> One of them was FreeBSD 13.2 - the latest one. Fetched bootonly ISO
>> image [1] and booted system.
>>
>> 1. https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.2/FreeBSD-13.2-RELEASE-arm64-aarch64-bootonly.iso
>>
>> QEMU command line arguments:
>>
>> -drive if=ide,file=disks/FreeBSD-13.2-RELEASE-arm64-aarch64-bootonly.iso,media=cdrom
>> -machine sbsa-ref
>> -m 4096
>> -smp 2
>> -cpu neoverse-n1
>> -drive file=fat:rw:/home/marcin/devel/linaro/sbsa-qemu/sbsa-ref-status/disks/virtual/,format=raw
>> -drive format=raw,file=/home/marcin/devel/linaro/sbsa-qemu/sbsa-ref-status/disks/full-debian.hddimg
>> -watchdog-action none
>> -no-reboot
>> -monitor telnet::45454,server,nowait
>> -serial stdio
>> -device igb
>> -nographic
>> -drive if=pflash,file=SBSA_FLASH0.fd,format=raw
>> -drive if=pflash,file=SBSA_FLASH1.fd,format=raw
>>
>>
>> Firmware loaded FreeBSD loader, kernel booted but it does not see
>> any AHCI devices:
>>
>> ahci0: <AHCI SATA controller> iomem 0x60100000-0x6010ffff irq 1 on acpi0
>> ahci0: AHCI v1.00 with 6 1.5Gbps ports, Port Multiplier not supported
>> ahci0: Caps: 64bit NCQ 1.5Gbps 32cmd 6ports
>> ahcich0: <AHCI channel> at channel 0 on ahci0
>> ahcich0: Caps:
>> [..]
>> ahcich0: AHCI reset...
>> ahcich0: SATA connect time=0us status=00000113
>> ahcich0: AHCI reset: device found
>> ahcich0: AHCI reset: device ready after 0ms
>> ahcich1: AHCI reset...
>> ahcich1: SATA connect time=0us status=00000113
>> ahcich1: AHCI reset: device found
>> ahcich1: AHCI reset: device ready after 0ms
>> ahcich2: AHCI reset...
>> ahcich2: SATA connect time=0us status=00000113
>> ahcich2: AHCI reset: device found
>> ahcich2: AHCI reset: device ready after 0ms
>> [..]
>> Trying to mount root from cd9660:/dev/iso9660/13_2_RELEASE_AARCH64_BO [ro]...
>> Root mount waiting for: CAM
>> [..]
>> Root mount waiting for: CAM
>> ahcich0: Poll timeout on slot 1 port 0
>> ahcich0: is 00000000 cs 00000002 ss 00000000 rs 00000002 tfd 170 serr 00000000 cmd 0000c017
>>
>> And finally it gives up.
>>
>>
>> v8.1.1 was bad, v8.0.5 was bad so I did git bisecting.
>> Which gave me this commit:
>>
>> commit 7bcd32128b227cee1fb39ff242d486ed9fff7648
>> Author: Niklas Cassel <niklas.cassel@wdc.com>
>> Date:   Fri Jun 9 16:08:40 2023 +0200
>>
>>     hw/ide/ahci: simplify and document PxCI handling
>>
>>     The AHCI spec states that:
>>     For NCQ, PxCI is cleared on command queued successfully.
>>
>>
>>
>> I built x86_64-softmmu target and checked both "pc" and "q35"
>> machines.
>>
>> ./build/x86_64-softmmu/qemu-system-x86_64
>> -cdrom FreeBSD-13.2-RELEASE-amd64-bootonly.iso
>> -m 2048 -serial stdio  -monitor telnet::45454,server,nowait
>>
>> PC target ("-M pc") booted fine. But Q35 ("-M q35") failed
>> similar way as aarch64/sbsa-ref did:
>>
>> ahci0: <Intel ICH9 AHCI SATA controller> port 0xc060-0xc07f mem 0xfebd5000-0xfebd5fff irq 16 at device 31.2 on pci0
>> ahci0: attempting to allocate 1 MSI vectors (1 supported)
>> msi: routing MSI IRQ 26 to local APIC 0 vector 52
>> ahci0: using IRQ 26 for MSI
>> ahci0: AHCI v1.00 with 6 1.5Gbps ports, Port Multiplier not supported
>> ahci0: Caps: 64bit 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:
>> [..]
>> ahcich2: AHCI reset...
>> ahcich2: SATA connect time=0us status=00000113
>> ahcich2: AHCI reset: device found
>> ahcich2: AHCI reset: device ready after 0ms
>> [..]
>> Trying to mount root from cd9660:/dev/iso9660/13_2_RELEASE_AMD64_BO [ro]...
>> ahcich2: Poll timeout on slot 1 port 0
>> ahcich2: is 00000000 cs 00000002 ss 00000000 rs 00000002 tfd 170 serr 00000000 cmd 0000c017
>> (aprobe2:ahcich2:0:0:0): SOFT_RESET. ACB: 00 00 00 00 00 00 00 00 00 00 00 00
>> (aprobe2:ahcich2:0:0:0): CAM status: Command timeout
>> (aprobe2:ahcich2:0:0:0): Error 5, Retries exhausted
>> ahcich2: Poll timeout on slot 2 port 0
>> ahcich2: is 00000000 cs 00000006 ss 00000000 rs 00000004 tfd 170 serr 00000000 cmd 0000c017
>> (aprobe2:ahcich2:0:0:0): SOFT_RESET. ACB: 00 00 00 00 00 00 00 00 00 00 00 00
>> (aprobe2:ahcich2:0:0:0): CAM status: Command timeout
>> (aprobe2:ahcich2:0:0:0): Error 5, Retries exhausted
>> mountroot: waiting for device /dev/iso9660/13_2_RELEASE_AMD64_BO...
>> Mounting from cd9660:/dev/iso9660/13_2_RELEASE_AMD64_BO failed with error 19.
>>
>> Same thing happens with current qemu HEAD:
>>
>> commit 494a6a2cf7f775d2c20fd6df9601e30606cc2014
>> Merge: 29578f5757 b821109583
>> Author: Stefan Hajnoczi <stefanha@redhat.com>
>> Date:   Mon Sep 25 10:10:30 2023 -0400
>>
>>     Merge tag 'pull-request-2023-09-25' of https://gitlab.com/thuth/qemu into staging
>>
>>
>> Any ideas?
>>
>>

[-- Attachment #2: Type: text/html, Size: 7016 bytes --]

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

* Re: FreeBSD 13.2 installer does not see AHCI devices on aarch64/sbsa-ref and x86-64/q35
  2023-09-26 16:35   ` John Snow
@ 2023-10-03 17:07     ` John Snow
  0 siblings, 0 replies; 8+ messages in thread
From: John Snow @ 2023-10-03 17:07 UTC (permalink / raw)
  To: Niklas Cassel
  Cc: Marcin Juszkiewicz, QEMU Developers, qemu-arm, Qemu-block,
	Damien Le Moal, Leif Lindholm, Ard Biesheuvel, Michael Tokarev

[-- Attachment #1: Type: text/plain, Size: 5817 bytes --]

While I'm poking at IDE today ... any news here?


On Tue, Sep 26, 2023, 12:35 PM John Snow <jsnow@redhat.com> wrote:

>
>
> On Tue, Sep 26, 2023, 8:06 AM Niklas Cassel <nks@flawful.org> wrote:
>
>> Hello Marcin,
>>
>> I will have a look at this.
>>
>>
>> Kind regards,
>> Niklas
>>
>
> Thanks. You have my blessing in advance to get any hot fixes for this
> merged ASAP, as long as another block maintainer is willing to give it an
> ACK. (I'll try to be prompt. Please send me a message on IRC to get my
> attention if you need to. Sorry I'm so hard to get hold of.)
>
> Also CC mjt - we might need a fix for stable if you merged these patches.
>
>
>
>>
>>
>> On 26 September 2023 13:23:46 CEST, Marcin Juszkiewicz <
>> marcin.juszkiewicz@linaro.org> wrote:
>>
>>> I work on SBSA Reference Platform (sbsa-ref) at Linaro. And yesterday I
>>> wanted to check how non-Linux operating systems work on sbsa-ref machine.
>>>
>>> One of them was FreeBSD 13.2 - the latest one. Fetched bootonly ISO
>>> image [1] and booted system.
>>>
>>> 1. https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.2/FreeBSD-13.2-RELEASE-arm64-aarch64-bootonly.iso
>>>
>>> QEMU command line arguments:
>>>
>>> -drive if=ide,file=disks/FreeBSD-13.2-RELEASE-arm64-aarch64-bootonly.iso,media=cdrom
>>> -machine sbsa-ref
>>> -m 4096
>>> -smp 2
>>> -cpu neoverse-n1
>>> -drive file=fat:rw:/home/marcin/devel/linaro/sbsa-qemu/sbsa-ref-status/disks/virtual/,format=raw
>>> -drive format=raw,file=/home/marcin/devel/linaro/sbsa-qemu/sbsa-ref-status/disks/full-debian.hddimg
>>> -watchdog-action none
>>> -no-reboot
>>> -monitor telnet::45454,server,nowait
>>> -serial stdio
>>> -device igb
>>> -nographic
>>> -drive if=pflash,file=SBSA_FLASH0.fd,format=raw
>>> -drive if=pflash,file=SBSA_FLASH1.fd,format=raw
>>>
>>>
>>> Firmware loaded FreeBSD loader, kernel booted but it does not see
>>> any AHCI devices:
>>>
>>> ahci0: <AHCI SATA controller> iomem 0x60100000-0x6010ffff irq 1 on acpi0
>>> ahci0: AHCI v1.00 with 6 1.5Gbps ports, Port Multiplier not supported
>>> ahci0: Caps: 64bit NCQ 1.5Gbps 32cmd 6ports
>>> ahcich0: <AHCI channel> at channel 0 on ahci0
>>> ahcich0: Caps:
>>> [..]
>>> ahcich0: AHCI reset...
>>> ahcich0: SATA connect time=0us status=00000113
>>> ahcich0: AHCI reset: device found
>>> ahcich0: AHCI reset: device ready after 0ms
>>> ahcich1: AHCI reset...
>>> ahcich1: SATA connect time=0us status=00000113
>>> ahcich1: AHCI reset: device found
>>> ahcich1: AHCI reset: device ready after 0ms
>>> ahcich2: AHCI reset...
>>> ahcich2: SATA connect time=0us status=00000113
>>> ahcich2: AHCI reset: device found
>>> ahcich2: AHCI reset: device ready after 0ms
>>> [..]
>>> Trying to mount root from cd9660:/dev/iso9660/13_2_RELEASE_AARCH64_BO [ro]...
>>> Root mount waiting for: CAM
>>> [..]
>>> Root mount waiting for: CAM
>>> ahcich0: Poll timeout on slot 1 port 0
>>> ahcich0: is 00000000 cs 00000002 ss 00000000 rs 00000002 tfd 170 serr 00000000 cmd 0000c017
>>>
>>> And finally it gives up.
>>>
>>>
>>> v8.1.1 was bad, v8.0.5 was bad so I did git bisecting.
>>> Which gave me this commit:
>>>
>>> commit 7bcd32128b227cee1fb39ff242d486ed9fff7648
>>> Author: Niklas Cassel <niklas.cassel@wdc.com>
>>> Date:   Fri Jun 9 16:08:40 2023 +0200
>>>
>>>     hw/ide/ahci: simplify and document PxCI handling
>>>
>>>     The AHCI spec states that:
>>>     For NCQ, PxCI is cleared on command queued successfully.
>>>
>>>
>>>
>>> I built x86_64-softmmu target and checked both "pc" and "q35"
>>> machines.
>>>
>>> ./build/x86_64-softmmu/qemu-system-x86_64
>>> -cdrom FreeBSD-13.2-RELEASE-amd64-bootonly.iso
>>> -m 2048 -serial stdio  -monitor telnet::45454,server,nowait
>>>
>>> PC target ("-M pc") booted fine. But Q35 ("-M q35") failed
>>> similar way as aarch64/sbsa-ref did:
>>>
>>> ahci0: <Intel ICH9 AHCI SATA controller> port 0xc060-0xc07f mem 0xfebd5000-0xfebd5fff irq 16 at device 31.2 on pci0
>>> ahci0: attempting to allocate 1 MSI vectors (1 supported)
>>> msi: routing MSI IRQ 26 to local APIC 0 vector 52
>>> ahci0: using IRQ 26 for MSI
>>> ahci0: AHCI v1.00 with 6 1.5Gbps ports, Port Multiplier not supported
>>> ahci0: Caps: 64bit 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:
>>> [..]
>>> ahcich2: AHCI reset...
>>> ahcich2: SATA connect time=0us status=00000113
>>> ahcich2: AHCI reset: device found
>>> ahcich2: AHCI reset: device ready after 0ms
>>> [..]
>>> Trying to mount root from cd9660:/dev/iso9660/13_2_RELEASE_AMD64_BO [ro]...
>>> ahcich2: Poll timeout on slot 1 port 0
>>> ahcich2: is 00000000 cs 00000002 ss 00000000 rs 00000002 tfd 170 serr 00000000 cmd 0000c017
>>> (aprobe2:ahcich2:0:0:0): SOFT_RESET. ACB: 00 00 00 00 00 00 00 00 00 00 00 00
>>> (aprobe2:ahcich2:0:0:0): CAM status: Command timeout
>>> (aprobe2:ahcich2:0:0:0): Error 5, Retries exhausted
>>> ahcich2: Poll timeout on slot 2 port 0
>>> ahcich2: is 00000000 cs 00000006 ss 00000000 rs 00000004 tfd 170 serr 00000000 cmd 0000c017
>>> (aprobe2:ahcich2:0:0:0): SOFT_RESET. ACB: 00 00 00 00 00 00 00 00 00 00 00 00
>>> (aprobe2:ahcich2:0:0:0): CAM status: Command timeout
>>> (aprobe2:ahcich2:0:0:0): Error 5, Retries exhausted
>>> mountroot: waiting for device /dev/iso9660/13_2_RELEASE_AMD64_BO...
>>> Mounting from cd9660:/dev/iso9660/13_2_RELEASE_AMD64_BO failed with error 19.
>>>
>>> Same thing happens with current qemu HEAD:
>>>
>>> commit 494a6a2cf7f775d2c20fd6df9601e30606cc2014
>>> Merge: 29578f5757 b821109583
>>> Author: Stefan Hajnoczi <stefanha@redhat.com>
>>> Date:   Mon Sep 25 10:10:30 2023 -0400
>>>
>>>     Merge tag 'pull-request-2023-09-25' of https://gitlab.com/thuth/qemu into staging
>>>
>>>
>>> Any ideas?
>>>
>>>

[-- Attachment #2: Type: text/html, Size: 7580 bytes --]

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

* Re: FreeBSD 13.2 installer does not see AHCI devices on aarch64/sbsa-ref and x86-64/q35
  2023-09-26 12:05 ` Niklas Cassel
  2023-09-26 16:35   ` John Snow
@ 2023-10-03 17:11   ` Michael Tokarev
  2023-10-03 20:41     ` Niklas Cassel
  1 sibling, 1 reply; 8+ messages in thread
From: Michael Tokarev @ 2023-10-03 17:11 UTC (permalink / raw)
  To: Niklas Cassel, Marcin Juszkiewicz, QEMU Developers
  Cc: qemu-arm, John Snow, qemu-block, Damien Le Moal, Leif Lindholm,
	Ard Biesheuvel

26.09.2023 15:05, Niklas Cassel:
> Hello Marcin,
> 
> I will have a look at this.

Hi Marcin, Hi Niklas!

Niklas, I remember asking you if the whole thing is okay for the -stable,
and you was a bit unsure about it :)  Regardless, I picked the changes
up for -stable. I don't think it was anyone's fault though, - after all,
I guess, without the change being in -stable, we'd know about this issue
in some distant future instead of now :)

I'm planning to release 8.1.2 soon, with freeze being at Oct-14.  It'd
be really great if we can include a fix for this both in master and in
8.1.2 (8.1.2 should have a long-awaited fix for a quite serious long-
standing issue in 8.1).

Were you able to take a look at what's going on here?  I wish I were
able to help here but I know right to nothing about ahci emulation..

Thanks,

/mjt


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

* Re: FreeBSD 13.2 installer does not see AHCI devices on aarch64/sbsa-ref and x86-64/q35
  2023-10-03 17:11   ` Michael Tokarev
@ 2023-10-03 20:41     ` Niklas Cassel
  2023-11-02 10:16       ` Marcin Juszkiewicz
  0 siblings, 1 reply; 8+ messages in thread
From: Niklas Cassel @ 2023-10-03 20:41 UTC (permalink / raw)
  To: Michael Tokarev
  Cc: Marcin Juszkiewicz, QEMU Developers, qemu-arm, John Snow,
	qemu-block, Damien Le Moal, Leif Lindholm, Ard Biesheuvel

On Tue, Oct 03, 2023 at 08:11:39PM +0300, Michael Tokarev wrote:
> 26.09.2023 15:05, Niklas Cassel:
> > Hello Marcin,
> > 
> > I will have a look at this.
> 
> Hi Marcin, Hi Niklas!
> 
> Niklas, I remember asking you if the whole thing is okay for the -stable,
> and you was a bit unsure about it :)  Regardless, I picked the changes
> up for -stable. I don't think it was anyone's fault though, - after all,
> I guess, without the change being in -stable, we'd know about this issue
> in some distant future instead of now :)
> 
> I'm planning to release 8.1.2 soon, with freeze being at Oct-14.  It'd
> be really great if we can include a fix for this both in master and in
> 8.1.2 (8.1.2 should have a long-awaited fix for a quite serious long-
> standing issue in 8.1).
> 
> Were you able to take a look at what's going on here?  I wish I were
> able to help here but I know right to nothing about ahci emulation..

I was away on a conference all last week, so I didn't have much time to
look at this yet. I will debug the problem this week.

From at quick look at Marcin logs:
ahcich0: Poll timeout on slot 1 port 0
ahcich0: is 00000000 cs 00000002 ss 00000000 rs 00000002 tfd 170 serr 00000000 cmd 0000c017

This log seems to come from:
http://fxr.watson.org/fxr/source/dev/ahci/ahci.c?v=FREEBSD-13-STABLE#L1795

Looking at the print "cs 00000002" means PxCI: 0x2.
So PxCI is never cleared.

I will need to run FreeBSD so I can see which command it is that never gets
PxCI cleared.

NCQ commands will always clear PxCI in process_ncq_command().
Non-NCQ commands will always clear PxCI in ahci_clear_cmd_issue().

From a quick glance, the only time we do not clear PxCI is if we receive
a FIS that we do not handle (trace_handle_cmd_unhandled_fis()).
Will try to see exactly which FIS FreeBSD is sending tomorrow.

(Perhaps we should simply clear PxCI for these FISes that we do not handle...
Or at least make sure that we set ERR_STAT in PxTFD.)


Kind regards,
Niklas



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

* Re: FreeBSD 13.2 installer does not see AHCI devices on aarch64/sbsa-ref and x86-64/q35
  2023-10-03 20:41     ` Niklas Cassel
@ 2023-11-02 10:16       ` Marcin Juszkiewicz
  2023-11-02 10:19         ` Michael Tokarev
  0 siblings, 1 reply; 8+ messages in thread
From: Marcin Juszkiewicz @ 2023-11-02 10:16 UTC (permalink / raw)
  To: Niklas Cassel
  Cc: QEMU Developers, qemu-arm, John Snow, qemu-block, Damien Le Moal,
	Leif Lindholm, Ard Biesheuvel, Michael Tokarev

W dniu 3.10.2023 o 22:41, Niklas Cassel pisze:
> On Tue, Oct 03, 2023 at 08:11:39PM +0300, Michael Tokarev wrote:

>> Were you able to take a look at what's going on here?  I wish I were
>> able to help here but I know right to nothing about ahci emulation..
> 
> I was away on a conference all last week, so I didn't have much time to
> look at this yet. I will debug the problem this week.

Did you had a chance of finding out what the problem is?

FreeBSD 14-rc3 came out recently and problem exists still. If they have 
to change code then it may be last hope before final release.



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

* Re: FreeBSD 13.2 installer does not see AHCI devices on aarch64/sbsa-ref and x86-64/q35
  2023-11-02 10:16       ` Marcin Juszkiewicz
@ 2023-11-02 10:19         ` Michael Tokarev
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Tokarev @ 2023-11-02 10:19 UTC (permalink / raw)
  To: Marcin Juszkiewicz, Niklas Cassel
  Cc: QEMU Developers, qemu-arm, John Snow, qemu-block, Damien Le Moal,
	Leif Lindholm, Ard Biesheuvel

02.11.2023 13:16, Marcin Juszkiewicz:
> W dniu 3.10.2023 o 22:41, Niklas Cassel pisze:
>> On Tue, Oct 03, 2023 at 08:11:39PM +0300, Michael Tokarev wrote:
> 
>>> Were you able to take a look at what's going on here?  I wish I were
>>> able to help here but I know right to nothing about ahci emulation..
>>
>> I was away on a conference all last week, so I didn't have much time to
>> look at this yet. I will debug the problem this week.
> 
> Did you had a chance of finding out what the problem is?

The patch has been posted a month ago to the list, see
https://lore.kernel.org/qemu-devel/20231005100407.1136484-1-nks@flawful.org/
Thanks to Niklas for the excellent work.

It's still not applied neither to master nor to stable though, for unknown
reason..

/mjt


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

end of thread, other threads:[~2023-11-02 10:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-26 11:23 FreeBSD 13.2 installer does not see AHCI devices on aarch64/sbsa-ref and x86-64/q35 Marcin Juszkiewicz
2023-09-26 12:05 ` Niklas Cassel
2023-09-26 16:35   ` John Snow
2023-10-03 17:07     ` John Snow
2023-10-03 17:11   ` Michael Tokarev
2023-10-03 20:41     ` Niklas Cassel
2023-11-02 10:16       ` Marcin Juszkiewicz
2023-11-02 10:19         ` Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).