summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorXiong Zhang <xiong.y.zhang@intel.corp-partner.google.com>2019-10-30 14:59:26 +0800
committerCommit Bot <commit-bot@chromium.org>2019-11-10 06:39:34 +0000
commit383b3b520a76a921be17a12640b24fba1419dbbb (patch)
tree1aea1553c2534aab73b265929cf462c0d8999a67 /src
parent87a3b44d9e6caa82ab521a5dd9bafdb56e8b6ed1 (diff)
downloadcrosvm-383b3b520a76a921be17a12640b24fba1419dbbb.tar
crosvm-383b3b520a76a921be17a12640b24fba1419dbbb.tar.gz
crosvm-383b3b520a76a921be17a12640b24fba1419dbbb.tar.bz2
crosvm-383b3b520a76a921be17a12640b24fba1419dbbb.tar.lz
crosvm-383b3b520a76a921be17a12640b24fba1419dbbb.tar.xz
crosvm-383b3b520a76a921be17a12640b24fba1419dbbb.tar.zst
crosvm-383b3b520a76a921be17a12640b24fba1419dbbb.zip
resource: Rename device memory to mmio
Since unified allocator is used to allocate mmio, this patch remove the
device memory name, and rename device to mmio.

BUG=chromium:992270
TEST=this patch doesn't change function, run build_test

Change-Id: I234b0db4b3c5de8cfee372ace5212a980564d0c7
Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1895234
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/linux.rs10
-rw-r--r--src/plugin/mod.rs2
-rw-r--r--src/plugin/process.rs2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/linux.rs b/src/linux.rs
index 2816d55..24ef5ec 100644
--- a/src/linux.rs
+++ b/src/linux.rs
@@ -784,7 +784,7 @@ fn create_pmem_device(
     };
 
     let mapping_address = resources
-        .mmio_allocator(MmioType::Device)
+        .mmio_allocator(MmioType::High)
         .allocate_with_align(
             image_size,
             Alloc::PmemDevice(index),
@@ -794,7 +794,7 @@ fn create_pmem_device(
         )
         .map_err(Error::AllocatePmemDeviceAddress)?;
 
-    vm.add_device_memory(
+    vm.add_mmio_memory(
         GuestAddress(mapping_address),
         memory_mapping,
         /* read_only = */ disk.read_only,
@@ -1420,11 +1420,11 @@ pub fn run_config(cfg: Config) -> Result<()> {
             MemoryMapping::new_protection(RENDER_NODE_HOST_SIZE as usize, Protection::none())
                 .map_err(Error::ReserveGpuMemory)?;
 
-        // Put the non-accessible memory map into device memory so that no other devices use that
+        // Put the non-accessible memory map into high mmio so that no other devices use that
         // guest address space.
         let gpu_addr = linux
             .resources
-            .mmio_allocator(MmioType::Device)
+            .mmio_allocator(MmioType::High)
             .allocate(
                 RENDER_NODE_HOST_SIZE,
                 Alloc::GpuRenderNode,
@@ -1437,7 +1437,7 @@ pub fn run_config(cfg: Config) -> Result<()> {
         // Makes the gpu memory accessible at allocated address.
         linux
             .vm
-            .add_device_memory(
+            .add_mmio_memory(
                 GuestAddress(gpu_addr),
                 gpu_mmap,
                 /* read_only = */ false,
diff --git a/src/plugin/mod.rs b/src/plugin/mod.rs
index 012eec1..f0d6932 100644
--- a/src/plugin/mod.rs
+++ b/src/plugin/mod.rs
@@ -361,7 +361,7 @@ impl PluginObject {
                 8 => vm.unregister_ioevent(&evt, addr, Datamatch::U64(Some(datamatch as u64))),
                 _ => Err(SysError::new(EINVAL)),
             },
-            PluginObject::Memory { slot, .. } => vm.remove_device_memory(slot).and(Ok(())),
+            PluginObject::Memory { slot, .. } => vm.remove_mmio_memory(slot).and(Ok(())),
             PluginObject::IrqEvent { irq_id, evt } => vm.unregister_irqfd(&evt, irq_id),
         }
     }
diff --git a/src/plugin/process.rs b/src/plugin/process.rs
index c2d6acb..ea7a78c 100644
--- a/src/plugin/process.rs
+++ b/src/plugin/process.rs
@@ -363,7 +363,7 @@ impl Process {
         }
         let mem = MemoryMapping::from_fd_offset(&shm, length as usize, offset as usize)
             .map_err(mmap_to_sys_err)?;
-        let slot = vm.add_device_memory(GuestAddress(start), mem, read_only, dirty_log)?;
+        let slot = vm.add_mmio_memory(GuestAddress(start), mem, read_only, dirty_log)?;
         entry.insert(PluginObject::Memory {
             slot,
             length: length as usize,