diff --git a/arch/src/aarch64/fdt.rs b/arch/src/aarch64/fdt.rs index ce3551cc7..ea3f842eb 100644 --- a/arch/src/aarch64/fdt.rs +++ b/arch/src/aarch64/fdt.rs @@ -19,6 +19,7 @@ use hypervisor::arch::aarch64::regs::{ AARCH64_ARCH_TIMER_HYP_IRQ, AARCH64_ARCH_TIMER_PHYS_NONSECURE_IRQ, AARCH64_ARCH_TIMER_PHYS_SECURE_IRQ, AARCH64_ARCH_TIMER_VIRT_IRQ, AARCH64_PMU_IRQ, }; +use log::{debug, warn}; use thiserror::Error; use vm_fdt::{FdtWriter, FdtWriterResult}; use vm_memory::{Address, Bytes, GuestMemory, GuestMemoryError, GuestMemoryRegion}; diff --git a/arch/src/lib.rs b/arch/src/lib.rs index 36fa20f13..a7c0ffdca 100644 --- a/arch/src/lib.rs +++ b/arch/src/lib.rs @@ -8,9 +8,6 @@ //! Implements platform specific functionality. //! Supported platforms: x86_64, aarch64, riscv64. -#[macro_use] -extern crate log; - use std::collections::BTreeMap; use std::sync::Arc; use std::{fmt, result}; diff --git a/arch/src/riscv64/fdt.rs b/arch/src/riscv64/fdt.rs index b30d2ce19..9ad66d367 100644 --- a/arch/src/riscv64/fdt.rs +++ b/arch/src/riscv64/fdt.rs @@ -15,6 +15,7 @@ use std::{cmp, result, str}; use byteorder::{BigEndian, ByteOrder}; 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}; diff --git a/arch/src/x86_64/mod.rs b/arch/src/x86_64/mod.rs index 51c2d02f0..e2cb1eab2 100644 --- a/arch/src/x86_64/mod.rs +++ b/arch/src/x86_64/mod.rs @@ -6,11 +6,19 @@ // Portions Copyright 2017 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE-BSD-3-Clause file. + pub mod interrupts; pub mod layout; +pub mod regs; + +#[cfg(feature = "tdx")] +pub mod tdx; + mod mpspec; mod mptable; -pub mod regs; +mod smbios; + +use std::arch::x86_64; use std::mem; use hypervisor::arch::x86::{CPUID_FLAG_VALID_INDEX, CpuIdEntry}; @@ -19,6 +27,7 @@ use linux_loader::loader::bootparam::{boot_params, setup_header}; use linux_loader::loader::elf::start_info::{ hvm_memmap_table_entry, hvm_modlist_entry, hvm_start_info, }; +use log::{debug, error, info}; use thiserror::Error; use vm_memory::{ Address, Bytes, GuestAddress, GuestAddressSpace, GuestMemory, GuestMemoryAtomic, @@ -26,10 +35,6 @@ use vm_memory::{ }; use crate::{GuestMemoryMmap, InitramfsConfig, RegionType}; -mod smbios; -use std::arch::x86_64; -#[cfg(feature = "tdx")] -pub mod tdx; // While modern architectures support more than 255 CPUs via x2APIC, // legacy devices such as mptable support at most 254 CPUs. diff --git a/arch/src/x86_64/mptable.rs b/arch/src/x86_64/mptable.rs index a0e6dc47e..c31c9e411 100644 --- a/arch/src/x86_64/mptable.rs +++ b/arch/src/x86_64/mptable.rs @@ -8,6 +8,7 @@ use std::{mem, result, slice}; use libc::c_uchar; +use log::{info, warn}; use thiserror::Error; use vm_memory::{Address, ByteValued, Bytes, GuestAddress, GuestMemory, GuestMemoryError}; diff --git a/arch/src/x86_64/tdx/mod.rs b/arch/src/x86_64/tdx/mod.rs index 4ce1aa9a0..a6ce96aae 100644 --- a/arch/src/x86_64/tdx/mod.rs +++ b/arch/src/x86_64/tdx/mod.rs @@ -5,6 +5,7 @@ use std::fs::File; use std::io::{Read, Seek, SeekFrom}; use std::str::FromStr; +use log::{debug, info}; use thiserror::Error; use uuid::Uuid; use vm_memory::{ByteValued, Bytes, GuestAddress, GuestMemoryError};