crosvm/x86_64
Xiong Zhang 0a086e6cbe x86_64/cpuid.rs: Add cpu topology when no_smt isn't set
When no_smt isn't set, guest works with hyperthread enabled, but crosvm
doesn't emulate processor topology cpuid at this case, so the output of
guest /proc/cpuinfo and lscpu is inconsitent, and guest cpuid is wrong.

This commit adds such support. If vcpu_num is >1 and is even, threads
per core is 2 and cores_num is vcpu_num/2. If vcpu_num is >1 and is odd,
threads per core is vcpu_num and cores_num is 1.

BUG=None
TEST=Check guest /proc/cpuinfo, lscpu, cpuid at different vcpu number

Change-Id: I8d9aaeac3fc911ee91bf2eb0586e457aac27a185
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2548450
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2020-12-09 13:18:38 +00:00
..
src x86_64/cpuid.rs: Add cpu topology when no_smt isn't set 2020-12-09 13:18:38 +00:00
Cargo.toml linux: Support GDB remote serial protocol for x86_64 2020-11-12 08:47:59 +00:00