arch: vmm: disable nested virtualization if needed

User can now disable nested virtualization for Intel and AMD
if configured by the CLI.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Muminul Islam
2025-10-27 16:28:21 -07:00
committed by Rob Bradford
parent d8360ddc8e
commit 658a7f9175
3 changed files with 26 additions and 0 deletions

View File

@@ -455,6 +455,7 @@ impl Vcpu {
#[cfg(target_arch = "x86_64")] cpuid: Vec<CpuIdEntry>,
#[cfg(target_arch = "x86_64")] kvm_hyperv: bool,
#[cfg(target_arch = "x86_64")] topology: (u16, u16, u16, u16),
#[cfg(target_arch = "x86_64")] nested: bool,
) -> Result<()> {
#[cfg(target_arch = "aarch64")]
{
@@ -475,6 +476,7 @@ impl Vcpu {
kvm_hyperv,
self.vendor,
topology,
nested,
)
.map_err(Error::VcpuConfiguration)?;
@@ -995,6 +997,7 @@ impl CpuManager {
self.cpuid.clone(),
self.config.kvm_hyperv,
topology,
self.config.nested,
)?;
#[cfg(target_arch = "aarch64")]