mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
build: Bump vm-memory and dependents
vm-memory 0.18 has renamed GuestMemory to GuestMemoryBackend, and made GuestMemory refer to something less specific. For simplicity, we keep using GuestMemoryBackend (formerly GuestMemory) everywhere for now. We can adjust bounds to be less specific later if we find ourselves needing the newly enabled flexibility. Signed-off-by: Alyssa Ross <hi@alyssa.is> Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
committed by
Rob Bradford
parent
1a1c21024a
commit
cd2089eb69
@@ -23,7 +23,7 @@ use hypervisor::arch::aarch64::regs::{
|
||||
use log::{debug, info};
|
||||
use thiserror::Error;
|
||||
use vm_fdt::{FdtWriter, FdtWriterResult};
|
||||
use vm_memory::{Address, Bytes, GuestMemory, GuestMemoryError, GuestMemoryRegion};
|
||||
use vm_memory::{Address, Bytes, GuestMemoryBackend, GuestMemoryError, GuestMemoryRegion};
|
||||
|
||||
use super::super::{DeviceType, GuestMemoryMmap, InitramfsConfig};
|
||||
use super::cache::{CacheTopologyInfo, read_cache_topology};
|
||||
@@ -397,14 +397,14 @@ fn create_memory_node(
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Note: memory regions from "GuestMemory" are sorted and non-zero sized.
|
||||
// Note: memory regions from "GuestMemoryBackend" are sorted and non-zero sized.
|
||||
let ram_regions = {
|
||||
let mut ram_regions = Vec::new();
|
||||
let mut current_start = guest_mem
|
||||
.iter()
|
||||
.next()
|
||||
.map(GuestMemoryRegion::start_addr)
|
||||
.expect("GuestMemory must have one memory region at least")
|
||||
.expect("GuestMemoryBackend must have one memory region at least")
|
||||
.raw_value();
|
||||
let mut current_end = current_start;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ use hypervisor::arch::aarch64::gic::Vgic;
|
||||
use hypervisor::arch::aarch64::regs::MPIDR_EL1;
|
||||
use log::{Level, log_enabled};
|
||||
use thiserror::Error;
|
||||
use vm_memory::{Address, GuestAddress, GuestMemory, GuestMemoryAtomic};
|
||||
use vm_memory::{Address, GuestAddress, GuestMemoryAtomic, GuestMemoryBackend};
|
||||
|
||||
pub use self::fdt::DeviceInfoForFdt;
|
||||
use crate::{DeviceType, GuestMemoryMmap, NumaNodes, PciSpaceInfo, RegionType};
|
||||
|
||||
@@ -18,7 +18,7 @@ use hypervisor::arch::riscv64::aia::Vaia;
|
||||
use log::debug;
|
||||
use thiserror::Error;
|
||||
use vm_fdt::{FdtWriter, FdtWriterResult};
|
||||
use vm_memory::{Address, Bytes, GuestMemory, GuestMemoryError, GuestMemoryRegion};
|
||||
use vm_memory::{Address, Bytes, GuestMemoryBackend, GuestMemoryError, GuestMemoryRegion};
|
||||
|
||||
use super::super::{DeviceType, GuestMemoryMmap, InitramfsConfig};
|
||||
use super::layout::{
|
||||
@@ -151,14 +151,14 @@ fn create_cpu_nodes(
|
||||
}
|
||||
|
||||
fn create_memory_node(fdt: &mut FdtWriter, guest_mem: &GuestMemoryMmap) -> FdtWriterResult<()> {
|
||||
// Note: memory regions from "GuestMemory" are sorted and non-zero sized.
|
||||
// Note: memory regions from "GuestMemoryBackend" are sorted and non-zero sized.
|
||||
let ram_regions = {
|
||||
let mut ram_regions = Vec::new();
|
||||
let mut current_start = guest_mem
|
||||
.iter()
|
||||
.next()
|
||||
.map(GuestMemoryRegion::start_addr)
|
||||
.expect("GuestMemory must have one memory region at least")
|
||||
.expect("GuestMemoryBackend must have one memory region at least")
|
||||
.raw_value();
|
||||
let mut current_end = current_start;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ use std::sync::{Arc, Mutex};
|
||||
use hypervisor::arch::riscv64::aia::Vaia;
|
||||
use log::{Level, log_enabled};
|
||||
use thiserror::Error;
|
||||
use vm_memory::{Address, GuestAddress, GuestMemory, GuestMemoryAtomic};
|
||||
use vm_memory::{Address, GuestAddress, GuestMemoryAtomic, GuestMemoryBackend};
|
||||
|
||||
pub use self::fdt::DeviceInfoForFdt;
|
||||
use crate::{DeviceType, GuestMemoryMmap, PciSpaceInfo, RegionType};
|
||||
|
||||
@@ -33,7 +33,7 @@ use log::{debug, error, info};
|
||||
pub use smbios::{SmbiosChassisConfig, SmbiosConfig, SmbiosSystem};
|
||||
use thiserror::Error;
|
||||
use vm_memory::{
|
||||
Address, Bytes, GuestAddress, GuestAddressSpace, GuestMemory, GuestMemoryAtomic,
|
||||
Address, Bytes, GuestAddress, GuestAddressSpace, GuestMemoryAtomic, GuestMemoryBackend,
|
||||
GuestMemoryRegion,
|
||||
};
|
||||
use vmm_sys_util::fam;
|
||||
@@ -1030,9 +1030,9 @@ pub fn configure_vcpu(
|
||||
|
||||
/// Returns a Vec of the valid memory addresses.
|
||||
///
|
||||
/// These should be used to configure the GuestMemory structure for the platform.
|
||||
/// For x86_64 all addresses are valid from the start of the kernel except a
|
||||
/// carve out at the end of 32bit address space.
|
||||
/// These should be used to configure the GuestMemoryBackend structure for the
|
||||
/// platform. For x86_64 all addresses are valid from the start of the kernel
|
||||
/// except a carve out at the end of 32bit address space.
|
||||
pub fn arch_memory_regions() -> Vec<(GuestAddress, usize, RegionType)> {
|
||||
vec![
|
||||
// 0 GiB ~ 3GiB: memory before the gap
|
||||
@@ -1116,14 +1116,14 @@ type RamRange = (u64, u64);
|
||||
/// These should be used to create e820_RAM memory maps
|
||||
pub fn generate_ram_ranges(guest_mem: &GuestMemoryMmap) -> super::Result<Vec<RamRange>> {
|
||||
// Merge continuous memory regions into one region.
|
||||
// Note: memory regions from "GuestMemory" are sorted and non-zero sized.
|
||||
// Note: memory regions from "GuestMemoryBackend" are sorted and non-zero sized.
|
||||
let ram_regions = {
|
||||
let mut ram_regions = Vec::new();
|
||||
let mut current_start = guest_mem
|
||||
.iter()
|
||||
.next()
|
||||
.map(GuestMemoryRegion::start_addr)
|
||||
.expect("GuestMemory must have one memory region at least")
|
||||
.expect("GuestMemoryBackend must have one memory region at least")
|
||||
.raw_value();
|
||||
let mut current_end = current_start;
|
||||
|
||||
@@ -1392,7 +1392,7 @@ fn add_e820_entry(
|
||||
|
||||
params.e820_table[params.e820_entries as usize].addr = addr;
|
||||
params.e820_table[params.e820_entries as usize].size = size;
|
||||
params.e820_table[params.e820_entries as usize].type_ = mem_type;
|
||||
params.e820_table[params.e820_entries as usize].r#type = mem_type;
|
||||
params.e820_entries += 1;
|
||||
|
||||
Ok(())
|
||||
@@ -1688,7 +1688,7 @@ mod unit_tests {
|
||||
let e820_table = [(boot_e820_entry {
|
||||
addr: 0x1,
|
||||
size: 4,
|
||||
type_: 1,
|
||||
r#type: 1,
|
||||
}); 128];
|
||||
|
||||
let expected_params = boot_params {
|
||||
@@ -1702,7 +1702,7 @@ mod unit_tests {
|
||||
&mut params,
|
||||
e820_table[0].addr,
|
||||
e820_table[0].size,
|
||||
e820_table[0].type_,
|
||||
e820_table[0].r#type,
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
@@ -1718,7 +1718,7 @@ mod unit_tests {
|
||||
&mut params,
|
||||
e820_table[0].addr,
|
||||
e820_table[0].size,
|
||||
e820_table[0].type_,
|
||||
e820_table[0].r#type,
|
||||
)
|
||||
.unwrap_err();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ use std::result;
|
||||
use libc::c_uchar;
|
||||
use log::{info, warn};
|
||||
use thiserror::Error;
|
||||
use vm_memory::{Address, ByteValued, Bytes, GuestAddress, GuestMemory, GuestMemoryError};
|
||||
use vm_memory::{Address, ByteValued, Bytes, GuestAddress, GuestMemoryBackend, GuestMemoryError};
|
||||
|
||||
use super::MAX_SUPPORTED_CPUS_LEGACY;
|
||||
use crate::GuestMemoryMmap;
|
||||
|
||||
@@ -12,7 +12,7 @@ use hypervisor::arch::x86::gdt::{gdt_entry, segment_from_gdt};
|
||||
use hypervisor::arch::x86::regs::CR0_PE;
|
||||
use hypervisor::arch::x86::{FpuState, SpecialRegisters};
|
||||
use thiserror::Error;
|
||||
use vm_memory::{Address, Bytes, GuestMemory, GuestMemoryError};
|
||||
use vm_memory::{Address, Bytes, GuestMemoryBackend, GuestMemoryError};
|
||||
|
||||
use crate::layout::{
|
||||
BOOT_GDT_START, BOOT_IDT_START, BOOT_STACK_POINTER, PVH_INFO_START, ZERO_PAGE_START,
|
||||
|
||||
Reference in New Issue
Block a user