diff --git a/docs/memory.md b/docs/memory.md index 7320eef59..cace76835 100644 --- a/docs/memory.md +++ b/docs/memory.md @@ -451,3 +451,10 @@ _Example_ --numa guest_numa_id=0,memory_zones=mem0:mem2 --numa guest_numa_id=1,memory_zones=mem1 ``` + +### PCI bus + +Cloud Hypervisor supports only one PCI bus, which is why it has been tied to +the NUMA node 0 by default. It is the user responsibility to organize the NUMA +nodes correctly so that vCPUs and guest RAM which should be located on the same +NUMA node as the PCI bus end up on the NUMA node 0. \ No newline at end of file diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index cde9673c7..0edf33be6 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -3744,6 +3744,14 @@ impl Aml for DeviceManager { let supp = aml::Name::new("SUPP".into(), &aml::ZERO); pci_dsdt_inner_data.push(&supp); + // Since Cloud Hypervisor supports only one PCI bus, it can be tied + // to the NUMA node 0. It's up to the user to organize the NUMA nodes + // so that the PCI bus relates to the expected vCPUs and guest RAM. + let proximity_domain = 0u32; + let pxm_return = aml::Return::new(&proximity_domain); + let pxm = aml::Method::new("_PXM".into(), 0, false, vec![&pxm_return]); + pci_dsdt_inner_data.push(&pxm); + let pci_dsm = PciDsmMethod {}; pci_dsdt_inner_data.push(&pci_dsm);