summary refs log tree commit diff
path: root/x86_64
diff options
context:
space:
mode:
authorJakub Staron <jstaron@google.com>2019-04-24 10:55:25 -0700
committerCommit Bot <commit-bot@chromium.org>2019-06-05 07:28:54 +0000
commita3411eaac1ad3d51d5282d1462d6764ad539ce13 (patch)
tree7a9898280f1cd8c78dcdfac6893189ed42419d76 /x86_64
parent127453d7eccdb6a903d0855fabb8f0935be90882 (diff)
downloadcrosvm-a3411eaac1ad3d51d5282d1462d6764ad539ce13.tar
crosvm-a3411eaac1ad3d51d5282d1462d6764ad539ce13.tar.gz
crosvm-a3411eaac1ad3d51d5282d1462d6764ad539ce13.tar.bz2
crosvm-a3411eaac1ad3d51d5282d1462d6764ad539ce13.tar.lz
crosvm-a3411eaac1ad3d51d5282d1462d6764ad539ce13.tar.xz
crosvm-a3411eaac1ad3d51d5282d1462d6764ad539ce13.tar.zst
crosvm-a3411eaac1ad3d51d5282d1462d6764ad539ce13.zip
crosvm: virtio-pmem device
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 <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Commit-Queue: Jakub StaroĊ„ <jstaron@google.com>
Diffstat (limited to 'x86_64')
-rw-r--r--x86_64/src/lib.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/x86_64/src/lib.rs b/x86_64/src/lib.rs
index 3fe8d69..a047b8c 100644
--- a/x86_64/src/lib.rs
+++ b/x86_64/src/lib.rs
@@ -309,6 +309,8 @@ impl arch::LinuxArch for X8664arch {
     where
         F: FnOnce(
             &GuestMemory,
+            &mut Vm,
+            &mut SystemAllocator,
             &EventFd,
         ) -> std::result::Result<Vec<(Box<dyn PciDevice>, Option<Minijail>)>, E>,
         E: StdError + 'static,
@@ -348,8 +350,8 @@ impl arch::LinuxArch for X8664arch {
 
         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)?;