crosvm/devices
Mattias Nissler de2c640f17 Add stub PCI device implementation.
Introduce a very simple stub PCI device that can be added to the bus
at a specified address with given PCI config parameters (vendor,
device, etc.). This is useful for cases where we just require a device
to be present during PCI enumeration.

The case that motivates this is a vfio device passthrough
configuration that passes only selected functions of a given device at
the original addresses, but function 0 is not passed through. Absence
of function 0 would be interpreted in enumeration as the entire device
being absent (in accordance with the specification). Putting a stub
device at function 0 fixes this.

BUG=b:167947780
TEST=New unit test, boot minimal Linux image and verify enumerated PCI device.

Change-Id: Iaedffe1c4ac2ad8f6ff6e00dfeebbbfeb5490551
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3245497
Auto-Submit: Mattias Nissler <mnissler@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2021-10-27 14:06:35 +00:00
..
src Add stub PCI device implementation. 2021-10-27 14:06:35 +00:00
.build_test_serial devices: Add simple test for proxy device 2020-11-17 21:05:51 +00:00
Cargo.toml crosvm: switch to upstream tempfile crate 2021-10-11 18:35:55 +00:00