mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-07-04 17:02:36 +00:00
vmm: Limit "Dies" in VCPU topology on AArch64
`Dies per package` setting of VCPU topology doesnot apply on AArch64. Now we only accept `1` value. This way we can make the `dies` field transparent, avoid it from impacting the topology setting. Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
parent
bf6920f774
commit
0fc3fad363
|
@ -132,6 +132,9 @@ pub enum ValidationError {
|
||||||
CpuTopologyCount,
|
CpuTopologyCount,
|
||||||
/// One part of the CPU topology was zero
|
/// One part of the CPU topology was zero
|
||||||
CpuTopologyZeroPart,
|
CpuTopologyZeroPart,
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
|
/// Dies per package must be 1
|
||||||
|
CpuTopologyDiesPerPackage,
|
||||||
/// Virtio needs a min of 2 queues
|
/// Virtio needs a min of 2 queues
|
||||||
VnetQueueLowerThan2,
|
VnetQueueLowerThan2,
|
||||||
/// The input queue number for virtio_net must match the number of input fds
|
/// The input queue number for virtio_net must match the number of input fds
|
||||||
|
@ -181,6 +184,8 @@ impl fmt::Display for ValidationError {
|
||||||
f,
|
f,
|
||||||
"Product of CPU topology parts does not match maximum vCPUs"
|
"Product of CPU topology parts does not match maximum vCPUs"
|
||||||
),
|
),
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
|
CpuTopologyDiesPerPackage => write!(f, "Dies per package must be 1"),
|
||||||
VnetQueueLowerThan2 => write!(f, "Number of queues to virtio_net less than 2"),
|
VnetQueueLowerThan2 => write!(f, "Number of queues to virtio_net less than 2"),
|
||||||
VnetQueueFdMismatch => write!(
|
VnetQueueFdMismatch => write!(
|
||||||
f,
|
f,
|
||||||
|
@ -2188,6 +2193,14 @@ impl VmConfig {
|
||||||
return Err(ValidationError::CpuTopologyZeroPart);
|
return Err(ValidationError::CpuTopologyZeroPart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The setting of dies doesen't apply on AArch64.
|
||||||
|
// Only '1' value is accepted, so its impact on the vcpu topology
|
||||||
|
// setting can be ignored.
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
|
if t.dies_per_package != 1 {
|
||||||
|
return Err(ValidationError::CpuTopologyDiesPerPackage);
|
||||||
|
}
|
||||||
|
|
||||||
let total = t.threads_per_core * t.cores_per_die * t.dies_per_package * t.packages;
|
let total = t.threads_per_core * t.cores_per_die * t.dies_per_package * t.packages;
|
||||||
if total != self.cpus.max_vcpus {
|
if total != self.cpus.max_vcpus {
|
||||||
return Err(ValidationError::CpuTopologyCount);
|
return Err(ValidationError::CpuTopologyCount);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user