x86_64: Fix compatibility of HWP CPUID

Originally, crosvm expose some HWP related CPUID under
'host-cpu-topology', now this is moved under 'itmt' flag.

Before the 'itmt' option is set in initramfs, this may break some freq
related sysfs check. So fix this compatibility issue.

BUG=b:225375705
TEST=boot brya and check cpuinfo_max_freq under sysfs

Change-Id: Iaf7f1590717c12b166d41a0e410a8fd6f605f318
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3609238
Reviewed-by: Lepton Wu <lepton@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
This commit is contained in:
Zhao Liu 2022-04-27 13:27:00 +08:00 committed by Chromeos LUCI
parent fd277205e2
commit 1608127c37

View file

@ -127,7 +127,7 @@ fn filter_cpuid(
entry.ecx &= !(1 << ECX_EPB_SHIFT); entry.ecx &= !(1 << ECX_EPB_SHIFT);
// Set ITMT related features. // Set ITMT related features.
if itmt { if host_cpu_topology || itmt {
// Safe because we pass 6 for this call and the host // Safe because we pass 6 for this call and the host
// supports the `cpuid` instruction // supports the `cpuid` instruction
let result = unsafe { __cpuid(entry.function) }; let result = unsafe { __cpuid(entry.function) };