crosvm/x86_64
Slava Malyugin ac5a8dbe50 x86_64: fill cache info in cpuid, stop spoofing CPU vendor id
The fix passes through cache-related CPU entries 2, 4, 0x80000005
and 0x80000006 similar to how QEMU does it.

Note passing this cpuid info itself is not sufficient unless
CPU vendor is something Linux kernel recognizes. Therefore, I am
removing cute spoofing of the vendor id, allowing host value to
pass through.

I believe it is generally a bad idea to spoof vendor id as lots of
kernel and user space code gets confused and may take unoptimized paths.
The corollary is that removing the spoofing may have unintended
consequences correctness- and performance-wise. I would appreciate
recommendation on additional testing.

BUG=chromium:859678
TEST=lscpu in Guest, 'cargo test'

Change-Id: I6963b00d9eecf49fb4578bcc75ad744c3099f045
Reviewed-on: https://chromium-review.googlesource.com/1125529
Commit-Ready: Slava Malyugin <slavamn@chromium.org>
Tested-by: Slava Malyugin <slavamn@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2018-07-09 12:42:42 -07:00
..
src x86_64: fill cache info in cpuid, stop spoofing CPU vendor id 2018-07-09 12:42:42 -07:00
build.rs x86_64: fill cache info in cpuid, stop spoofing CPU vendor id 2018-07-09 12:42:42 -07:00
Cargo.toml x86_64: fill cache info in cpuid, stop spoofing CPU vendor id 2018-07-09 12:42:42 -07:00
host_cpuid.c x86_64: fill cache info in cpuid, stop spoofing CPU vendor id 2018-07-09 12:42:42 -07:00