Commit c91b8a4
committed
test: add PCI VirtIO transport unit tests
Add unit tests that ensure our logic for handling the interaction with
guest VirtIO drivers over the PCI transport is correct. Also, drop some
dead code and fix some of the handling of various fields.
A list of logic fixes we found while writing the tests:
* We found some effectively dead code. As VirtIO stipulates that
accesses to 64bit configuration fields MUST happen with two individual
32bit reads, so drop the code that was actually handling the 64bit
accesses.
* There were fields that the code was handling as write-only, when the
specification declares them read-write. This was not an issue, since
the Linux driver apparently never reads them, but add the read
handling, so that we are spec compliant.
* The specification mentions that the driver MUST NOT write a value of 0
in the queue_enable field. Enforce it.
Signed-off-by: Babis Chalios <[email protected]>1 parent e9c95b0 commit c91b8a4
File tree
2 files changed
+388
-112
lines changed- src/vmm/src/devices/virtio/transport
- pci
2 files changed
+388
-112
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | | - | |
| 514 | + | |
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
| |||
0 commit comments