mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +00:00
aarch64: fdt: Use more appropriate default value for topology
Now, default values for vcpu topology are 0s, that is not correct and may lead to bug. Fix it by setting default value to 1s. Also add check in case one or more of these values are zero. Fixes: #5892 Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
This commit is contained in:
parent
1670a5d8af
commit
2434e76ee0
@ -290,10 +290,7 @@ fn create_cpu_nodes(
|
||||
fdt.property_u32("#size-cells", 0x0)?;
|
||||
|
||||
let num_cpus = vcpu_mpidr.len();
|
||||
let threads_per_core = vcpu_topology.unwrap_or_default().0;
|
||||
let cores_per_package = vcpu_topology.unwrap_or_default().1;
|
||||
let packages = vcpu_topology.unwrap_or_default().2;
|
||||
|
||||
let (threads_per_core, cores_per_package, packages) = vcpu_topology.unwrap_or((1, 1, 1));
|
||||
let max_cpus: u32 = (threads_per_core * cores_per_package * packages).into();
|
||||
|
||||
// Add cache info.
|
||||
|
Loading…
Reference in New Issue
Block a user