From a3411eaac1ad3d51d5282d1462d6764ad539ce13 Mon Sep 17 00:00:00 2001 From: Jakub Staron Date: Wed, 24 Apr 2019 10:55:25 -0700 Subject: crosvm: virtio-pmem device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds support for virtio-pmem device as an alternative for virtio-blk. Exposing disk image to guest as virtio-blk device results in both guest and host independently caching the disk I/O. Using virtio-pmem device allows to mount disk image as direct access (DAX) in the guest and thus bypass the guest cache. This will reduce memory foodprint of the VMs. BUG=None TEST=cargo test TEST=Boot patched termina kernel in crosvm; mount virtio-pmem device as DAX and run xfstests. Change-Id: I935fc8fc7527f79e5169f07ec7927e4ea4fa6027 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1605517 Tested-by: kokoro Reviewed-by: Zach Reizner Commit-Queue: Jakub StaroĊ„ --- aarch64/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'aarch64/src/lib.rs') diff --git a/aarch64/src/lib.rs b/aarch64/src/lib.rs index 4d226c0..d21d70d 100644 --- a/aarch64/src/lib.rs +++ b/aarch64/src/lib.rs @@ -200,6 +200,8 @@ impl arch::LinuxArch for AArch64 { where F: FnOnce( &GuestMemory, + &mut Vm, + &mut SystemAllocator, &EventFd, ) -> std::result::Result, Option)>, E>, E: StdError + 'static, @@ -233,8 +235,8 @@ impl arch::LinuxArch for AArch64 { let exit_evt = EventFd::new().map_err(Error::CreateEventFd)?; - let pci_devices = - create_devices(&mem, &exit_evt).map_err(|e| Error::CreateDevices(Box::new(e)))?; + let pci_devices = create_devices(&mem, &mut vm, &mut resources, &exit_evt) + .map_err(|e| Error::CreateDevices(Box::new(e)))?; let (pci, pci_irqs, pid_debug_label_map) = arch::generate_pci_root(pci_devices, &mut mmio_bus, &mut resources, &mut vm) .map_err(Error::CreatePciRoot)?; -- cgit 1.4.1