New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 859678 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 9
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

CPU info isn't complete in the guest

Project Member Reported by dgreid@chromium.org, Jul 2

Issue description

In particular the cache sizes aren't reported to the guest. This causes some mathmatical apps to misbehave(https://www.reddit.com/r/Crostini/comments/8o56q4/numpy_linear_algebra_is_broken_inside_crostini/)

There is an upstream patch to allow KVM to report this info, however simply applying that to the chrome OS host kernel didn't seem to help.
https://patchwork.kernel.org/patch/10441377/

running "lscpu" in the guest doesn't show cache sizes.

There isn't a "cache" folder under /sys/devices/system/cpu/cpu*
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/ac5a8dbe505daf95a802cc606988bc2323087a05

commit ac5a8dbe505daf95a802cc606988bc2323087a05
Author: Slava Malyugin <slavamn@google.com>
Date: Mon Jul 09 19:42:42 2018

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>

[modify] https://crrev.com/ac5a8dbe505daf95a802cc606988bc2323087a05/x86_64/src/cpuid.rs
[modify] https://crrev.com/ac5a8dbe505daf95a802cc606988bc2323087a05/Cargo.lock
[add] https://crrev.com/ac5a8dbe505daf95a802cc606988bc2323087a05/x86_64/build.rs
[add] https://crrev.com/ac5a8dbe505daf95a802cc606988bc2323087a05/x86_64/host_cpuid.c
[modify] https://crrev.com/ac5a8dbe505daf95a802cc606988bc2323087a05/x86_64/Cargo.toml

Status: Fixed (was: Assigned)

Sign in to add a comment