diff --git a/arch/src/lib.rs b/arch/src/lib.rs index 2dcdc444b..1a4ae1d0b 100644 --- a/arch/src/lib.rs +++ b/arch/src/lib.rs @@ -79,7 +79,7 @@ pub mod x86_64; #[cfg(target_arch = "x86_64")] pub use x86_64::{ arch_memory_regions, configure_system, initramfs_load_addr, layout, layout::CMDLINE_MAX_SIZE, - layout::CMDLINE_START, BootProtocol, EntryPoint, + layout::CMDLINE_START, regs, BootProtocol, EntryPoint, }; /// Safe wrapper for `sysconf(_SC_PAGESIZE)`. diff --git a/arch/src/x86_64/regs.rs b/arch/src/x86_64/regs.rs index 99f33142b..571e61fe8 100644 --- a/arch/src/x86_64/regs.rs +++ b/arch/src/x86_64/regs.rs @@ -70,7 +70,7 @@ pub fn setup_fpu(vcpu: &VcpuFd) -> Result<()> { /// /// * `vcpu` - Structure for the VCPU that holds the VCPU's fd. pub fn setup_msrs(vcpu: &VcpuFd) -> Result<()> { - vcpu.set_msrs(&create_msr_entries()) + vcpu.set_msrs(&boot_msr_entries()) .map_err(Error::SetModelSpecificRegisters)?; Ok(()) @@ -262,7 +262,7 @@ macro_rules! kvm_msr_data { }; } -fn create_msr_entries() -> Msrs { +pub fn boot_msr_entries() -> Msrs { Msrs::from_entries(&[ kvm_msr!(msr_index::MSR_IA32_SYSENTER_CS), kvm_msr!(msr_index::MSR_IA32_SYSENTER_ESP), @@ -426,7 +426,7 @@ mod tests { // Official entries that were setup when we did setup_msrs. We need to assert that the // tenth one (i.e the one with index msr_index::MSR_IA32_MISC_ENABLE has the data we // expect. - let entry_vec = create_msr_entries(); + let entry_vec = boot_msr_entries(); assert_eq!(entry_vec.as_slice()[9], msrs.as_slice()[0]); }