mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-23 03:42:20 +00:00
vmm: acpi: Create the CPU entries in the DSDT for all vCPUs
CPU entries need to be created for every potential vCPU in the system. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
791ca3388f
commit
ae9359c859
@ -196,7 +196,7 @@ impl Aml for CPUMethods {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_cpu_data(num_cpus: u8) -> Vec<u8> {
|
fn create_cpu_data(max_vcpus: u8) -> Vec<u8> {
|
||||||
let mut bytes = Vec::new();
|
let mut bytes = Vec::new();
|
||||||
// CPU hotplug controller
|
// CPU hotplug controller
|
||||||
bytes.extend_from_slice(
|
bytes.extend_from_slice(
|
||||||
@ -250,7 +250,7 @@ fn create_cpu_data(num_cpus: u8) -> Vec<u8> {
|
|||||||
let mut cpu_data_inner: Vec<&dyn aml::Aml> = vec![&hid, &uid, &methods];
|
let mut cpu_data_inner: Vec<&dyn aml::Aml> = vec![&hid, &uid, &methods];
|
||||||
|
|
||||||
let mut cpu_devices = Vec::new();
|
let mut cpu_devices = Vec::new();
|
||||||
for cpu_id in 0..num_cpus {
|
for cpu_id in 0..max_vcpus {
|
||||||
let cpu_device = CPU { cpu_id };
|
let cpu_device = CPU { cpu_id };
|
||||||
|
|
||||||
cpu_devices.push(cpu_device);
|
cpu_devices.push(cpu_device);
|
||||||
@ -268,7 +268,7 @@ pub fn create_dsdt_table(
|
|||||||
serial_enabled: bool,
|
serial_enabled: bool,
|
||||||
start_of_device_area: GuestAddress,
|
start_of_device_area: GuestAddress,
|
||||||
end_of_device_area: GuestAddress,
|
end_of_device_area: GuestAddress,
|
||||||
num_cpus: u8,
|
max_vcpus: u8,
|
||||||
) -> SDT {
|
) -> SDT {
|
||||||
let pci_dsdt_data = aml::Device::new(
|
let pci_dsdt_data = aml::Device::new(
|
||||||
"_SB_.PCI0".into(),
|
"_SB_.PCI0".into(),
|
||||||
@ -341,7 +341,7 @@ pub fn create_dsdt_table(
|
|||||||
let s5_sleep_data =
|
let s5_sleep_data =
|
||||||
aml::Name::new("_S5_".into(), &aml::Package::new(vec![&5u8])).to_aml_bytes();
|
aml::Name::new("_S5_".into(), &aml::Package::new(vec![&5u8])).to_aml_bytes();
|
||||||
|
|
||||||
let cpu_data = create_cpu_data(num_cpus);
|
let cpu_data = create_cpu_data(max_vcpus);
|
||||||
|
|
||||||
// DSDT
|
// DSDT
|
||||||
let mut dsdt = SDT::new(*b"DSDT", 36, 6, *b"CLOUDH", *b"CHDSDT ", 1);
|
let mut dsdt = SDT::new(*b"DSDT", 36, 6, *b"CLOUDH", *b"CHDSDT ", 1);
|
||||||
@ -374,7 +374,7 @@ pub fn create_acpi_tables(
|
|||||||
serial_enabled,
|
serial_enabled,
|
||||||
start_of_device_area,
|
start_of_device_area,
|
||||||
end_of_device_area,
|
end_of_device_area,
|
||||||
boot_vcpus,
|
max_vcpus,
|
||||||
);
|
);
|
||||||
let dsdt_offset = rsdp_offset.checked_add(RSDP::len() as u64).unwrap();
|
let dsdt_offset = rsdp_offset.checked_add(RSDP::len() as u64).unwrap();
|
||||||
guest_mem
|
guest_mem
|
||||||
|
@ -513,7 +513,7 @@ impl Vm {
|
|||||||
)
|
)
|
||||||
.map_err(|_| Error::CmdLine)?;
|
.map_err(|_| Error::CmdLine)?;
|
||||||
let boot_vcpus = self.cpu_manager.lock().unwrap().boot_vcpus();
|
let boot_vcpus = self.cpu_manager.lock().unwrap().boot_vcpus();
|
||||||
let max_vcpus = self.cpu_manager.lock().unwrap().max_vcpus();
|
let _max_vcpus = self.cpu_manager.lock().unwrap().max_vcpus();
|
||||||
|
|
||||||
#[allow(unused_mut, unused_assignments)]
|
#[allow(unused_mut, unused_assignments)]
|
||||||
let mut rsdp_addr: Option<GuestAddress> = None;
|
let mut rsdp_addr: Option<GuestAddress> = None;
|
||||||
@ -534,7 +534,7 @@ impl Vm {
|
|||||||
crate::acpi::create_acpi_tables(
|
crate::acpi::create_acpi_tables(
|
||||||
&mem,
|
&mem,
|
||||||
boot_vcpus,
|
boot_vcpus,
|
||||||
max_vcpus,
|
_max_vcpus,
|
||||||
self.config.serial.mode != ConsoleOutputMode::Off,
|
self.config.serial.mode != ConsoleOutputMode::Off,
|
||||||
start_of_device_area,
|
start_of_device_area,
|
||||||
end_of_range,
|
end_of_range,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user