mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 05:03:05 +00:00
2aaf7ad9fc
At present the Guest generates its own CPU topology. To mitigate cross-hyperthread speculative execution side channel attacks, allow Guest to use mirror CPU topology of Host is needed for future scheduling optimization. Add a config option "--host-cpu-topology" to ask the vCPU number to be identical to physical CPUs, and make the vCPU has the same APIC ID in MADT and CPUID as the corresponding physical CPU. The same APIC ID can ensure the same topology. "--host-cpu-topology" requires vCPU number must equal to pCPU number, and it has the default vCPU number setting, which equals to pCPU number. "--host-cpu-topology" also defaultly sets CPU affinity for each vCPU to the pCPU which has the same processor ID, like 1=1:2=2:3=3:4=4, so that the vCPU and its corresponding pCPU will have the same processor ID and the same APIC ID. User can't set CPU affinity if "--host-cpu-topology" was set. BUG=b:197875305 TEST=Set "--host-cpu-topology" option and check Guest's /proc/cpuinfo, lscpu, CPUID for different vCPU Change-Id: Ibc4eb10649e89f43b81bde6d46d6e0e6c7234324 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3217035 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |