cloud-hypervisor / rust-hypervisor-firmware

Apache License 2.0
581 stars 53 forks source link

virtio-pci: use 2 32-bit writes for 64-bit fields #306

Closed Lencerf closed 6 months ago

Lencerf commented 6 months ago

As per virtio spec 4.1.3.1 [1]:

For device configuration access, the driver MUST use 8-bit wide accesses for 8-bit wide fields, 16-bit wide and aligned accesses for 16-bit wide fields and 32-bit wide and aligned accesses for 32-bit and 64-bit wide fields.

This patch makes the virtio-pci driver sets 64-bit addresses with 2 32-bit writes to align with the spec.

[1] https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html#x1-1220001