Finally found the time to look at this.
I do have some comments, but I think they can be addressed on top if needed.
In patch 2 - there is a nested loop - the inside looping checking for an interrupt and the outside loop checking for BSY. I don't see how an interrupt could fire when the drive is reporting BSY - is this really needed?
I've seen qemu sending multiple updates, thats why the loop is there.
In patch 4 - the buffer should really be shared with all AHCI controllers and the CDROM emulation code.
In patch 6 - it looks like each port will try to detect a drive by waiting 10ms. Ideally, this would be parallelized by launching a thread per-port. Also, ideally malloc_fseg() wouldn't be called unless the port was needed.
In patch 7 - the ahci code uses bootprio_find_ata_device() which tacks on "/disk@0" to the search pattern which is redundant as ahci doesn't have "slave" drives - is this really needed?
It isn't required, but it also doesn't harm. qemu gives us a string with the redundant "/disk@0" included, thus bootprio_find_ata_device works as-is and I didn't bother creating a separate function for ahci/sata.
Patch series with the fixes mentioned above will go to the list in a moment.