qemu/target/i386
Chuang Xu 9804d797b9 i386/cpu: fixup number of addressable IDs for processor cores in the physical package
When QEMU is started with:
-cpu host,host-cache-info=on,l3-cache=off \
-smp 2,sockets=1,dies=1,cores=1,threads=2
Guest can't acquire maximum number of addressable IDs for processor cores in
the physical package from CPUID[04H].

When creating a CPU topology of 1 core per package, host-cache-info only
uses the Host's addressable core IDs field (CPUID.04H.EAX[bits 31-26]),
resulting in a conflict (on the multicore Host) between the Guest core
topology information in this field and the Guest's actual cores number.

Fix it by removing the unnecessary condition to cover 1 core per package
case. This is safe because cores_per_pkg will not be 0 and will be at
least 1.

Fixes: d7caf13b5f ("x86: cpu: fixup number of addressable IDs for logical processors sharing cache")
Signed-off-by: Guixiong Wei <weiguixiong@bytedance.com>
Signed-off-by: Yipeng Yin <yinyipeng@bytedance.com>
Signed-off-by: Chuang Xu <xuchuangxclwt@bytedance.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-ID: <20240611032314.64076-1-xuchuangxclwt@bytedance.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 903916f0a0)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: fixup for 7.2 due to other changes in this area past 8.2)
2024-07-01 09:50:03 +03:00
..
hax
hvf hvf: Enable RDTSCP support 2022-07-13 00:05:39 +02:00
kvm target-i386: hyper-v: Correct kvm_hv_handle_exit return value 2024-05-27 07:30:35 +03:00
nvmm
tcg target/i386: fix size of EBP writeback in gen_enter() 2024-06-11 10:02:23 +03:00
whpx Drop useless casts from g_malloc() & friends to pointer 2022-10-22 23:15:40 +02:00
arch_dump.c dump: Replace opaque DumpState pointer with a typed one 2022-10-06 19:30:43 +04:00
arch_memory_mapping.c
cpu-dump.c
cpu-internal.h
cpu-param.h target/i386: use separate MMU indexes for 32-bit accesses 2024-04-09 20:06:31 +03:00
cpu-qom.h
cpu-sysemu.c Fix 'writeable' typos 2022-06-08 19:38:47 +01:00
cpu.c i386/cpu: fixup number of addressable IDs for processor cores in the physical package 2024-07-01 09:50:03 +03:00
cpu.h target/i386: fix direction of "32-bit MMU" test 2024-04-09 20:09:20 +03:00
gdbstub.c
helper.c target/i386: Revert monitor_puts() in do_inject_x86_mce() 2024-04-09 20:09:20 +03:00
helper.h target/i386: Expand eflags updates inline 2022-11-01 08:31:41 +11:00
host-cpu.c
host-cpu.h
Kconfig
machine.c i386: kvm: extend kvm_{get, put}_vcpu_events to support pending triple fault 2022-10-10 09:23:16 +02:00
meson.build
monitor.c
ops_sse_header.h target/i386: implement FMA instructions 2022-10-22 09:05:54 +02:00
ops_sse.h target/i386: fix avx2 instructions vzeroall and vpermdq 2023-05-18 21:10:00 +03:00
sev-sysemu-stub.c
sev.c
sev.h
shift_helper_template.h
svm.h
trace-events
trace.h
xsave_helper.c