RFC Fix APIC-ID-based CPU topology
Get series with b4
b4 am [email protected]Versions newest first
- v2 RFC Latest18 patches 25 repliesIn review
Changes in v2 from the cover letter
* Created a qemu-stdio.h file for some I/O related definitions
* Now all the topology-based APIC ID calculation logic is inside pc.c
* I have now created a "PC" object just to carry the machine-type compatibility flag that keeps the previous behavior.
* Dropped the qemu_global_get() function, as it is not needed anymore
* Fixed compile errors on non-x86 targets with KVM enabled (ppc, s390x)
* Add more descriptive comments on THE FW_CFG_MAX_CPUS calculation
* Add pointers to documentation on topology.h
Patches in v2 No applies recorded yet
Reviews trailers per patch
1 of 18 patches has a Reviewed-by or Acked-by.
| Patch | Blue Swirl |
|---|---|
| 1/18 | |
| 2/18 | |
| 3/18 | |
| 4/18 | |
| 5/18 | |
| 6/18 | |
| 7/18 | |
| 8/18 | |
| 9/18 | |
| 10/18 | |
| 11/18 | |
| 12/18 | |
| 13/18 | |
| 14/18 | |
| 15/18 | |
| 16/18 | |
| 17/18 | A-b |
| 18/18 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [Qemu-devel] [RFC v2 00/18] Fix APIC-ID-based CPU topology
Bug description:
The CPU APIC IDs generated by QEMU are broken if the number of cores-per-socket or threads-per-core are not powers of 2, as the bits on the APIC ID do not correspond to what's expected to reflect the CPU sockets/cores/threads topology[1].
[1] http://software.intel.com/en-us/articles/intel-64-architecture-processor-topolog
y-enumeration/
Changes v1 -> v2:
* Created a qemu-stdio.h file for some I/O related definitions
* Now all the topology-based APIC ID calculation logic is inside pc.c
* I have now created a "PC" object just to carry the machine-type compatibility flag that keeps the previous behavior.
* Dropped the qemu_global_get() function, as it is not needed anymore
* Fixed compile errors on non-x86 targets with KVM enabled (ppc, s390x)
* Add more descriptive comments on THE FW_CFG_MAX_CPUS calculation
* Add pointers to documentation on topology.h
This series is based on the cpu-queue branch, from:
https://github.com/ehabkost/qemu/commits/cpu-queue
(more exactly, it was based on commit 8ffa1dbb0f4efa3d465d66bcdfbf545c350fe3ae)
This series is available on git, at:
https://github.com/ehabkost/qemu-hacks/commits/work/apicid-rfc-v2-2012-10-03
Eduardo Habkost (18):
pc: create "PC" device class
pc: create PC object on pc_init1()
pc: add PC object argument to some init functions move I/O-related definitions from qemu-common.h to a new header
(qemu-stdio.h)
cpus.h: include cpu-stdio.h
hw/apic.c: rename bit functions to not conflict with bitops.h (v2)
kvm: create kvm_arch_vcpu_id() function
target-i386: kvm: set vcpu_id to APIC ID instead of CPU index (v2)
target-i386: cpu: move cpuid_apic_id initialization to
cpu_x86_register() target-i386: cpu: add apic_id argument to cpu_x86_register()
target-i386: cpu_x86_init: allow APIC ID to be set by caller
fw_cfg: remove FW_CFG_MAX_CPUS from fw_cfg_init()
pc: set explicit APIC ID for CPUs
pc: create apic_id_for_cpu() function (v3)
pc: set fw_cfg data based on APIC ID calculation (v2)
tests: support target-specific unit tests
target-i386: topology & APIC ID utility functions (v2)
pc: generate APIC IDs according to CPU topology (v3)
cpus.h | 2 + hw/apic.c | 35 ++++++------- hw/fw_cfg.c | 1 - hw/pc.c | 125 ++++++++++++++++++++++++++++++++++++++++------ hw/pc.h | 11 +++- hw/pc_piix.c | 11 +++- hw/ppc_newworld.c | 1 + hw/ppc_oldworld.c | 1 + hw/sun4m.c | 3 ++ hw/sun4u.c | 1 + kvm-all.c | 2 +- kvm.h | 3 ++ qemu-common.h | 57 +-------------------- qemu-stdio.h | 73 +++++++++++++++++++++++++++ target-i386/cpu.c | 6 +-- target-i386/cpu.h | 6 +-- target-i386/helper.c | 15 +++++- target-i386/kvm.c | 5 ++ target-i386/topology.h | 133 +++++++++++++++++++++++++++++++++++++++++++++++++ target-ppc/kvm.c | 5 ++ target-s390x/kvm.c | 5 ++ tests/.gitignore | 1 + tests/Makefile | 19 +++++-- tests/test-x86-cpuid.c | 102 +++++++++++++++++++++++++++++++++++++ 24 files changed, 519 insertions(+), 104 deletions(-) create mode 100644 qemu-stdio.h create mode 100644 target-i386/topology.h create mode 100644 tests/test-x86-cpuid.c
Signature · 1 line
1.7.11.4