cpu: add i386 cpu hot remove support
v3 cover cpu: add i386 cpu hot remove support
This series is based on chen fan's previous i386 cpu hot remove patchset:
https://lists.nongnu.org/archive/html/qemu-devel/2013-12/msg04266.html
Via implementing ACPI standard methods _EJ0 in ACPI table, after Guest OS remove one vCPU online, the fireware will store removed bitmap to QEMU, then QEMU could know to notify the assigned vCPU of exiting. Meanwhile, intruduce the QOM command 'device_del' to remove vCPU from QEMU itself.
The whole work is based on the new hot plug/unplug framework, ,the unplug request callback does the pre-check and send the request, unplug callback does the removal handling.
This series depends on tangchen's common hot plug/unplug enhance patchset. [PATCH v2 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug
https://lists.nongnu.org/archive/html/qemu-devel/2015-01/msg03929.html
The is the second half of the previous series:
[RFC V2 00/10] cpu: add device_add foo-x86_64-cpu and i386 cpu hot remove support
https://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg04779.html
If you want to test the series, you need to apply the 'device_add foo-x86_64-cpu' patchset first:
[PATCH v4 00/10] cpu: add device_add foo-x86_64-cpu support
https://lists.nongnu.org/archive/html/qemu-devel/2015-02/msg02584.html
---
Changelog since v2:
-drop ICC bus impl
-fix delete cpu exceed 32 issue
-fix bug about deleting the last cpu
Changelog since v1:
-rebase on the latest version.
-delete patch i386/cpu: add instance finalize callback, and put it into patchset
[PATCH v3 0/6] cpu: add device_add foo-x86_64-cpu support.
Changelog since RFC:
-splited the i386 cpu hot remove into single thread. -replaced apic_no with apic_id, so does the related stuff to make it
work with arbitrary CPU hotadd.
-add the icc_device_unrealize callback to handle apic unrealize. -rework on the new hot plug/unplug platform.
---
Chen Fan (2):
x86: add x86_cpu_unrealizefn() for cpu apic remove
cpu hotplug: implement function cpu_status_write() for vcpu ejection
Gu Zheng (3):
acpi/cpu: add cpu hot unplug request callback function acpi, pc: add cpu hot unplug callback support
cpus: reclaim allocated vCPU objects
Zhu Guihua (2):
acpi, pc: add cpu hot unplug request callback support acpi/cpu: add cpu hot unplug callback function
cpus.c | 44 ++++++++++++++++++++ hw/acpi/cpu_hotplug.c | 87 ++++++++++++++++++++++++++++++++++++--- hw/acpi/ich9.c | 17 ++++++-- hw/acpi/piix4.c | 12 +++++- hw/core/qdev.c | 2 +- hw/i386/acpi-dsdt-cpu-hotplug.dsl | 16 ++++++- hw/i386/kvm/apic.c | 5 +++ hw/i386/pc.c | 68 ++++++++++++++++++++++++++++-- hw/intc/apic.c | 9 ++++ hw/intc/apic_common.c | 21 ++++++---- include/hw/acpi/cpu_hotplug.h | 8 ++++ include/hw/i386/apic_internal.h | 1 + include/hw/qdev-core.h | 1 + include/qom/cpu.h | 9 ++++ include/sysemu/kvm.h | 1 + kvm-all.c | 57 ++++++++++++++++++++++++- target-i386/cpu.c | 46 +++++++++++++++++++++ 17 files changed, 377 insertions(+), 27 deletions(-)
Signature · 1 line
1.9.3
PATCH v3 1/7 x86: add x86_cpu_unrealizefn() for cpu apic remove
From: Chen Fan <[email protected]>
Implement x86_cpu_unrealizefn() for corresponding x86_cpu_realizefn(), which is mostly used to clean the apic related allocation and vmstates at here.
--- hw/i386/kvm/apic.c | 5 +++++ hw/intc/apic.c | 9 ++++++++ hw/intc/apic_common.c | 21 ++++++++++++------- include/hw/i386/apic_internal.h | 1 + target-i386/cpu.c | 46 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 74 insertions(+), 8 deletions(-)
hw/i386/kvm/apic.c +5 -0
@@ -195,11 +195,16 @@ static void kvm_apic_realize(DeviceState *dev, Error **errp) } } +static void kvm_apic_unrealize (DeviceState *dev,Error **errp) +{ +} +static void kvm_apic_class_init (ObjectClass *klass,void *data) {APICCommonClass *k =APIC_COMMON_CLASS (klass); k->realize = kvm_apic_realize; + k->unrealize = kvm_apic_unrealize; k->reset = kvm_apic_reset; k->set_base = kvm_apic_set_base; k->set_tpr = kvm_apic_set_tpr;
hw/intc/apic.c +9 -0
@@ -895,11 +895,20 @@ static void apic_realize(DeviceState *dev, Error **errp) msi_supported = true; } +static void apic_unrealize (DeviceState *dev,Error **errp) +{ +APICCommonState *s =APIC_COMMON (dev); + +timer_free (s->timer); + local_apics[s->idx] =NULL ; +} +static void apic_class_init (ObjectClass *klass,void *data) {APICCommonClass *k =APIC_COMMON_CLASS (klass); k->realize = apic_realize; + k->unrealize = apic_unrealize; k->set_base = apic_set_base; k->set_tpr = apic_set_tpr; k->get_tpr = apic_get_tpr;
hw/intc/apic_common.c +13 -8
@@ -302,17 +302,9 @@ static void apic_common_realize(DeviceState *dev, Error **errp)APICCommonState *s =APIC_COMMON (dev);APICCommonClass *info;static DeviceState *vapic; -static int apic_no;PCMachineState *pcms =PC_MACHINE (qdev_get_machine ());static bool mmio_registered; -if (apic_no >=MAX_APICS ) { -error_setg (errp,"%s initialization failed." , -object_get_typename (OBJECT (dev))); -return ; - } - s->idx = apic_no++; - info =APIC_COMMON_GET_CLASS (s); info->realize (dev, errp);
@@ -335,6 +327,18 @@ static void apic_common_realize(DeviceState *dev, Error **errp) } +static void apic_common_unrealize (DeviceState *dev,Error **errp) +{ +APICCommonState *s =APIC_COMMON (dev); +APICCommonClass *info =APIC_COMMON_GET_CLASS (s); + + info->unrealize (dev, errp); + +if (apic_report_tpr_access && info->enable_tpr_reporting) { + info->enable_tpr_reporting (s, false); + } +} +static int apic_pre_load (void *opaque) {APICCommonState *s =APIC_COMMON (opaque);
@@ -442,6 +446,7 @@ static void apic_common_class_init(ObjectClass *klass, void *data) dc->reset = apic_reset_common; dc->props = apic_properties_common; dc->realize = apic_common_realize; + dc->unrealize = apic_common_unrealize;/* * Reason: APIC and CPU need to be wired up by * x86_cpu_apic_create()
include/hw/i386/apic_internal.h +1 -0
@@ -81,6 +81,7 @@ typedef struct APICCommonClassDeviceClass parent_class;DeviceRealize realize; +DeviceUnrealize unrealize;void (*set_base)(APICCommonState *s,uint64_t val);void (*set_tpr)(APICCommonState *s,uint8_t val);uint8_t (*get_tpr)(APICCommonState *s);
target-i386/cpu.c +46 -0
74 lines not on this page · raw message
Signature · 1 line
1.9.3
PATCH v3 2/7 acpi/cpu: add cpu hot unplug request callback function
In reply to Zhu GuihuaFrom: Gu Zheng <[email protected]>
--- hw/acpi/cpu_hotplug.c | 37 ++++++++++++++++++++++++++++++++----- include/hw/acpi/cpu_hotplug.h | 4 ++++ 2 files changed, 36 insertions(+), 5 deletions(-)
hw/acpi/cpu_hotplug.c +32 -5
@@ -12,6 +12,11 @@#include "hw/hw.h" #include "hw/acpi/cpu_hotplug.h" +typedef enum STS_OPT { +SET , +CLEAR , +}STS_OPT ; +static uint64_t cpu_status_read (void *opaque,hwaddr addr,unsigned int size) {AcpiCpuHotplug *cpus = opaque;
@@ -36,8 +41,8 @@ static const MemoryRegionOps AcpiCpuHotplug_ops = { }, }; -static void acpi_set_cpu_present_bit (AcpiCpuHotplug *g,CPUState *cpu, -Error **errp) +static void acpi_update_cpu_present_bit (AcpiCpuHotplug *g,CPUState *cpu, +STS_OPT opt,Error **errp) {CPUClass *k =CPU_GET_CLASS (cpu);int64_t cpu_id;
@@ -48,13 +53,23 @@ static void acpi_set_cpu_present_bit(AcpiCpuHotplug *g, CPUState *cpu,return ; } - g->sts[cpu_id /8 ] |= (1 << (cpu_id %8 )); +switch (opt) { +case SET : + g->sts[cpu_id /8 ] |= (1 << (cpu_id %8 )); +break ; +case CLEAR : + g->sts[cpu_id /8 ] &= ~(1 << (cpu_id %8 )); +break ; +default : +g_assert (0 ); +break ; + } }void acpi_cpu_plug_cb (ACPIREGS *ar,qemu_irq irq,AcpiCpuHotplug *g,DeviceState *dev,Error **errp) { -acpi_set_cpu_present_bit (g,CPU (dev), errp); +acpi_update_cpu_present_bit (g,CPU (dev),SET , errp);if (*errp !=NULL ) {return ; }
@@ -65,13 +80,25 @@ void acpi_cpu_plug_cb(ACPIREGS *ar, qemu_irq irq, } } +void acpi_cpu_unplug_request_cb (ACPIREGS *ar,qemu_irq irq, +AcpiCpuHotplug *g,DeviceState *dev, +Error **errp) +{ +acpi_update_cpu_present_bit (g,CPU (dev),CLEAR , errp); +if (*errp !=NULL ) { +return ; + } + +acpi_send_gpe_event (ar, irq,ACPI_CPU_HOTPLUG_STATUS ); +} +void acpi_cpu_hotplug_init (MemoryRegion *parent,Object *owner,AcpiCpuHotplug *gpe_cpu,uint16_t base) {CPUState *cpu;CPU_FOREACH (cpu) { -acpi_set_cpu_present_bit (gpe_cpu, cpu, &error_abort); +acpi_update_cpu_present_bit (gpe_cpu, cpu,SET , &error_abort); }memory_region_init_io (&gpe_cpu->io, owner, &AcpiCpuHotplug_ops, gpe_cpu,"acpi-cpu-hotplug" ,ACPI_GPE_PROC_LEN );
include/hw/acpi/cpu_hotplug.h +4 -0
@@ -23,6 +23,10 @@ typedef struct AcpiCpuHotplug {void acpi_cpu_plug_cb (ACPIREGS *ar,qemu_irq irq,AcpiCpuHotplug *g,DeviceState *dev,Error **errp); +void acpi_cpu_unplug_request_cb (ACPIREGS *ar,qemu_irq irq, +AcpiCpuHotplug *g,DeviceState *dev, +Error **errp); +void acpi_cpu_hotplug_init (MemoryRegion *parent,Object *owner,AcpiCpuHotplug *gpe_cpu,uint16_t base);#endif
Signature · 1 line
1.9.3
PATCH v3 3/7 acpi, pc: add cpu hot unplug request callback support
In reply to Zhu Guihua--- hw/acpi/ich9.c | 9 +++++++-- hw/acpi/piix4.c | 2 ++ hw/i386/pc.c | 42 ++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 49 insertions(+), 4 deletions(-)
hw/acpi/ich9.c +7 -2
@@ -400,8 +400,13 @@ void ich9_pm_device_plug_cb(ICH9LPCPMRegs *pm, DeviceState *dev, Error **errp)void ich9_pm_device_unplug_request_cb (ICH9LPCPMRegs *pm,DeviceState *dev,Error **errp) { -error_setg (errp,"acpi: device unplug request for not supported device" -" type: %s" ,object_get_typename (OBJECT (dev))); +if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) { +acpi_cpu_unplug_request_cb (&pm->acpi_regs, pm->irq, + &pm->gpe_cpu, dev, errp); + }else { +error_setg (errp,"acpi: device unplug request for not supported device" +" type: %s" ,object_get_typename (OBJECT (dev))); + } } void ich9_pm_device_unplug_cb(ICH9LPCPMRegs *pm, DeviceState *dev,
hw/acpi/piix4.c +2 -0
@@ -364,6 +364,8 @@ static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev,if (object_dynamic_cast (OBJECT (dev),TYPE_PCI_DEVICE )) {acpi_pcihp_device_unplug_cb (&s->ar, s->irq, &s->acpi_pci_hotplug, dev, errp); + }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) { +acpi_cpu_unplug_request_cb (&s->ar, s->irq, &s->gpe_cpu, dev, errp); }else {error_setg (errp,"acpi: device unplug request for not supported device" " type: %s" ,object_get_typename (OBJECT (dev)));
hw/i386/pc.c +40 -2
54 lines not on this page · raw message
Signature · 1 line
1.9.3
PATCH v3 4/7 acpi/cpu: add cpu hot unplug callback function
In reply to Zhu Guihua--- cpus.c | 7 +++++++ hw/acpi/cpu_hotplug.c | 8 ++++++++ include/hw/acpi/cpu_hotplug.h | 3 +++ include/qom/cpu.h | 9 +++++++++ 4 files changed, 27 insertions(+)
cpus.c +7 -0
@@ -1188,6 +1188,13 @@ void resume_all_vcpus(void) } } +void cpu_remove (CPUState *cpu) +{ + cpu->stop = true; + cpu->exit = true; +qemu_cpu_kick (cpu); +} +/* For temporary buffers for forming a name */ #define VCPU_THREAD_NAME_SIZE 16
hw/acpi/cpu_hotplug.c +8 -0
@@ -92,6 +92,14 @@ void acpi_cpu_unplug_request_cb(ACPIREGS *ar, qemu_irq irq,acpi_send_gpe_event (ar, irq,ACPI_CPU_HOTPLUG_STATUS ); } +void acpi_cpu_unplug_cb (ACPIREGS *ar,qemu_irq irq,AcpiCpuHotplug *g, +DeviceState *dev,Error **errp) +{ +CPUState *cpu =CPU (dev); + +cpu_remove (cpu); +} +void acpi_cpu_hotplug_init (MemoryRegion *parent,Object *owner,AcpiCpuHotplug *gpe_cpu,uint16_t base) {
include/hw/acpi/cpu_hotplug.h +3 -0
@@ -27,6 +27,9 @@ void acpi_cpu_unplug_request_cb(ACPIREGS *ar, qemu_irq irq, AcpiCpuHotplug *g, DeviceState *dev, Error **errp); +void acpi_cpu_unplug_cb (ACPIREGS *ar,qemu_irq irq, +AcpiCpuHotplug *g,DeviceState *dev,Error **errp); +void acpi_cpu_hotplug_init (MemoryRegion *parent,Object *owner,AcpiCpuHotplug *gpe_cpu,uint16_t base);#endif
include/qom/cpu.h +9 -0
@@ -250,6 +250,7 @@ struct CPUState {bool created;bool stop;bool stopped; +bool exit;volatile sig_atomic_t exit_request;uint32_t interrupt_request;int singlestep_enabled;
@@ -614,6 +615,14 @@ void cpu_exit(CPUState *cpu);void cpu_resume (CPUState *cpu);/** +* cpu_remove: +* @cpu: The vCPU to remove. +* +* Requests the CPU @cpu to be removed. +*/ +void cpu_remove (CPUState *cpu); + +/** * qemu_init_vcpu: * @cpu: The vCPU to initialize. *
Signature · 1 line
1.9.3
PATCH v3 5/7 acpi, pc: add cpu hot unplug callback support
In reply to Zhu GuihuaFrom: Gu Zheng <[email protected]>
--- hw/acpi/ich9.c | 8 ++++++-- hw/acpi/piix4.c | 10 ++++++++-- hw/i386/pc.c | 26 ++++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 6 deletions(-)
hw/acpi/ich9.c +6 -2
@@ -412,8 +412,12 @@ void ich9_pm_device_unplug_request_cb(ICH9LPCPMRegs *pm, DeviceState *dev,void ich9_pm_device_unplug_cb (ICH9LPCPMRegs *pm,DeviceState *dev,Error **errp) { -error_setg (errp,"acpi: device unplug for not supported device" -" type: %s" ,object_get_typename (OBJECT (dev))); +if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) { +acpi_cpu_unplug_cb (&pm->acpi_regs, pm->irq, &pm->gpe_cpu, dev, errp); + }else { +error_setg (errp,"acpi: device unplug for not supported device" +" type: %s" ,object_get_typename (OBJECT (dev))); + } }void ich9_pm_ospm_status (AcpiDeviceIf *adev,ACPIOSTInfoList ***list)
hw/acpi/piix4.c +8 -2
@@ -375,8 +375,14 @@ static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev,static void piix4_device_unplug_cb (HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) { -error_setg (errp,"acpi: device unplug for not supported device" -" type: %s" ,object_get_typename (OBJECT (dev))); +PIIX4PMState *s =PIIX4_PM (hotplug_dev); + +if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) { +acpi_cpu_unplug_cb (&s->ar, s->irq, &s->gpe_cpu, dev, errp); + }else { +error_setg (errp,"acpi: device unplug for not supported device" +" type: %s" ,object_get_typename (OBJECT (dev))); + } }static void piix4_update_bus_hotplug (PCIBus *pci_bus,void *opaque)
hw/i386/pc.c +24 -2
@@ -1687,6 +1687,24 @@ out:error_propagate (errp, local_err); } +static void pc_cpu_unplug (HotplugHandler *hotplug_dev, +DeviceState *dev,Error **errp) +{ +HotplugHandlerClass *hhc; +Error *local_err =NULL ; +PCMachineState *pcms =PC_MACHINE (hotplug_dev); + + hhc =HOTPLUG_HANDLER_GET_CLASS (pcms->acpi_dev); + hhc->unplug (HOTPLUG_HANDLER (pcms->acpi_dev), dev, &local_err); +if (local_err) { +error_propagate (errp, local_err); +return ; + } + +/* decrement the number of CPUs */ +rtc_set_memory (pcms->rtc,0x5f ,rtc_get_memory (pcms->rtc,0x5f ) -1 ); +} +static void pc_machine_device_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {
@@ -1711,8 +1729,12 @@ static void pc_machine_device_unplug_request_cb(HotplugHandler *hotplug_dev,static void pc_machine_device_unplug_cb (HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) { -error_setg (errp,"acpi: device unplug for not supported device" -" type: %s" ,object_get_typename (OBJECT (dev))); +if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) { +pc_cpu_unplug (hotplug_dev, dev, errp); + }else { +error_setg (errp,"acpi: device unplug for not supported device" +" type: %s" ,object_get_typename (OBJECT (dev))); + } } static HotplugHandler *pc_get_hotpug_handler(MachineState *machine,
Signature · 1 line
1.9.3
PATCH v3 6/7 cpu hotplug: implement function cpu_status_write() for vcpu ejection
In reply to Zhu GuihuaFrom: Chen Fan <[email protected]>
When OS ejected a vcpu (like: echo 1 > /sys/bus/acpi/devices/LNXCPUXX/eject), it would call acpi EJ0 method, the firmware need to write the new cpumap, QEMU would know which vcpu need to be ejected.
--- hw/acpi/cpu_hotplug.c | 42 ++++++++++++++++++++++++++++++++++++++- hw/core/qdev.c | 2 +- hw/i386/acpi-dsdt-cpu-hotplug.dsl | 16 ++++++++++++++- include/hw/acpi/cpu_hotplug.h | 1 + include/hw/qdev-core.h | 1 + 5 files changed, 59 insertions(+), 3 deletions(-)
hw/acpi/cpu_hotplug.c +41 -1
@@ -17,6 +17,26 @@ typedef enum STS_OPT {CLEAR , } STS_OPT; +static void acpi_eject_vcpu (AcpiCpuHotplug *cpus_status,int64_t cpu_id) +{ +CPUState *cpu; + +CPU_FOREACH (cpu) { +CPUClass *cc =CPU_GET_CLASS (cpu); +int64_t id = cc->get_arch_id (cpu); +HotplugHandler *hotplug_ctrl; + +if (cpu_id == id) { + cpus_status->old_sts[cpu_id /8 ] &= ~(1 << (cpu_id %8 )); + cpus_status->sts[cpu_id /8 ] &= ~(1 << (cpu_id %8 )); + + hotplug_ctrl =qdev_get_hotplug_handler (DEVICE (cpu)); +hotplug_handler_unplug (hotplug_ctrl,DEVICE (cpu),NULL ); +break ; + } + } +} +static uint64_t cpu_status_read (void *opaque,hwaddr addr,unsigned int size) {AcpiCpuHotplug *cpus = opaque;
@@ -28,7 +48,26 @@ static uint64_t cpu_status_read(void *opaque, hwaddr addr, unsigned int size)static void cpu_status_write (void *opaque,hwaddr addr,uint64_t data,unsigned int size) { -/* TODO: implement VCPU removal on guest signal that CPU can be removed */ +AcpiCpuHotplug *cpus = opaque; +uint8_t val; +int i; +int64_t cpu_id =-1 ; + + val = cpus->old_sts[addr] ^ data; + +if (val ==0 ) { +return ; + } + +for (i =0 ; i <8 ; i++) { +if (val &1 << i) { + cpu_id =8 * addr + i; + } + } + +if (cpu_id !=-1 ) { +acpi_eject_vcpu (cpus, cpu_id); + } }static const MemoryRegionOps AcpiCpuHotplug_ops = {
@@ -56,6 +95,7 @@ static void acpi_update_cpu_present_bit(AcpiCpuHotplug *g, CPUState *cpu,switch (opt) {case SET : g->sts[cpu_id /8 ] |= (1 << (cpu_id %8 )); + g->old_sts[cpu_id /8 ] |= (1 << (cpu_id %8 ));break ;case CLEAR : g->sts[cpu_id /8 ] &= ~(1 << (cpu_id %8 ));
hw/core/qdev.c +1 -1
@@ -273,7 +273,7 @@ void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id, dev->alias_required_for_version = required_for_version; } -static HotplugHandler *qdev_get_hotplug_handler (DeviceState *dev) +HotplugHandler *qdev_get_hotplug_handler (DeviceState *dev) {HotplugHandler *hotplug_ctrl =NULL ;
hw/i386/acpi-dsdt-cpu-hotplug.dsl +15 -1
@@ -50,7 +50,21 @@ Scope(\_SB) { } Method(CPEJ, 2, NotSerialized) { // _EJ0 method - eject callback - Sleep(200) + Store(Zero, Index(CPON, ToInteger(Arg0))) + Store(PRS, Local5) + // Local0 = the index of cpu bitmap + Store(ShiftRight(ToInteger(Arg0), 3), Local0) + // Local1 = the subobject of PRS with dereferece + Store(DerefOf(Index(PRS, Local0)), Local1) + // Local2 = the bit index in cpu bitmap + And(ToInteger(Arg0), 0x7, Local2) + Store(One, Local3) + ShiftLeft(Local3, Local2, Local3) + Not(Local3, Local3) + // discard the bit index in cpu bitmap + And(Local1, Local3, Local1) + Store(Local1, Index(Local5, Local0)) + Store(Local5, PRS) } #define CPU_STATUS_LEN ACPI_GPE_PROC_LEN
include/hw/acpi/cpu_hotplug.h +1 -0
@@ -18,6 +18,7 @@typedef struct AcpiCpuHotplug {MemoryRegion io;uint8_t sts[ACPI_GPE_PROC_LEN ]; +uint8_t old_sts[ACPI_GPE_PROC_LEN ]; }AcpiCpuHotplug ; void acpi_cpu_plug_cb(ACPIREGS *ar, qemu_irq irq,
include/hw/qdev-core.h +1 -0
@@ -269,6 +269,7 @@ void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id,void qdev_unplug (DeviceState *dev,Error **errp);void qdev_simple_device_unplug_cb (HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); +HotplugHandler *qdev_get_hotplug_handler (DeviceState *dev);void qdev_machine_creation_done (void );bool qdev_machine_modified (void );
Signature · 1 line
1.9.3
PATCH v3 7/7 cpus: reclaim allocated vCPU objects
In reply to Zhu GuihuaFrom: Gu Zheng <[email protected]>
After ACPI get a signal to eject a vCPU, the vCPU must be removed from CPU list,before the vCPU really removed, then release the all related vCPU objects.
In order to deal well with the kvm vcpus (which can not be removed without any protection), we do not close KVM vcpu fd, just record and mark it as stopped into a list, so that we can reuse it for the appending cpu hot-add request if possible. It is also the approach that kvm guys suggested:
https://www.mail-archive.com/[email protected]/msg102839.html
--- cpus.c | 37 ++++++++++++++++++++++++++++++++++ include/sysemu/kvm.h | 1 + kvm-all.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 94 insertions(+), 1 deletion(-)
cpus.c +37 -0
@@ -854,6 +854,24 @@ void async_run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data)qemu_cpu_kick (cpu); } +static void qemu_kvm_destroy_vcpu (CPUState *cpu) +{ +CPU_REMOVE (cpu); + +if (kvm_destroy_vcpu (cpu) <0 ) { +error_report ("kvm_destroy_vcpu failed.\n" ); +exit (EXIT_FAILURE ); + } + +object_unparent (OBJECT (cpu)); +} + +static void qemu_tcg_destroy_vcpu (CPUState *cpu) +{ +CPU_REMOVE (cpu); +object_unparent (OBJECT (cpu)); +} +static void flush_queued_work (CPUState *cpu) {struct qemu_work_item *wi;
@@ -946,6 +964,11 @@ static void *qemu_kvm_cpu_thread_fn(void *arg) } }qemu_kvm_wait_io_event (cpu); +if (cpu->exit && !cpu_can_run (cpu)) { +qemu_kvm_destroy_vcpu (cpu); +qemu_mutex_unlock (&qemu_global_mutex); +return NULL ; + } }return NULL ;
@@ -999,6 +1022,7 @@ static void tcg_exec_all(void);static void *qemu_tcg_cpu_thread_fn (void *arg) {CPUState *cpu = arg; +CPUState *remove_cpu =NULL ;qemu_tcg_init_cpu_signals ();qemu_thread_get_self (cpu->thread);
@@ -1032,6 +1056,16 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) } }qemu_tcg_wait_io_event (); +CPU_FOREACH (cpu) { +if (cpu->exit && !cpu_can_run (cpu)) { + remove_cpu = cpu; +break ; + } + } +if (remove_cpu) { +qemu_tcg_destroy_vcpu (remove_cpu); + remove_cpu =NULL ; + } }return NULL ;
@@ -1389,6 +1423,9 @@ static void tcg_exec_all(void)break ; } }else if (cpu->stop || cpu->stopped) { +if (cpu->exit) { + next_cpu =CPU_NEXT (cpu); + }break ; } }
include/sysemu/kvm.h +1 -0
@@ -188,6 +188,7 @@ int kvm_has_intx_set_mask(void);int kvm_init_vcpu (CPUState *cpu);int kvm_cpu_exec (CPUState *cpu); +int kvm_destroy_vcpu (CPUState *cpu);#ifdef NEED_CPU_H
kvm-all.c +56 -1
87 lines not on this page · raw message
Signature · 1 line
1.9.3
Re: [Qemu-devel] [PATCH v3 7/7] cpus: reclaim allocated vCPU objects
Quoted 135 lines · Zhu Guihua
From: Gu Zheng <[email protected]>
After ACPI get a signal to eject a vCPU, the vCPU must be removed from CPU list,before the vCPU really removed, then release the all related vCPU objects.
In order to deal well with the kvm vcpus (which can not be removed without any protection), we do not close KVM vcpu fd, just record and mark it as stopped into a list, so that we can reuse it for the appending cpu hot-add request if possible. It is also the approach that kvm guys suggested:
https://www.mail-archive.com/[email protected]/msg102839.htmlSigned-off-by Chen Fan <[email protected]>Signed-off-by Gu Zheng <[email protected]>Signed-off-by Zhu Guihua <[email protected]>--- cpus.c | 37 ++++++++++++++++++++++++++++++++++ include/sysemu/kvm.h | 1 + kvm-all.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 94 insertions(+), 1 deletion(-)cpus.c +37
-0@@ -854,6 +854,24 @@ void async_run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data)qemu_cpu_kick (cpu); } +static void qemu_kvm_destroy_vcpu (CPUState *cpu) +{ +CPU_REMOVE (cpu); + +if (kvm_destroy_vcpu (cpu) <0 ) { +error_report ("kvm_destroy_vcpu failed.\n" ); +exit (EXIT_FAILURE ); + } + +object_unparent (OBJECT (cpu)); +} + +static void qemu_tcg_destroy_vcpu (CPUState *cpu) +{ +CPU_REMOVE (cpu); +object_unparent (OBJECT (cpu)); +} +static void flush_queued_work (CPUState *cpu) {struct qemu_work_item *wi;@@ -946,6 +964,11 @@ static void *qemu_kvm_cpu_thread_fn(void *arg) } }qemu_kvm_wait_io_event (cpu); +if (cpu->exit && !cpu_can_run (cpu)) { +qemu_kvm_destroy_vcpu (cpu); +qemu_mutex_unlock (&qemu_global_mutex); +return NULL ; + } }return NULL ;@@ -999,6 +1022,7 @@ static void tcg_exec_all(void);static void *qemu_tcg_cpu_thread_fn (void *arg) {CPUState *cpu = arg; +CPUState *remove_cpu =NULL ;qemu_tcg_init_cpu_signals ();qemu_thread_get_self (cpu->thread);@@ -1032,6 +1056,16 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) } }qemu_tcg_wait_io_event (); +CPU_FOREACH (cpu) { +if (cpu->exit && !cpu_can_run (cpu)) { + remove_cpu = cpu; +break ; + } + } +if (remove_cpu) { +qemu_tcg_destroy_vcpu (remove_cpu); + remove_cpu =NULL ; + } }return NULL ;@@ -1389,6 +1423,9 @@ static void tcg_exec_all(void)break ; } }else if (cpu->stop || cpu->stopped) { +if (cpu->exit) { + next_cpu =CPU_NEXT (cpu); + }break ; } }include/sysemu/kvm.h +1
-0@@ -188,6 +188,7 @@ int kvm_has_intx_set_mask(void);int kvm_init_vcpu (CPUState *cpu);int kvm_cpu_exec (CPUState *cpu); +int kvm_destroy_vcpu (CPUState *cpu);#ifdef NEED_CPU_H kvm-all.c +7
-0@@ -71,6 +71,12 @@ typedef struct KVMSlottypedef struct kvm_dirty_log KVMDirtyLog ; +struct KVMParkedVcpu { +unsigned long vcpu_id; +int kvm_fd; +QLIST_ENTRY (KVMParkedVcpu) node; +}; +struct KVMState {AccelState parent_obj;@@ -107,6 +113,7 @@ struct KVMState QTAILQ_HEAD(msi_hashtab, KVMMSIRoute) msi_hashtab[KVM_MSI_HASHTAB_SIZE];bool direct_msi;#endif + QLIST_HEAD(, KVMParkedVcpu) kvm_parked_vcpus; };#define TYPE_KVM_ACCEL ACCEL_CLASS_NAME("kvm")
kvm-all.c static int kvm_set_user_memory_region(KVMState *s, KVMSlot *slot) · line 257
Quoted 4 lines
kvm-all.c +1
-0@@ -247,6 +254,53 @@ static int kvm_set_user_memory_region(KVMState *s, KVMSlot *slot)return kvm_vm_ioctl (s,KVM_SET_USER_MEMORY_REGION , &mem); } +int kvm_destroy_vcpu (CPUState *cpu)
You need to provide a stub for this in kvm-stub.c without which I see that aarch64-softmmu won't compile.
Regards,
Bharata.
Hi Igor, Andreas,
Could you please help to review this version?
Thanks,
Gu
Quoted 77 lines · Zhu Guihua
This series is based on chen fan's previous i386 cpu hot remove patchset:
https://lists.nongnu.org/archive/html/qemu-devel/2013-12/msg04266.htmlVia implementing ACPI standard methods
_EJ0in ACPI table, after Guest OS remove one vCPU online, the fireware will store removed bitmap to QEMU, then QEMU could know to notify the assigned vCPU of exiting. Meanwhile, intruduce the QOM command 'device_del' to remove vCPU from QEMU itself.The whole work is based on the new hot plug/unplug framework, ,the unplug request callback does the pre-check and send the request, unplug callback does the removal handling.
This series depends on tangchen's common hot plug/unplug enhance patchset. [PATCH v2 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug
https://lists.nongnu.org/archive/html/qemu-devel/2015-01/msg03929.htmlThe is the second half of the previous series:
[RFC V2 00/10] cpu: adddevice_addfoo-x86_64-cpu and i386 cpu hot remove support
https://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg04779.htmlIf you want to test the series, you need to apply the '
device_addfoo-x86_64-cpu' patchset first:
[PATCH v4 00/10] cpu: adddevice_addfoo-x86_64-cpu support
https://lists.nongnu.org/archive/html/qemu-devel/2015-02/msg02584.html---
Changelog since v2:
-drop ICC bus impl
-fix delete cpu exceed 32 issue
-fix bug about deleting the last cpuChangelog since v1:
-rebase on the latest version.
-delete patch i386/cpu: add instance finalize callback, and put it into patchset
[PATCH v3 0/6] cpu: adddevice_addfoo-x86_64-cpu support.Changelog since RFC:
-splited the i386 cpu hot remove into single thread. -replacedapic_nowithapic_id, so does the related stuff to make it
work with arbitrary CPU hotadd.
-add theicc_device_unrealizecallback to handle apic unrealize. -rework on the new hot plug/unplug platform.
---Chen Fan (2):
x86: addx86_cpu_unrealizefn()for cpu apic remove
cpu hotplug: implement functioncpu_status_write()for vcpu ejectionGu Zheng (3):
acpi/cpu: add cpu hot unplug request callback function acpi, pc: add cpu hot unplug callback support
cpus: reclaim allocated vCPU objectsZhu Guihua (2):
acpi, pc: add cpu hot unplug request callback support acpi/cpu: add cpu hot unplug callback functioncpus.c | 44 ++++++++++++++++++++ hw/acpi/cpu_hotplug.c | 87 ++++++++++++++++++++++++++++++++++++--- hw/acpi/ich9.c | 17 ++++++-- hw/acpi/piix4.c | 12 +++++- hw/core/qdev.c | 2 +- hw/i386/acpi-dsdt-cpu-hotplug.dsl | 16 ++++++- hw/i386/kvm/apic.c | 5 +++ hw/i386/pc.c | 68 ++++++++++++++++++++++++++++-- hw/intc/apic.c | 9 ++++ hw/intc/apic_common.c | 21 ++++++---- include/hw/acpi/cpu_hotplug.h | 8 ++++ include/hw/i386/apic_internal.h | 1 + include/hw/qdev-core.h | 1 + include/qom/cpu.h | 9 ++++ include/sysemu/kvm.h | 1 + kvm-all.c | 57 ++++++++++++++++++++++++- target-i386/cpu.c | 46 +++++++++++++++++++++ 17 files changed, 377 insertions(+), 27 deletions(-)
Hello Zhu,
Are you still working on this feature? Could you provide a rebased version of this series?
Regards,
Quoted 81 lines · Zhu Guihua
This series is based on chen fan's previous i386 cpu hot remove patchset:
https://lists.nongnu.org/archive/html/qemu-devel/2013-12/msg04266.htmlVia implementing ACPI standard methods
_EJ0in ACPI table, after Guest OS remove one vCPU online, the fireware will store removed bitmap to QEMU, then QEMU could know to notify the assigned vCPU of exiting. Meanwhile, intruduce the QOM command 'device_del' to remove vCPU from QEMU itself.The whole work is based on the new hot plug/unplug framework, ,the unplug request callback does the pre-check and send the request, unplug callback does the removal handling.
This series depends on tangchen's common hot plug/unplug enhance patchset. [PATCH v2 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug
https://lists.nongnu.org/archive/html/qemu-devel/2015-01/msg03929.htmlThe is the second half of the previous series:
[RFC V2 00/10] cpu: adddevice_addfoo-x86_64-cpu and i386 cpu hot remove support
https://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg04779.htmlIf you want to test the series, you need to apply the '
device_addfoo-x86_64-cpu' patchset first:
[PATCH v4 00/10] cpu: adddevice_addfoo-x86_64-cpu support
https://lists.nongnu.org/archive/html/qemu-devel/2015-02/msg02584.html---
Changelog since v2:
-drop ICC bus impl
-fix delete cpu exceed 32 issue
-fix bug about deleting the last cpuChangelog since v1:
-rebase on the latest version.
-delete patch i386/cpu: add instance finalize callback, and put it into patchset
[PATCH v3 0/6] cpu: adddevice_addfoo-x86_64-cpu support.Changelog since RFC:
-splited the i386 cpu hot remove into single thread. -replacedapic_nowithapic_id, so does the related stuff to make it
work with arbitrary CPU hotadd.
-add theicc_device_unrealizecallback to handle apic unrealize. -rework on the new hot plug/unplug platform.
---Chen Fan (2):
x86: addx86_cpu_unrealizefn()for cpu apic remove
cpu hotplug: implement functioncpu_status_write()for vcpu ejectionGu Zheng (3):
acpi/cpu: add cpu hot unplug request callback function acpi, pc: add cpu hot unplug callback support
cpus: reclaim allocated vCPU objectsZhu Guihua (2):
acpi, pc: add cpu hot unplug request callback support acpi/cpu: add cpu hot unplug callback functioncpus.c | 44 ++++++++++++++++++++ hw/acpi/cpu_hotplug.c | 87 ++++++++++++++++++++++++++++++++++++--- hw/acpi/ich9.c | 17 ++++++-- hw/acpi/piix4.c | 12 +++++- hw/core/qdev.c | 2 +- hw/i386/acpi-dsdt-cpu-hotplug.dsl | 16 ++++++- hw/i386/kvm/apic.c | 5 +++ hw/i386/pc.c | 68 ++++++++++++++++++++++++++++-- hw/intc/apic.c | 9 ++++ hw/intc/apic_common.c | 21 ++++++---- include/hw/acpi/cpu_hotplug.h | 8 ++++ include/hw/i386/apic_internal.h | 1 + include/hw/qdev-core.h | 1 + include/qom/cpu.h | 9 ++++ include/sysemu/kvm.h | 1 + kvm-all.c | 57 ++++++++++++++++++++++++- target-i386/cpu.c | 46 +++++++++++++++++++++ 17 files changed, 377 insertions(+), 27 deletions(-)Signature · 1 line
1.9.3
Signature · 2 lines
Eduardo Otubo ProfitBricks GmbH
Hi,
Quoted 4 lines · Eduardo Otubo
Hello Zhu,
Are you still working on this feature? Could you provide a rebased version of this series?
Sorry for late reply.
Yes, we are still working on this feature.
I have updated my github, you can get the rebased version from it.
https://github.com/zhuguihua/qemu.git cpu-hotplug
Thanks,
Zhu
Quoted 84 lines
Regards,
Quoted 81 lines · Zhu Guihua
This series is based on chen fan's previous i386 cpu hot remove patchset:
https://lists.nongnu.org/archive/html/qemu-devel/2013-12/msg04266.htmlVia implementing ACPI standard methods
_EJ0in ACPI table, after Guest OS remove one vCPU online, the fireware will store removed bitmap to QEMU, then QEMU could know to notify the assigned vCPU of exiting. Meanwhile, intruduce the QOM command 'device_del' to remove vCPU from QEMU itself.The whole work is based on the new hot plug/unplug framework, ,the unplug request callback does the pre-check and send the request, unplug callback does the removal handling.
This series depends on tangchen's common hot plug/unplug enhance patchset. [PATCH v2 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug
https://lists.nongnu.org/archive/html/qemu-devel/2015-01/msg03929.htmlThe is the second half of the previous series:
[RFC V2 00/10] cpu: adddevice_addfoo-x86_64-cpu and i386 cpu hot remove support
https://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg04779.htmlIf you want to test the series, you need to apply the '
device_addfoo-x86_64-cpu' patchset first:
[PATCH v4 00/10] cpu: adddevice_addfoo-x86_64-cpu support
https://lists.nongnu.org/archive/html/qemu-devel/2015-02/msg02584.html---
Changelog since v2:
-drop ICC bus impl
-fix delete cpu exceed 32 issue
-fix bug about deleting the last cpuChangelog since v1:
-rebase on the latest version.
-delete patch i386/cpu: add instance finalize callback, and put it into patchset
[PATCH v3 0/6] cpu: adddevice_addfoo-x86_64-cpu support.Changelog since RFC:
-splited the i386 cpu hot remove into single thread. -replacedapic_nowithapic_id, so does the related stuff to make it
work with arbitrary CPU hotadd.
-add theicc_device_unrealizecallback to handle apic unrealize. -rework on the new hot plug/unplug platform.
---Chen Fan (2):
x86: addx86_cpu_unrealizefn()for cpu apic remove
cpu hotplug: implement functioncpu_status_write()for vcpu ejectionGu Zheng (3):
acpi/cpu: add cpu hot unplug request callback function acpi, pc: add cpu hot unplug callback support
cpus: reclaim allocated vCPU objectsZhu Guihua (2):
acpi, pc: add cpu hot unplug request callback support acpi/cpu: add cpu hot unplug callback functioncpus.c | 44 ++++++++++++++++++++ hw/acpi/cpu_hotplug.c | 87 ++++++++++++++++++++++++++++++++++++--- hw/acpi/ich9.c | 17 ++++++-- hw/acpi/piix4.c | 12 +++++- hw/core/qdev.c | 2 +- hw/i386/acpi-dsdt-cpu-hotplug.dsl | 16 ++++++- hw/i386/kvm/apic.c | 5 +++ hw/i386/pc.c | 68 ++++++++++++++++++++++++++++-- hw/intc/apic.c | 9 ++++ hw/intc/apic_common.c | 21 ++++++---- include/hw/acpi/cpu_hotplug.h | 8 ++++ include/hw/i386/apic_internal.h | 1 + include/hw/qdev-core.h | 1 + include/qom/cpu.h | 9 ++++ include/sysemu/kvm.h | 1 + kvm-all.c | 57 ++++++++++++++++++++++++- target-i386/cpu.c | 46 +++++++++++++++++++++ 17 files changed, 377 insertions(+), 27 deletions(-)Signature · 1 line
1.9.3
Quoted 7 lines · Zhu Guihua
Hi,
Quoted 4 lines · Eduardo Otubo
Hello Zhu,
Are you still working on this feature? Could you provide a rebased version of this series?
Quoted 7 lines
Sorry for late reply.
Yes, we are still working on this feature.
I have updated my github, you can get the rebased version from it.
https://github.com/zhuguihua/qemu.git cpu-hotplug
I'll review and test. I'll also provide my comments on the github as well. Thanks for the update, Zhu! :)
Regards,
Quoted 90 lines
Thanks,
ZhuQuoted 84 lines
Regards,
Quoted 81 lines · Zhu Guihua
This series is based on chen fan's previous i386 cpu hot remove patchset:
https://lists.nongnu.org/archive/html/qemu-devel/2013-12/msg04266.htmlVia implementing ACPI standard methods
_EJ0in ACPI table, after Guest OS remove one vCPU online, the fireware will store removed bitmap to QEMU, then QEMU could know to notify the assigned vCPU of exiting. Meanwhile, intruduce the QOM command 'device_del' to remove vCPU from QEMU itself.The whole work is based on the new hot plug/unplug framework, ,the unplug request callback does the pre-check and send the request, unplug callback does the removal handling.
This series depends on tangchen's common hot plug/unplug enhance patchset. [PATCH v2 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug
https://lists.nongnu.org/archive/html/qemu-devel/2015-01/msg03929.htmlThe is the second half of the previous series:
[RFC V2 00/10] cpu: adddevice_addfoo-x86_64-cpu and i386 cpu hot remove support
https://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg04779.htmlIf you want to test the series, you need to apply the '
device_addfoo-x86_64-cpu' patchset first:
[PATCH v4 00/10] cpu: adddevice_addfoo-x86_64-cpu support
https://lists.nongnu.org/archive/html/qemu-devel/2015-02/msg02584.html---
Changelog since v2:
-drop ICC bus impl
-fix delete cpu exceed 32 issue
-fix bug about deleting the last cpuChangelog since v1:
-rebase on the latest version.
-delete patch i386/cpu: add instance finalize callback, and put it into patchset
[PATCH v3 0/6] cpu: adddevice_addfoo-x86_64-cpu support.Changelog since RFC:
-splited the i386 cpu hot remove into single thread. -replacedapic_nowithapic_id, so does the related stuff to make it
work with arbitrary CPU hotadd.
-add theicc_device_unrealizecallback to handle apic unrealize. -rework on the new hot plug/unplug platform.
---Chen Fan (2):
x86: addx86_cpu_unrealizefn()for cpu apic remove
cpu hotplug: implement functioncpu_status_write()for vcpu ejectionGu Zheng (3):
acpi/cpu: add cpu hot unplug request callback function acpi, pc: add cpu hot unplug callback support
cpus: reclaim allocated vCPU objectsZhu Guihua (2):
acpi, pc: add cpu hot unplug request callback support acpi/cpu: add cpu hot unplug callback functioncpus.c | 44 ++++++++++++++++++++ hw/acpi/cpu_hotplug.c | 87 ++++++++++++++++++++++++++++++++++++--- hw/acpi/ich9.c | 17 ++++++-- hw/acpi/piix4.c | 12 +++++- hw/core/qdev.c | 2 +- hw/i386/acpi-dsdt-cpu-hotplug.dsl | 16 ++++++- hw/i386/kvm/apic.c | 5 +++ hw/i386/pc.c | 68 ++++++++++++++++++++++++++++-- hw/intc/apic.c | 9 ++++ hw/intc/apic_common.c | 21 ++++++---- include/hw/acpi/cpu_hotplug.h | 8 ++++ include/hw/i386/apic_internal.h | 1 + include/hw/qdev-core.h | 1 + include/qom/cpu.h | 9 ++++ include/sysemu/kvm.h | 1 + kvm-all.c | 57 ++++++++++++++++++++++++- target-i386/cpu.c | 46 +++++++++++++++++++++ 17 files changed, 377 insertions(+), 27 deletions(-)Signature · 1 line
1.9.3
Signature · 2 lines
Eduardo Otubo ProfitBricks GmbH
Quoted 7 lines · Zhu Guihua
Hi,
Quoted 4 lines · Eduardo Otubo
Hello Zhu,
Are you still working on this feature? Could you provide a rebased version of this series?
Quoted 7 lines
Sorry for late reply.
Yes, we are still working on this feature.
I have updated my github, you can get the rebased version from it.
https://github.com/zhuguihua/qemu.git cpu-hotplug
Hi, thanks a lot for rebasing it. I didn't have time to test it, though. I appologise.
Regarding your branch, your plan is to stick with device_del and object_del interface?
Best regards,
Signature · 2 lines
Eduardo Otubo ProfitBricks GmbH
Quoted 11 lines · Eduardo Otubo
Quoted 10 lines · Zhu Guihua
Hi,
Quoted 4 lines · Eduardo Otubo
Hello Zhu,
Are you still working on this feature? Could you provide a rebased version of this series?
Sorry for late reply.
Yes, we are still working on this feature.
Quoted 8 lines
Quoted 3 lines
I have updated my github, you can get the rebased version from it.
https://github.com/zhuguihua/qemu.git cpu-hotplug
Hi, thanks a lot for rebasing it. I didn't have time to test it, though. I appologise.
Regarding your branch, your plan is to stick with
device_delandobject_delinterface?
Yeah, we will only stick with device_del interface. There is no need to use object_del interface for cpu hot remove.
Thanks,
Zhu
Quoted 19 lines · Zhu Guihua
Quoted 17 lines · Eduardo Otubo
Quoted 6 lines · Zhu Guihua
Hi,
Quoted 4 lines · Eduardo Otubo
Hello Zhu,
Are you still working on this feature? Could you provide a rebased version of this series?
Quoted 7 lines
Sorry for late reply.
Yes, we are still working on this feature.
I have updated my github, you can get the rebased version from it.
https://github.com/zhuguihua/qemu.git cpu-hotplug
Hi, thanks a lot for rebasing it. I didn't have time to test it, though. I appologise.
Quoted 9 lines
Quoted 2 lines
Regarding your branch, your plan is to stick with
device_delandobject_delinterface?Yeah, we will only stick with
device_delinterface. There is no need to useobject_delinterface for cpu hot remove.Thanks,
Zhu
This is almost a year old email, but I decided to git it a try anyway. Are you still working on this? I'm trying your patches and it seems I had a simple issue: EJ0 is sent, guest ack's and removes the CPU, but it get's stuck somewhere between the BIOS and Qemu. CPU is successfully removed from the guest, but it still appears on QOM:
(qemu) info cpus
* CPU #0: pc=0xffffffff8104f596 (halted) thread_id=22208
CPU #1: pc=0xffffffff8104f596 (halted) thread_id=22209
CPU #2: pc=0xffffffff810429c8 (halted) thread_id=22281
(qemu) info qom-tree
/machine (pc-i440fx-2.1-machine)
/fw_cfg (fw_cfg_io)
/fwcfg[0] (qemu:memory-region)
[...]
/cpu3 (SandyBridge-x86_64-cpu)
[...]Do you have any clues?
Signature · 2 lines
Eduardo Otubo ProfitBricks GmbH
Quoted 30 lines · On Wed, 22 Jun 2016 14:12:49 +0200 Eduardo Otubo…
Quoted 19 lines · Zhu Guihua
Quoted 17 lines · Eduardo Otubo
Quoted 6 lines · Zhu Guihua
Hi,
Quoted 4 lines · Eduardo Otubo
Hello Zhu,
Are you still working on this feature? Could you provide a rebased version of this series?
Quoted 7 lines
Sorry for late reply.
Yes, we are still working on this feature.
I have updated my github, you can get the rebased version from it.
https://github.com/zhuguihua/qemu.git cpu-hotplug
Hi, thanks a lot for rebasing it. I didn't have time to test it, though. I appologise.
Quoted 9 lines
Quoted 2 lines
Regarding your branch, your plan is to stick with
device_delandobject_delinterface?Yeah, we will only stick with
device_delinterface. There is no need to useobject_delinterface for cpu hot remove.Thanks,
Zhu
Quoted 5 lines
This is almost a year old email, but I decided to git it a try anyway. Are you still working on this? I'm trying your patches and it seems I had a simple issue: EJ0 is sent, guest ack's and removes the CPU, but it get's stuck somewhere between the BIOS and Qemu. CPU is successfully removed from the guest, but it still appears on QOM:
I'm working on new version and I plan to post patches this week.
Quoted 18 lines
(qemu) info cpus * CPU #0: pc=0xffffffff8104f596 (halted) thread_id=22208 CPU #1: pc=0xffffffff8104f596 (halted) thread_id=22209 CPU #2: pc=0xffffffff810429c8 (halted) thread_id=22281 (qemu) info qom-tree /machine (pc-i440fx-2.1-machine) /fw_cfg (fw_cfg_io) /fwcfg[0] (qemu:memory-region) [...] /cpu3 (SandyBridge-x86_64-cpu) [...]Do you have any clues?
Quoted 33 lines · Igor Mammedov
Quoted 30 lines · On Wed, 22 Jun 2016 14:12:49 +0200 Eduardo Otubo…
Quoted 28 lines · Zhu Guihua
Quoted 11 lines · Eduardo Otubo
Quoted 10 lines · Zhu Guihua
Hi,
Quoted 4 lines · Eduardo Otubo
Hello Zhu,
Are you still working on this feature? Could you provide a rebased version of this series?
Sorry for late reply.
Yes, we are still working on this feature.
Quoted 8 lines
Quoted 3 lines
I have updated my github, you can get the rebased version from it.
https://github.com/zhuguihua/qemu.git cpu-hotplug
Hi, thanks a lot for rebasing it. I didn't have time to test it, though. I appologise.
Regarding your branch, your plan is to stick with
device_delandobject_delinterface?Yeah, we will only stick with
device_delinterface. There is no need to useobject_delinterface for cpu hot remove.Thanks,
Zhu
Quoted 7 lines
Quoted 5 lines
This is almost a year old email, but I decided to git it a try anyway. Are you still working on this? I'm trying your patches and it seems I had a simple issue: EJ0 is sent, guest ack's and removes the CPU, but it get's stuck somewhere between the BIOS and Qemu. CPU is successfully removed from the guest, but it still appears on QOM:
I'm working on new version and I plan to post patches this week.
I saw your RFCs. Will your new patches include QMP/HMP interface? Looking forward to test.
regards,
Signature · 2 lines
Eduardo Otubo ProfitBricks GmbH
Quoted 41 lines · On Wed, 22 Jun 2016 15:27:17 +0200 Eduardo Otubo…
Quoted 40 lines · Igor Mammedov
Quoted 37 lines · On Wed, 22 Jun 2016 14:12:49 +0200 Eduardo Otubo…
Quoted 20 lines · Zhu Guihua
Quoted 18 lines · Eduardo Otubo
Quoted 6 lines · Zhu Guihua
Hi,
Quoted 4 lines · Eduardo Otubo
Hello Zhu,
Are you still working on this feature? Could you provide a rebased version of this series?
Quoted 8 lines
Sorry for late reply.
Yes, we are still working on this feature.
I have updated my github, you can get the rebased version from it.
https://github.com/zhuguihua/qemu.git cpu-hotplug
Hi, thanks a lot for rebasing it. I didn't have time to test it, though. I appologise.
Quoted 9 lines
Quoted 2 lines
Regarding your branch, your plan is to stick with
device_delandobject_delinterface?Yeah, we will only stick with
device_delinterface. There is no need to useobject_delinterface for cpu hot remove.Thanks,
ZhuThis is almost a year old email, but I decided to git it a try anyway. Are you still working on this? I'm trying your patches and it seems I had a simple issue: EJ0 is sent, guest ack's and removes the CPU, but it get's stuck somewhere between the BIOS and Qemu. CPU is successfully removed from the guest, but it still appears on QOM:
Quoted 4 lines
Quoted 2 lines
I'm working on new version and I plan to post patches this week.
I saw your RFCs. Will your new patches include QMP/HMP interface?
interface is already in master with spapr cpu hotplug support. my patches will provide x86 implementation of it.
Quoted 4 lines
Looking forward to test.
regards,
Hi,
Thanks to test.
Quoted 21 lines · Eduardo Otubo
Quoted 20 lines · Zhu Guihua
Quoted 19 lines · Eduardo Otubo
Quoted 6 lines · Zhu Guihua
Hi,
Quoted 4 lines · Eduardo Otubo
Hello Zhu,
Are you still working on this feature? Could you provide a rebased version of this series?
Quoted 7 lines
Sorry for late reply.
Yes, we are still working on this feature.
I have updated my github, you can get the rebased version from it.
https://github.com/zhuguihua/qemu.git cpu-hotplug
Hi, thanks a lot for rebasing it. I didn't have time to test it, though. I appologise.
Regarding your branch, your plan is to stick with
device_delandobject_delinterface?
Quoted 8 lines
Quoted 6 lines
Yeah, we will only stick with
device_delinterface. There is no need to useobject_delinterface for cpu hot remove.Thanks,
ZhuThis is almost a year old email, but I decided to git it a try anyway. Are you still working on this?
Yes, we are still working on this feature.
but, as we discuss almost one year age and the Abstract CPU core type is defined recently, this patch's QMP/HMP interface will be replace.
we are following Igor's patches to see what we can do for this feature.
Quoted 20 lines
I'm trying your patches and it seems I
had a simple issue: EJ0 is sent, guest ack's and removes the CPU, but it get's stuck somewhere between the BIOS and Qemu. CPU is successfully removed from the guest, but it still appears on QOM:(qemu) info cpus * CPU #0: pc=0xffffffff8104f596 (halted) thread_id=22208 CPU #1: pc=0xffffffff8104f596 (halted) thread_id=22209 CPU #2: pc=0xffffffff810429c8 (halted) thread_id=22281 (qemu) info qom-tree /machine (pc-i440fx-2.1-machine) /fw_cfg (fw_cfg_io) /fwcfg[0] (qemu:memory-region) [...] /cpu3 (SandyBridge-x86_64-cpu) [...]
Quoted 1 line
Do you have any clues?
we guess Qom may not be updated during the remove event. we will concern it.
Thanks,
Dou.