diff options
author | Dylan Reid <dgreid@chromium.org> | 2018-05-23 17:57:05 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-18 21:59:01 -0700 |
commit | 836466aeaddf348b2c7721b3fa56b5c5628d400a (patch) | |
tree | 581f05e428ee1a927f176e8e084c048442f803b1 /x86_64/src | |
parent | 898921fe78d1809c1d35ab9e03e384232745410d (diff) | |
download | crosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.tar crosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.tar.gz crosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.tar.bz2 crosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.tar.lz crosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.tar.xz crosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.tar.zst crosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.zip |
devices: proxy - Add support for proxying PciDevices
PCI adds a configuration space to the existing memory mapped IO supported by BusDevices. Add the ability to set configuration space as optional to the BusDevice trait so that ProxyDevice can be shared. PCI devices can have more than one memory mapped region. Expand the bus so that it has the ability to pass an absolute address instead of an offset. This will allow the PCI device to know which BAR is being written to. Change-Id: I055cd516c49a74316a9547df471290f05d865b0a Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1103663 Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Diffstat (limited to 'x86_64/src')
-rw-r--r-- | x86_64/src/lib.rs | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/x86_64/src/lib.rs b/x86_64/src/lib.rs index c887baa..f2ca16d 100644 --- a/x86_64/src/lib.rs +++ b/x86_64/src/lib.rs @@ -348,37 +348,41 @@ impl arch::LinuxArch for X8664arch { map_err(|e| Error::CloneEventFd(e))?, Box::new(stdout())))); let nul_device = Arc::new(Mutex::new(NoDevice)); - io_bus.insert(stdio_serial.clone(), 0x3f8, 0x8).unwrap(); + io_bus.insert(stdio_serial.clone(), 0x3f8, 0x8, false).unwrap(); io_bus.insert(Arc::new(Mutex::new( devices::Serial::new_sink(com_evt_2_4.try_clone(). map_err(|e| Error::CloneEventFd(e))?))), 0x2f8, - 0x8) + 0x8, + false) .unwrap(); io_bus.insert(Arc::new(Mutex::new( devices::Serial::new_sink(com_evt_1_3.try_clone(). map_err(|e| Error::CloneEventFd(e))?))), 0x3e8, - 0x8) + 0x8, + false) .unwrap(); io_bus.insert(Arc::new(Mutex::new( devices::Serial::new_sink(com_evt_2_4.try_clone(). map_err(|e| Error::CloneEventFd(e))?))), 0x2e8, - 0x8) + 0x8, + false) .unwrap(); - io_bus.insert(Arc::new(Mutex::new(devices::Cmos::new())), 0x70, 0x2) + io_bus.insert(Arc::new(Mutex::new(devices::Cmos::new())), 0x70, 0x2, false) .unwrap(); io_bus.insert(Arc::new(Mutex::new( devices::I8042Device::new(exit_evt.try_clone(). map_err(|e| Error::CloneEventFd(e))?))), 0x061, - 0x4) + 0x4, + false) .unwrap(); - io_bus.insert(nul_device.clone(), 0x040, 0x8).unwrap(); // ignore pit - io_bus.insert(nul_device.clone(), 0x0ed, 0x1).unwrap(); // most likely this one does nothing - io_bus.insert(nul_device.clone(), 0x0f0, 0x2).unwrap(); // ignore fpu - io_bus.insert(nul_device.clone(), 0xcf8, 0x8).unwrap(); // ignore pci + io_bus.insert(nul_device.clone(), 0x040, 0x8, false).unwrap(); // ignore pit + io_bus.insert(nul_device.clone(), 0x0ed, 0x1, false).unwrap(); // most likely this one does nothing + io_bus.insert(nul_device.clone(), 0x0f0, 0x2, false).unwrap(); // ignore fpu + io_bus.insert(nul_device.clone(), 0xcf8, 0x8, false).unwrap(); // ignore pci vm.register_irqfd(&com_evt_1_3, 4).map_err(Error::RegisterIrqfd)?; vm.register_irqfd(&com_evt_2_4, 3).map_err(Error::RegisterIrqfd)?; |