diff options
author | EwanHai <ewanhai-oc@zhaoxin.com> | 2025-01-13 02:44:13 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-02-26 09:56:18 +0100 |
commit | a4e749780bd20593c0c386612a51bf4d64a80132 (patch) | |
tree | 15cb4a428d8f38badec88d5ef090805d79a098bb /rust/qemu-api/src/qdev.rs | |
parent | ff04bc1ac478656e5d6a255bf4069edb3f55bc58 (diff) | |
download | qemu-a4e749780bd20593c0c386612a51bf4d64a80132.zip qemu-a4e749780bd20593c0c386612a51bf4d64a80132.tar.gz qemu-a4e749780bd20593c0c386612a51bf4d64a80132.tar.bz2 |
target/i386: Mask CMPLegacy bit in CPUID[0x80000001].ECX for Zhaoxin CPUs
Zhaoxin CPUs (including vendors "Shanghai" and "Centaurhauls") handle the
CMPLegacy bit similarly to Intel CPUs. Therefore, this commit masks the
CMPLegacy bit in CPUID[0x80000001].ECX for Zhaoxin CPUs, just as it is done
for Intel CPUs.
AMD uses the CMPLegacy bit (CPUID[0x80000001].ECX.bit1) along with other CPUID
information to enumerate platform topology (e.g., the number of logical
processors per package). However, for Intel and other CPUs that follow Intel's
behavior, CPUID[0x80000001].ECX.bit1 is reserved.
- Impact on Intel and similar CPUs:
This change has no effect on Intel and similar CPUs, as the goal is to
accurately emulate CPU CPUID information.
- Impact on Linux Guests running on Intel (and similar) vCPUs:
During boot, Linux checks if the CPU supports Hyper-Threading. For the Linux
kernel before v6.9, if it detects X86_FEATURE_CMP_LEGACY, it assumes
Hyper-Threading is not supported. For Intel and similar vCPUs, if the
CMPLegacy bit is not masked in CPUID[0x80000001].ECX, Linux will incorrectly
assume that Hyper-Threading is not supported, even if the vCPU does support it.
Signed-off-by: EwanHai <ewanhai-oc@zhaoxin.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250113074413.297793-5-ewanhai-oc@zhaoxin.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/qemu-api/src/qdev.rs')
0 files changed, 0 insertions, 0 deletions