This patch series introduces a new cpu topolgy 'die' for PCMachine, which extends virtual cpu topology to the socket/die/core/thread model, allowing the setting of dies number per one socket via -smp qemu command.
For i386, it upgrades APIC-IDs generation and reversion functions with a new exposed leaf called CPUID.1F, which is a preferred superset to leaf 0BH. The CPUID.1F spec is on the latest Inetl SDM, 3-190 Vol 2A. Guest system could discover multi-die/package topology through CPUID.1F. and its benefit is primarily for _reporting_ of the guest CPU topology. The guest kernel with multi-die/package support have no impact on its cache topology, NUMA topology, Linux scheduler, or system performance. ==changelog== v4: - base commit: 22fa84da on github.com/ehabkost/qemu.git:machine-next - refine comments for pc_smp_parse() - remove the use of cpu->enable_cpuid_0x1f - apply new logic for cpuid_min_level adjustment and drop the legacy one - refine the way of MachineState casting in pc_smp_parse() - [QUEUED] move test_topo_bits to the previous patch for bisectability v3: https://patchwork.kernel.org/cover/10989013/ - add a MachineClass::smp_parse function pointer - place the PC-specific function inside hw/i386/pc.c - introduce die_id in a separate patch with default value 0 - set env->nr_dies in pc_new_cpu() and pc_cpu_pre_plug() - fix a circular dependency between target/i386/cpu.c and hw/i386/pc.c - fix cpu->die_id check in pc_cpu_pre_plug() - Based on "[PATCH v3 00/10] Refactor cpu topo into machine properties" - Rebase to commit 219dca61ebf41625831d4f96a720852baf44b762 v2: https://patchwork.kernel.org/cover/10953191/ - Enable cpu die-level topolgy only for PCMachine and X86CPU - Minimize cpuid.0.eax to the setting value actually used by guest - Update cmd line -smps docs for die-level configurations - Refactoring topo-bit tests for x86_apicid_from_cpu_idx() with nr_dies - Based on "[PATCH v3 00/10] Refactor cpu topo into machine properties" - Rebase to commit 2259637b95bef3116cc262459271de08e038cc66 v1: https://patchwork.kernel.org/cover/10876667/ Like Xu (3): target/i386: Add CPUID.1F generation support for multi-dies PCMachine machine: Refactor smp_parse() in vl.c as MachineClass::smp_parse() vl.c: Add -smp, dies=* command line support and update doc hw/core/machine.c | 76 ++++++++++++++++++++++++++++++++++++++++ hw/i386/pc.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ include/hw/boards.h | 5 +++ include/hw/i386/pc.h | 1 + qemu-options.hx | 17 ++++----- target/i386/cpu.c | 41 ++++++++++++++++++++++ target/i386/cpu.h | 1 + target/i386/kvm.c | 12 +++++++ vl.c | 78 +++-------------------------------------- 9 files changed, 233 insertions(+), 81 deletions(-) -- 2.21.0