From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoNSZ-0007l3-Nr for qemu-devel@nongnu.org; Wed, 04 Dec 2013 20:10:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoNSV-0007KR-Ci for qemu-devel@nongnu.org; Wed, 04 Dec 2013 20:10:31 -0500 Received: from [222.73.24.84] (port=40850 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoNST-0007It-TA for qemu-devel@nongnu.org; Wed, 04 Dec 2013 20:10:27 -0500 Message-ID: <1386205708.26863.1.camel@G08FNSTD131468> From: Chen Fan Date: Thu, 05 Dec 2013 09:08:28 +0800 In-Reply-To: <20131204164256.404897ad@nial.usersys.redhat.com> References: <20131128154139.6e9cbfe3@nial.usersys.redhat.com> <1386123316.21156.13.camel@G08FNSTD131468> <20131204164256.404897ad@nial.usersys.redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [RFC qom-cpu v4 00/10] i386: add cpu hot remove support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: qemu-devel@nongnu.org, Andreas =?ISO-8859-1?Q?F=E4rber?= On Wed, 2013-12-04 at 16:42 +0100, Igor Mammedov wrote: > On Wed, 04 Dec 2013 10:15:16 +0800 > Chen Fan wrote: >=20 > > On Thu, 2013-11-28 at 15:41 +0100, Igor Mammedov wrote: > > > On Wed, 9 Oct 2013 17:43:08 +0800 > > > Chen Fan wrote: > > >=20 > > > > Via implementing ACPI standard methods _EJ0 in bios, after Guest OS= hot remove > > > > one vCPU, it is able to send a signal to QEMU, then QEMU could noti= fy > > > > the assigned vCPU of exiting. meanwhile, and intruduce the QOM comm= and 'cpu-del' to remove > > > > vCPU from QEMU itself. > > >=20 > > > have you tried following sequence: > > > cpu-add 1 > > > cpu-add 2 > > > cpu-del 1 > > > and then do migration? > > Hi, Igor, Thanks for your test case. I had test the above sequence, whe= n > > I add two vcpu, then delete the first one, I found command 'lscpu' show= : > > CPU(s): 1 > > On-line CPU(s=EF=BC=89 list: 0,2 > > off -line CPU(s) list: =20 > >=20 > > I know it is wrong, but I want to know which is expected to show, A or > > B? > > A: > > CPU(s): 2 > > On-line CPU(s=EF=BC=89 list: 0,2 > > off -line CPU(s) list: > >=20 > > B: > > CPU(s): 2 > > On-line CPU(s=EF=BC=89 list: 0,1 > > off -line CPU(s) list: > >=20 >=20 > if you deleted #1 CPU than A is correct. >=20 > There is certain thing that depend on cpu_index in QEMU code base, > migration is one of them. It should break if for arbitrary CPU removal/ad= dition > is introduced. Thanks for your explaining. Chen > > Thanks, > > Chen > >=20 > > >=20 > > > >=20 > > > > this work is based on Andreas F=C3=A4rber's qom-cpu branch tree. > > > > git://github.com/afaerber/qemu-cpu.git > > > >=20 > > > > this series patches must be used with seabios patch and KVM patch t= ogether. > > > >=20 > > > > for KVM patches: > > > > http://comments.gmane.org/gmane.comp.emulators.kvm.devel/114347 > > > >=20 > > > > for seabios patches: > > > > http://comments.gmane.org/gmane.comp.emulators.qemu/230460 > > > >=20 > > > > Chen Fan (10): > > > > x86: move apic_state field from CPUX86State to X86CPU > > > > apic: remove redundant variable 'apic_no' from apic_init_common() > > > > apic: remove local_apics array and using CPU_FOREACH instead > > > > x86: add x86_cpu_unrealizefn() for cpu apic remove > > > > qmp: add 'cpu-del' command support > > > > qom cpu: rename variable 'cpu_added_notifier' to > > > > 'cpu_hotplug_notifier' > > > > qom cpu: add UNPLUG cpu notifier support > > > > i386: implement pc interface pc_hot_del_cpu() > > > > piix4: implement function cpu_status_write() for vcpu ejection > > > > cpus: reclaim allocated vCPU objects > > > >=20 > > > > cpu-exec.c | 2 +- > > > > cpus.c | 51 +++++++++++++++++++++-- > > > > hw/acpi/piix4.c | 66 ++++++++++++++++++++++++-----= - > > > > hw/i386/kvm/apic.c | 18 +++++++- > > > > hw/i386/kvmvapic.c | 8 ++-- > > > > hw/i386/pc.c | 51 ++++++++++++++++++----- > > > > hw/i386/pc_piix.c | 3 +- > > > > hw/intc/apic.c | 91 ++++++++++++++++++++++-------= ------------ > > > > hw/intc/apic_common.c | 17 ++------ > > > > include/hw/boards.h | 2 + > > > > include/hw/i386/apic_internal.h | 6 +-- > > > > include/hw/i386/pc.h | 1 + > > > > include/qom/cpu.h | 20 +++++++++ > > > > include/sysemu/kvm.h | 1 + > > > > include/sysemu/sysemu.h | 2 +- > > > > kvm-all.c | 25 +++++++++++ > > > > qapi-schema.json | 12 ++++++ > > > > qmp-commands.hx | 23 +++++++++++ > > > > qmp.c | 9 ++++ > > > > qom/cpu.c | 26 +++++++++--- > > > > target-i386/cpu-qom.h | 5 +++ > > > > target-i386/cpu.c | 57 ++++++++++++++++++++------ > > > > target-i386/cpu.h | 4 -- > > > > target-i386/helper.c | 9 ++-- > > > > target-i386/kvm.c | 23 +++++------ > > > > target-i386/misc_helper.c | 8 ++-- > > > > 26 files changed, 403 insertions(+), 137 deletions(-) > > > >=20 > > >=20 > >=20 > >=20 >=20