mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: acpi: provide FADT PM1a event/control blocks for nested Hyper-V
A Windows guest that launches nested Hyper-V (for example to run WSL2) fails to start its hypervisor on cloud-hypervisor's HW-reduced-ACPI FADT. hvloader's hypervisor-launch path (0x18000f01c -> 0x180015628 -> 0x180015788) registers every legacy PM register block via 0x1800158dc and rejects any block whose GAS address is 0 with status 8 (STATUS_INVALID_DEVICE_REQUEST). hvix64 then never launches and HypervisorPresent stays False. The HW-reduced FADT leaves those blocks zero. Emit valid PM1a event/control blocks (I/O ports, lengths and X_GAS) in the FADT and reserve those ports in the I/O allocator so nothing else claims them. The HW-reduced guest OS ignores the legacy ports; only hvloader's ACPI validation reads them. These blocks are only useful to a guest that itself runs an enlightened hypervisor, so emit them only when both guest nesting and the Hyper-V enlightenments are enabled (--cpu nested=on,kvm_hyperv=on). Signed-off-by: doge <me@crackerben.com>
This commit is contained in:
@@ -1089,6 +1089,16 @@ impl CpuManager {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub fn nested(&self) -> bool {
|
||||
self.config.nested
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub fn kvm_hyperv(&self) -> bool {
|
||||
self.config.kvm_hyperv
|
||||
}
|
||||
|
||||
/// Only create new vCPUs if there aren't any inactive ones to reuse
|
||||
fn create_vcpus(
|
||||
&mut self,
|
||||
|
||||
Reference in New Issue
Block a user