]> git.ipfire.org Git - thirdparty/qemu.git/commit
i386/cpu: fixup number of addressable IDs for processor cores in the physical package
authorChuang Xu <xuchuangxclwt@bytedance.com>
Tue, 11 Jun 2024 03:23:14 +0000 (11:23 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 1 Jul 2024 06:50:03 +0000 (09:50 +0300)
commit9804d797b9f9c139dcdd51b9e49b942aca834c83
treed6302a4506c6618e5df2c6761f809c89efa1c18a
parent3d7fa1b3e21bcd1015bf4d29c2ca80f487a76263
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: d7caf13b5fcf ("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 903916f0a017fe4b7789f1c6c6982333a5a71876)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: fixup for 7.2 due to other changes in this area past 8.2)
target/i386/cpu.c