From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEbPd-0006uN-MC for qemu-devel@nongnu.org; Fri, 23 Jan 2015 05:24:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEbPY-0000Z0-HX for qemu-devel@nongnu.org; Fri, 23 Jan 2015 05:24:25 -0500 Received: from mailpro.odiso.net ([89.248.209.98]:52187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEbPY-0000Yq-9T for qemu-devel@nongnu.org; Fri, 23 Jan 2015 05:24:20 -0500 Date: Fri, 23 Jan 2015 11:24:17 +0100 (CET) From: Alexandre DERUMIER Message-ID: <884906902.4955995.1422008657285.JavaMail.zimbra@oxygem.tv> In-Reply-To: <1983422143.4955993.1422008651186.JavaMail.zimbra@oxygem.tv> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 00/11] cpu: add i386 cpu hot remove support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhu Guihua Cc: qemu-devel , tangchen@cn.fujitsu.com, chen fan fnst , isimatu yasuaki , Igor Mammedov , guz fnst , Anshul Makkar , afaerber Hello, I'm currently testing the new cpu unplug features, Works fine here with debian guests and kernel 3.14. But I have notice some small potential bugs, but I'm not sure I'm doing it = right. 1)first, to unplug cpu, we need an id for cpu The problem is that the current qemu command line -smp 1,sockets=3D2,cores=3D1,maxcpus=3D2 for example, will create 1 cpu on apic-id 0 without any id, so we can't un= plug it. So, I have tried with -smp 1,sockets=3D2,cores=3D1,maxcpus=3D2 -device kvm64-x86_64-cpu,apic-id= =3D0,id=3Dcpu0 But this give me an error: "-device kvm64-x86_64-cpu,apic-id=3D0,id=3Dcpu0: CPU with APIC ID 0 exists" (also try to set -smp 0, but it's not working). 2) second problem, if I start with -smp 1,sockets=3D2,cores=3D1,maxcpus=3D2 then hmp:=20 device_add kvm64-x86_64-cpu,apic-id=3D1,id=3Dcpu1 then hmp : device_del cpu1 Got an error:" This is the last cpu, should not be removed!" This is coming from [PATCH 06/12] pc: add cpu hot unplug request callback=09support + if (smp_cpus =3D=3D 1) { + error_setg(&local_err, + "This is the last cpu, should not be removed!"); + goto out; + } So, the only way unplug is working for me, is to start with -smp 2 minimum -smp 2,sockets=3D2,cores=3D1,maxcpus=3D4 Then I can hotplug|unplug cpuid >=3D 2 Regards, Alexandre Derumier ----- Mail original ----- De: "Zhu Guihua" =C3=80: "qemu-devel" Cc: "Zhu Guihua" , tangchen@cn.fujitsu.com, "guz= fnst" , "isimatu yasuaki" , "Anshul Makkar" , "chen fan fnst= " , "Igor Mammedov" , "a= faerber" Envoy=C3=A9: Mercredi 14 Janvier 2015 08:44:53 Objet: [Qemu-devel] [PATCH v2 00/11] cpu: add i386 cpu hot remove support This series is based on chen fan's previous i386 cpu hot remove patchset:= =20 https://lists.nongnu.org/archive/html/qemu-devel/2013-12/msg04266.html=20 Via implementing ACPI standard methods _EJ0 in ACPI table, after Guest=20 OS remove one vCPU online, the fireware will store removed bitmap to=20 QEMU, then QEMU could know to notify the assigned vCPU of exiting.=20 Meanwhile, intruduce the QOM command 'device_del' to remove vCPU from=20 QEMU itself.=20 The whole work is based on the new hot plug/unplug framework, ,the unplug r= equest=20 callback does the pre-check and send the request, unplug callback does the= =20 removal handling.=20 This series depends on tangchen's common hot plug/unplug enhance patchset.= =20 [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CP= U hot-unplug=20 https://lists.nongnu.org/archive/html/qemu-devel/2015-01/msg00429.html=20 The is the second half of the previous series:=20 [RFC V2 00/10] cpu: add device_add foo-x86_64-cpu and i386 cpu hot remove s= upport=20 https://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg04779.html=20 If you want to test the series, you need to apply the 'device_add foo-x86_6= 4-cpu'=20 patchset first:=20 [PATCH v3 0/7] cpu: add device_add foo-x86_64-cpu support=20 https://lists.nongnu.org/archive/html/qemu-devel/2015-01/msg01552.html=20 ---=20 Changelog since v1:=20 -rebase on the latest version.=20 -delete patch i386/cpu: add instance finalize callback, and put it into pat= chset=20 [PATCH v3 0/6] cpu: add device_add foo-x86_64-cpu support.=20 Changelog since RFC:=20 -splited the i386 cpu hot remove into single thread.=20 -replaced apic_no with apic_id, so does the related stuff to make it=20 work with arbitrary CPU hotadd.=20 -add the icc_device_unrealize callback to handle apic unrealize.=20 -rework on the new hot plug/unplug platform.=20 ---=20 Chen Fan (2):=20 x86: add x86_cpu_unrealizefn() for cpu apic remove=20 cpu hotplug: implement function cpu_status_write() for vcpu ejection=20 Gu Zheng (5):=20 acpi/cpu: add cpu hot unplug request callback function=20 acpi/piix4: add cpu hot unplug callback support=20 acpi/ich9: add cpu hot unplug support=20 pc: add cpu hot unplug callback support=20 cpus: reclaim allocated vCPU objects=20 Zhu Guihua (4):=20 acpi/piix4: add cpu hot unplug request callback support=20 acpi/ich9: add cpu hot unplug request callback support=20 pc: add cpu hot unplug request callback support=20 acpi/cpu: add cpu hot unplug callback function=20 cpus.c | 44 ++++++++++++++++++++=20 hw/acpi/cpu_hotplug.c | 88 ++++++++++++++++++++++++++++++++++++---=20 hw/acpi/ich9.c | 17 ++++++--=20 hw/acpi/piix4.c | 12 +++++-=20 hw/core/qdev.c | 2 +-=20 hw/cpu/icc_bus.c | 11 +++++=20 hw/i386/acpi-dsdt-cpu-hotplug.dsl | 6 ++-=20 hw/i386/kvm/apic.c | 8 ++++=20 hw/i386/pc.c | 62 +++++++++++++++++++++++++--=20 hw/intc/apic.c | 10 +++++=20 hw/intc/apic_common.c | 21 ++++++----=20 include/hw/acpi/cpu_hotplug.h | 8 ++++=20 include/hw/cpu/icc_bus.h | 1 +=20 include/hw/i386/apic_internal.h | 1 +=20 include/hw/qdev-core.h | 1 +=20 include/qom/cpu.h | 9 ++++=20 include/sysemu/kvm.h | 1 +=20 kvm-all.c | 57 ++++++++++++++++++++++++-=20 target-i386/cpu.c | 46 ++++++++++++++++++++=20 19 files changed, 378 insertions(+), 27 deletions(-)=20 --=20 1.9.3=20