From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W30Jb-0003D8-82 for qemu-devel@nongnu.org; Tue, 14 Jan 2014 04:29:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W30JV-0005zR-9C for qemu-devel@nongnu.org; Tue, 14 Jan 2014 04:29:43 -0500 Received: from [222.73.24.84] (port=61579 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W30JU-0005wT-Tz for qemu-devel@nongnu.org; Tue, 14 Jan 2014 04:29:37 -0500 From: Chen Fan Date: Tue, 14 Jan 2014 17:27:19 +0800 Message-Id: Subject: [Qemu-devel] [RFC 0/3] fix migration issues after hotplug a discontinuous cpuid List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= 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(-) -- 1.8.1.4