diff --git a/arch/Cargo.toml b/arch/Cargo.toml index 4e0cfbf17..ad7054525 100644 --- a/arch/Cargo.toml +++ b/arch/Cargo.toml @@ -5,6 +5,7 @@ authors = ["The Chromium OS Authors"] [features] default = [] +acpi = ["acpi_tables"] [dependencies] byteorder = "1.3.4" diff --git a/arch/src/x86_64/mod.rs b/arch/src/x86_64/mod.rs index 1986886d0..5c8ce9a2f 100644 --- a/arch/src/x86_64/mod.rs +++ b/arch/src/x86_64/mod.rs @@ -10,6 +10,7 @@ mod gdt; pub mod interrupts; pub mod layout; +#[cfg(not(feature = "acpi"))] mod mptable; pub mod regs; @@ -90,6 +91,7 @@ unsafe impl ByteValued for BootParamsWrapper {} pub enum Error { /// Invalid e820 setup params. E820Configuration, + #[cfg(not(feature = "acpi"))] /// Error writing MP table to memory. MpTableSetup(mptable::Error), } @@ -161,13 +163,14 @@ pub fn configure_system( cmdline_addr: GuestAddress, cmdline_size: usize, initramfs: &Option, - num_cpus: u8, + _num_cpus: u8, setup_hdr: Option, rsdp_addr: Option, boot_prot: BootProtocol, ) -> super::Result<()> { // Note that this puts the mptable at the last 1k of Linux's 640k base RAM - mptable::setup_mptable(guest_mem, num_cpus).map_err(Error::MpTableSetup)?; + #[cfg(not(feature = "acpi"))] + mptable::setup_mptable(guest_mem, _num_cpus).map_err(Error::MpTableSetup)?; // Check that the RAM is not smaller than the RSDP start address if let Some(rsdp_addr) = rsdp_addr { diff --git a/vmm/Cargo.toml b/vmm/Cargo.toml index de7259964..87e875d8c 100644 --- a/vmm/Cargo.toml +++ b/vmm/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [features] default = [] -acpi = ["acpi_tables","devices/acpi"] +acpi = ["acpi_tables","devices/acpi", "arch/acpi"] pci_support = ["pci", "vfio", "vm-virtio/pci_support"] mmio_support = ["vm-virtio/mmio_support"] cmos = ["devices/cmos"]