From 1608127c37a77679d0085b1158b2c0c3f46ec96d Mon Sep 17 00:00:00 2001 From: Zhao Liu Date: Wed, 27 Apr 2022 13:27:00 +0800 Subject: [PATCH] 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 Tested-by: kokoro Reviewed-by: Daniel Verkamp Commit-Queue: Junichi Uekawa Reviewed-by: Junichi Uekawa --- x86_64/src/cpuid.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x86_64/src/cpuid.rs b/x86_64/src/cpuid.rs index c40c59b54b..5ece766508 100644 --- a/x86_64/src/cpuid.rs +++ b/x86_64/src/cpuid.rs @@ -127,7 +127,7 @@ fn filter_cpuid( entry.ecx &= !(1 << ECX_EPB_SHIFT); // Set ITMT related features. - if itmt { + if host_cpu_topology || itmt { // Safe because we pass 6 for this call and the host // supports the `cpuid` instruction let result = unsafe { __cpuid(entry.function) };