mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
arch, vmm: Don't build mptable when using ACPI
Use the ACPI feature to control whether to build the mptable. This is necessary as the mptable and ACPI RSDP table can easily overwrite each other leading to it failing to boot. TEST=Compile with default features and see that --cpus boot=48 now works, try with --no-default-features --features "pci" and observe the --cpus boot=48 also continues to work. Fixes: #1132 Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -5,6 +5,7 @@ authors = ["The Chromium OS Authors"]
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
acpi = ["acpi_tables"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
byteorder = "1.3.4"
|
byteorder = "1.3.4"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
mod gdt;
|
mod gdt;
|
||||||
pub mod interrupts;
|
pub mod interrupts;
|
||||||
pub mod layout;
|
pub mod layout;
|
||||||
|
#[cfg(not(feature = "acpi"))]
|
||||||
mod mptable;
|
mod mptable;
|
||||||
pub mod regs;
|
pub mod regs;
|
||||||
|
|
||||||
@@ -90,6 +91,7 @@ unsafe impl ByteValued for BootParamsWrapper {}
|
|||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// Invalid e820 setup params.
|
/// Invalid e820 setup params.
|
||||||
E820Configuration,
|
E820Configuration,
|
||||||
|
#[cfg(not(feature = "acpi"))]
|
||||||
/// Error writing MP table to memory.
|
/// Error writing MP table to memory.
|
||||||
MpTableSetup(mptable::Error),
|
MpTableSetup(mptable::Error),
|
||||||
}
|
}
|
||||||
@@ -161,13 +163,14 @@ pub fn configure_system(
|
|||||||
cmdline_addr: GuestAddress,
|
cmdline_addr: GuestAddress,
|
||||||
cmdline_size: usize,
|
cmdline_size: usize,
|
||||||
initramfs: &Option<InitramfsConfig>,
|
initramfs: &Option<InitramfsConfig>,
|
||||||
num_cpus: u8,
|
_num_cpus: u8,
|
||||||
setup_hdr: Option<setup_header>,
|
setup_hdr: Option<setup_header>,
|
||||||
rsdp_addr: Option<GuestAddress>,
|
rsdp_addr: Option<GuestAddress>,
|
||||||
boot_prot: BootProtocol,
|
boot_prot: BootProtocol,
|
||||||
) -> super::Result<()> {
|
) -> super::Result<()> {
|
||||||
// Note that this puts the mptable at the last 1k of Linux's 640k base RAM
|
// 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
|
// Check that the RAM is not smaller than the RSDP start address
|
||||||
if let Some(rsdp_addr) = rsdp_addr {
|
if let Some(rsdp_addr) = rsdp_addr {
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ edition = "2018"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
acpi = ["acpi_tables","devices/acpi"]
|
acpi = ["acpi_tables","devices/acpi", "arch/acpi"]
|
||||||
pci_support = ["pci", "vfio", "vm-virtio/pci_support"]
|
pci_support = ["pci", "vfio", "vm-virtio/pci_support"]
|
||||||
mmio_support = ["vm-virtio/mmio_support"]
|
mmio_support = ["vm-virtio/mmio_support"]
|
||||||
cmos = ["devices/cmos"]
|
cmos = ["devices/cmos"]
|
||||||
|
|||||||
Reference in New Issue
Block a user