diff --git a/arch/src/x86_64/layout.rs b/arch/src/x86_64/layout.rs index f436ae98f..ce1efce3d 100644 --- a/arch/src/x86_64/layout.rs +++ b/arch/src/x86_64/layout.rs @@ -34,6 +34,9 @@ pub const CMDLINE_START: GuestAddress = GuestAddress(0x20000); /// Kernel command line start address maximum size. pub const CMDLINE_MAX_SIZE: usize = 0x10000; +// MPTABLE, describing VCPUS. +pub const MPTABLE_START: GuestAddress = GuestAddress(0x9fc00); + // == End of "Low RAM" range. == // ** EBDA reserved area (start: 640KiB, length: 384KiB) ** diff --git a/arch/src/x86_64/mptable.rs b/arch/src/x86_64/mptable.rs index 226a777f0..54fceaa0c 100644 --- a/arch/src/x86_64/mptable.rs +++ b/arch/src/x86_64/mptable.rs @@ -13,8 +13,8 @@ use std::slice; use libc::c_char; use arch_gen::x86::mpspec; -use layout::{APIC_START, IOAPIC_START}; -use vm_memory::{Address, GuestAddress, ByteValued, Bytes, GuestMemory, GuestMemoryMmap}; +use layout::{APIC_START, IOAPIC_START, MPTABLE_START}; +use vm_memory::{Address, ByteValued, Bytes, GuestMemory, GuestMemoryMmap}; // This is a workaround to the Rust enforcement specifying that any implementation of a foreign // trait (in this case `ByteValued`) where: @@ -45,9 +45,6 @@ unsafe impl ByteValued for MpcTableWrapper {} unsafe impl ByteValued for MpcLintsrcWrapper {} unsafe impl ByteValued for MpfIntelWrapper {} -// MPTABLE, describing VCPUS. -const MPTABLE_START: GuestAddress = GuestAddress(0x9fc00); - #[derive(Debug, PartialEq)] pub enum Error { /// There was too little guest memory to store the entire MP table. @@ -283,7 +280,7 @@ pub fn setup_mptable(mem: &GuestMemoryMmap, num_cpus: u8) -> Result<()> { #[cfg(test)] mod tests { use super::*; - use vm_memory::GuestUsize; + use vm_memory::{GuestAddress, GuestUsize}; fn table_entry_size(type_: u8) -> usize { match type_ as u32 {