mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
5c0b66529a
This PR addresses a bug in which the cpu topology of a guest with non power-of-two number of cores is incorrect. For example, in some contexts, a virtual machine with 2-sockets and 12-cores will incorrectly believe that 16 cores are on socket 1 and 8 cores are on socket 2. In other cases, common topology enumeration software such as hwloc will crash. The root of the problem was the way that cloud-hypervisor generates apic_id. On x86_64, the (x2) apic_id embeds information about cpu topology. The cpuid instruction is primarily used to discover the number of sockets, dies, cores, threads, etc. Using this information, the (x2) apic_id is masked to determine which {core, die, socket} the cpu is on. When the cpu topology is not a power of two (e.g. a 12-core machine), this requires non-contiguous (x2) apic_id. Signed-off-by: Thomas Barrett <tbarrett@crusoeenergy.com> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |