qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6] i386/cpu: fixup number of addressable IDs for logical pro


From: Xiaoyao Li
Subject: Re: [PATCH v6] i386/cpu: fixup number of addressable IDs for logical processors in the physical package
Date: Tue, 3 Dec 2024 23:04:12 +0800
User-agent: Mozilla Thunderbird

On 12/3/2024 3:33 PM, Zhao Liu wrote:
However, back to the patch, I think we cannot change it as this patch
directly. Instead, we need a compat_props for the changed behavior, because
this isn't a bug fix and it introduces guest-visible differences.

This is a fix, not a new feature, so compat_props is not needed.

Fix what? QEMU behaves as it for so many years and if the guest OS uses the algorithm recommended by SDM, there is no issue.

For ancient Intel CPUs, EBX[23:16] did represent the number of Logical
processor per package. I believe this should be the reason why QEMU
implemented it as is:

   - on SDM version 013, EBX[23:16]: Number of logical processors per
physical processor; two for the Pentium 4 processor supporting
Hyper-Threading Technology.

   - on SDM version 015, it changed to: Number of initial APIC IDs reserved
for this physical package. Normally, this is the number of logical
processors per physical package.

   - on SDM version 016, it changed to: Maximum number of logical processors
in this physical package.

   - finally, starting from SDM version 026, it changed to what reads now:
Maximum number of addressable IDs for logical processors in this physical
package.

And this is an architecturally defined CPUID, so SDM ensures backward
compatibility.

SDM ensure the backwards compatibility by recommending to round the number up to the power-of 2 when using it to calculate the topology with legacy method.

Regards,
Zhao





reply via email to

[Prev in Thread] Current Thread [Next in Thread]