misc: Upgrade to use the vm-memory crate w/ dirty-page-tracking

As the first step to complete live-migration with tracking dirty-pages
written by the VMM, this commit patches the dependent vm-memory crate to
the upstream version with the dirty-page-tracking capability. Most
changes are due to the updated `GuestMemoryMmap`, `GuestRegionMmap`, and
`MmapRegion` structs which are taking an additional generic type
parameter to specify what 'bitmap backend' is used.

The above changes should be transparent to the rest of the code base,
e.g. all unit/integration tests should pass without additional changes.

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen
2021-06-02 12:08:04 -07:00
committed by Rob Bradford
parent c7b794a7c5
commit b5bcdbaf48
53 changed files with 120 additions and 71 deletions

View File

@@ -12,6 +12,7 @@ use std::fmt::Debug;
use std::result;
use super::super::DeviceType;
use super::super::GuestMemoryMmap;
use super::super::InitramfsConfig;
use super::get_fdt_addr;
use super::gic::GicDevice;
@@ -20,7 +21,7 @@ use super::layout::{
PCI_MMCONFIG_START,
};
use vm_fdt::{FdtWriter, FdtWriterResult};
use vm_memory::{Address, Bytes, GuestAddress, GuestMemory, GuestMemoryError, GuestMemoryMmap};
use vm_memory::{Address, Bytes, GuestAddress, GuestMemory, GuestMemoryError};
// This is a value for uniquely identifying the FDT node declaring the interrupt controller.
const GIC_PHANDLE: u32 = 1;

View File

@@ -13,6 +13,7 @@ pub mod regs;
pub use self::fdt::DeviceInfoForFdt;
use crate::DeviceType;
use crate::GuestMemoryMmap;
use crate::RegionType;
use gic::GicDevice;
use std::collections::HashMap;
@@ -20,8 +21,7 @@ use std::ffi::CStr;
use std::fmt::Debug;
use std::sync::Arc;
use vm_memory::{
Address, GuestAddress, GuestAddressSpace, GuestMemory, GuestMemoryAtomic, GuestMemoryMmap,
GuestUsize,
Address, GuestAddress, GuestAddressSpace, GuestMemory, GuestMemoryAtomic, GuestUsize,
};
/// Errors thrown while configuring aarch64 system.

View File

@@ -6,13 +6,13 @@
// found in the THIRD-PARTY file.
use super::get_fdt_addr;
use crate::GuestMemoryMmap;
use hypervisor::kvm::kvm_bindings::{
kvm_regs, user_pt_regs, KVM_REG_ARM64, KVM_REG_ARM_CORE, KVM_REG_SIZE_U64,
};
use hypervisor::{arm64_core_reg_id, offset__of};
use std::sync::Arc;
use std::{mem, result};
use vm_memory::GuestMemoryMmap;
/// Errors thrown while setting aarch64 registers.
#[derive(Debug)]