Skip to content

RFC fix migration issues after hotplug a discontinuous cpuid

Chen Fan qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3target-i386: moving registers of vmstate from cpu_exec_init() to x86_cpu_realizefn()exec.c target-i386/cpu.c+14 -049 replies
2/3target-i386: add -smp X,apics=0x optionhw/i386/pc.c include/sysemu/sysemu.h qemu-options.hx +1 more+84 -62 replies
3/3target-i386: add qmp command 'query-cpus' to display apic_idcpus.c qapi-schema.json+4 -11 reply

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchEduardo Habkost
1/3R-b R-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [RFC 0/3] fix migration issues after hotplug a discontinuous cpuid

At present, after hotplug a discontinuous cpu id on source side, then done migration, hotplug again will fail on destination side. for example:
on source side:
1) boot with -smp 1,maxcpus=4
2) cpu-add id=2
3) live-migration
on destination side:
1) boot with -smp 2,maxcpus=4
1) cpu-add id=1

the root cause is the generated apicid is sequential from 0 to smp_cpus when initialize cpus at booting time on destination side, there apicid will be 0 and 1, but on source side the existed apicid after hotplug are 0 and 2. so if add cpu with id=1, this will show error with this cpu alreay exists.

this patches added -smp X,apics=0x option to specify apic map. follow above example:
on destination side:
1) boot with -smp 2,maxcpus=4,apics=0xA
this apics value is a hex number as existed apicid bitmap, 0xA is 1010B for apicid are 0 and 2.

this patches will be helpful for arbitrary CPU hot-remove as well.

Chen Fan (3):
target-i386: moving registers of vmstate from cpu_exec_init() to

    x86_cpu_realizefn()

target-i386: add -smp X,apics=0x option
target-i386: add qmp command 'query-cpus' to display apic_id

 cpus.c                  |  1 +
 exec.c                  |  5 ++++
 hw/i386/pc.c            |  9 +++++--
 include/sysemu/sysemu.h |  4 ++++
 qapi-schema.json        |  4 +++-
 qemu-options.hx         | 15 +++++++++---
 target-i386/cpu.c       |  9 +++++++
 vl.c                    | 62 ++++++++++++++++++++++++++++++++++++++++++++++++-
 8 files changed, 102 insertions(+), 7 deletions(-)
Signature · 1 line
1.8.1.4