diff options
author | Qian Wen <qian.wen@intel.com> | 2025-07-14 16:08:58 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-07-14 10:29:17 +0200 |
commit | 3e86124e7cb9b66e07fb992667865a308f16fcf2 (patch) | |
tree | 6f8d7599c15ca75daec4ee71fea21962301822b5 /scripts/rust/rustc_args.py | |
parent | a62fef58299562aae6667b8d8552247423e886b3 (diff) | |
download | qemu-3e86124e7cb9b66e07fb992667865a308f16fcf2.zip qemu-3e86124e7cb9b66e07fb992667865a308f16fcf2.tar.gz qemu-3e86124e7cb9b66e07fb992667865a308f16fcf2.tar.bz2 |
i386/cpu: Fix overflow of cache topology fields in CPUID.04H
According to SDM, CPUID.0x4:EAX[31:26] indicates the Maximum number of
addressable IDs for processor cores in the physical package. If we
launch over 64 cores VM, the 6-bit field will overflow, and the wrong
core_id number will be reported.
Since the HW reports 0x3f when the intel processor has over 64 cores,
limit the max value written to EAX[31:26] to 63, so max num_cores should
be 64.
For EAX[14:25], though at present Q35 supports up to 4096 CPUs, by
constructing a specific topology, the width of the APIC ID can be
extended beyond 12 bits. For example, using `-smp threads=33,cores=9,
modules=9` results in a die level offset of 6 + 4 + 4 = 14 bits, which
can also cause overflow. check and honor the maximum value for
EAX[14:25] as well.
In addition, for host-cache-info case, also apply the same checks and
fixes.
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Qian Wen <qian.wen@intel.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250714080859.1960104-7-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'scripts/rust/rustc_args.py')
0 files changed, 0 insertions, 0 deletions