Hi Miro,



I was able to fix /drv/ahci and /srv/bd/sata_bd. Now they seem to work.

I tried adding multiple disks, but most I could add was 6 disks on a single
AHCI controller.

Trying to add more than 6 disks to an AHCI controller -> qemu gives an
error.

Trying to add two AHCI controllers to the VM -> HelenOS hangs during boot.


So not sure if this helps at all.




Regards,

Jiri



---------- Původní e-mail ----------
Od: Miroslav Cimerman <m...@doas.su>
Komu: HelenOS development mailing list <helenos-devel@lists.modry.cz>
Datum: 28. 5. 2025 19:04:04
Předmět: [HelenOS-devel] AHCI not working
"Hello,

I am trying to connect at least 33 block devices via Qemu to
HelenOS, but there are multiple problems:

pci-ide: not enough devices supported
virtio-blk: possible, but currently having some perf issues [A]
usb-mass-storage: possible, but too slow
ahci: not working [B]


[A] virtio-blk:

In my previous mail I proposed a speedup to virtio-blk, the problem is, 
that even though there is an expected speedup of up to 120x when writing 
due to processing multiple blocks in one request, now every request, even 
with 1 block takes the same amount of time as using the full bandwidth. 
Why could that be?


[B] AHCI not working:

setup: relevant qemu arguments:

qemu-system-x86_64 \
[...]
-device ahci,id=ahci0 \
-drive file=/dev/sde,if=none,id=drive0 \
-device ide-hd,drive=drive0,bus=ahci0.0


1. there is a null deref always triggered in: `uspace/drv/block/ahci/ahci.
c::ahci_sata_create()`

fix:

diff --git a/uspace/drv/block/ahci/ahci.c b/uspace/drv/block/ahci/ahci.c 
index acd9cd56e..26820bdb9 100644
--- a/uspace/drv/block/ahci/ahci.c
+++ b/uspace/drv/block/ahci/ahci.c
@@ -1074,6 +1074,8 @@ static errno_t ahci_sata_create(ahci_dev_t *ahci, ddf_
dev_t *dev,
goto error;
}

+ fun = sata->fun;
+
ddf_fun_set_ops(fun, &ahci_ops);

rc = ddf_fun_bind(fun);


2. even after fixing this, it still doesn't work. After starting /srv/bd/
sata_bd
the server successfully finds the drv and opens a bd interface at bd/ahci_0,

but when trying to read from it: `blkdump bd/ahci_0`, the server crashes. 
I think it is at https://github.com/HelenOS/helenos/blob/master/uspace/lib/
drv/generic/remote_ahci.c#L159
because this assertion triggers the crash:

[/srv/bd/sata_bd(40)] Assertion failed (area->magic == 0xBEEFCAFEU) in task
40, file "../../helenraid/uspace/lib/c/generic/malloc.c", line 283.

which is called in free() in async_wait_for().

Also I have vbd server turned off as it was crashing the device right away,
I wanted to
manually crash it with blkdump, but its the same.


Are there other ways to connect at least 33 block devices via Qemu to
HelenOS?
I will greatly appreciate any help with this.

--
Miroslav Cimerman

_______________________________________________
HelenOS-devel mailing list
HelenOS-devel@lists.modry.cz
http://lists.modry.cz/listinfo/helenos-devel
"
_______________________________________________
HelenOS-devel mailing list
HelenOS-devel@lists.modry.cz
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to