Closed xiw closed 1 year ago
Thanks!
I just have a look at this change, and I get some question about it. It seems that there are some legacy flag that is not supported in 1.0+, should we remove them also?
VIRTIO_BLK_F_MQ
is not sure, by document it is a flag for NET device.
The virtio_disk driver currently implements the legacy interface, which is both confusing and outdated. The information about legacy interface is scattered in the spec (often in multiple places tagged "legacy interface"). This makes it hard to match the xv6 code with the virtio spec (or for students to extend xv6 with more virtio drivers).
This patch makes virtio_disk conform to the virtio spec (1.0+). This is supported in QEMU since 4.2.
For simplicity, this implementation allocates separate pages for
desc
/avail
/used
(one for each area). It also removes some alignment restrictions.