qemu-e2k/include
Greg Kurz 648edb6475 spapr: move VCPU calculation to core machine code
The VCPU ids are currently computed and assigned to each individual
CPU threads in spapr_cpu_core_realize(). But the numbering logic
of VCPU ids is actually a machine-level concept, and many places
in hw/ppc/spapr.c also have to compute VCPU ids out of CPU indexes.

The current formula used in spapr_cpu_core_realize() is:

    vcpu_id = (cc->core_id * spapr->vsmt / smp_threads) + i

where:

    cc->core_id is a multiple of smp_threads
    cpu_index = cc->core_id + i
    0 <= i < smp_threads

So we have:

    cpu_index % smp_threads == i
    cc->core_id / smp_threads == cpu_index / smp_threads

hence:

    vcpu_id =
        (cpu_index / smp_threads) * spapr->vsmt + cpu_index % smp_threads;

This formula was used before VSMT at the time VCPU ids where computed
at the target emulation level. It has the advantage of being useable
to derive a VPCU id out of a CPU index only. It is fitted for all the
places where the machine code has to compute a VCPU id.

This patch introduces an accessor to set the VCPU id in a PowerPCCPU object
using the above formula. It is a first step to consolidate all the VCPU id
logic in a single place.

Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-02-16 12:14:26 +11:00
..
block block: maintain persistent disabled bitmaps 2018-02-13 16:59:58 +01:00
chardev Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
crypto Include qapi/error.h exactly where needed 2018-02-09 13:50:17 +01:00
disas target/xtensa: implement disassembler 2018-01-09 09:55:39 -08:00
exec memory: hide memory_region_sync_dirty_bitmap behind DirtyBitmapSnapshot 2018-02-13 16:15:09 +01:00
fpu
hw spapr: move VCPU calculation to core machine code 2018-02-16 12:14:26 +11:00
io io: introduce a network socket listener API 2017-12-15 15:07:26 +00:00
libdecnumber
migration virtio,vhost,pci,pc: features, fixes and cleanups 2018-02-13 16:33:31 +00:00
monitor Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
net net/can: simple messages transport implementation for QEMU 2018-02-13 11:44:13 +01:00
qapi Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
qemu ratelimit: don't align wait time with slices 2018-02-15 09:39:49 +00:00
qom Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
scsi Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
standard-headers virtio-balloon: include statistics of disk/file caches 2018-02-13 18:29:35 +02:00
sysemu hax: Support guest RAM sizes of 4GB or more 2018-02-13 11:44:13 +01:00
ui Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
elf.h
glib-compat.h
qemu-common.h Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
qemu-io.h
trace-tcg.h