[Qemu-devel] [PATCH V3 0/7] cpu/acpi: convert cpu hot plug to hotplug_handler API

2014-09-16 Thread Gu Zheng
ust cleanup) into single patch. Patch 7/7: -introduce help function acpi_set_local_sts to keep the bit setting in one place. Gu Zheng (7): acpi/cpu: add cpu hotplug callback function to match hotplug_handler API acpi:ich9: convert cpu hotplug handle to hotplug_handler API acpi:piix4: co

[Qemu-devel] [PATCH V3 1/7] acpi/cpu: add cpu hotplug callback function to match hotplug_handler API

2014-09-16 Thread Gu Zheng
--- v2: -add errp argument to catch error. -return error instead of aborting if cpu id is invalid. -make acpi_cpu_plug_cb as a wrapper around AcpiCpuHotplug_add. --- Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c | 17 + include/hw/acpi/cpu_hotplug.h |3

[Qemu-devel] [PATCH V3 2/7] acpi:ich9: convert cpu hotplug handle to hotplug_handler API

2014-09-16 Thread Gu Zheng
Convert notifier based hotplug handle to hotplug_handler API. Signed-off-by: Gu Zheng --- hw/acpi/ich9.c | 14 +++--- include/hw/acpi/ich9.h |1 - 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 7b14bbb..c53d4ab 100644

[Qemu-devel] [PATCH V3 3/7] acpi:piix4: convert cpu hotplug handle to hotplug_handler API

2014-09-16 Thread Gu Zheng
Convert notifier based hotplug handle to hotplug_handler API, and remove the unused AcpiCpuHotplug_add(). v2: -remove the unused AcpiCpuHotplug_add(). Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c | 14 ++ hw/acpi/piix4.c | 14 ++ include

[Qemu-devel] [PATCH V3 4/7] pc: add cpu hotplug handler to PC_MACHINE

2014-09-16 Thread Gu Zheng
Add cpu hotplug handler to PC_MACHINE, which will perform the acpi cpu hotplug callback via hotplug_handler API. v3: -deal with start up cpus in a more neat way as Igor suggested. v2: -just rebase. Signed-off-by: Gu Zheng --- hw/i386/pc.c | 26 +- 1 files changed

[Qemu-devel] [PATCH V3 6/7] cpu-hotplug: rename function for better readability

2014-09-16 Thread Gu Zheng
Rename: AcpiCpuHotplug_init --> acpi_cpu_hotplug_init AcpiCpuHotplug_ops --> acpi_cpu_hotplug_ops for better readability, just cleanup. Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c |4 ++-- hw/acpi/ich9.c|4 ++-- hw/acpi/piix4.c

[Qemu-devel] [PATCH V3 5/7] pc: Update rtc_cmos in pc_cpu_plug

2014-09-16 Thread Gu Zheng
Update rtc_cmos in pc_cpu_plug directly instead of the notifier, with this change, there will no user of CPU hot-plug notifier any more, so remove it. Signed-off-by: Gu Zheng --- hw/i386/pc.c| 25 ++--- include/sysemu/sysemu.h |3 --- qom/cpu.c

[Qemu-devel] [PATCH V3 7/7] acpi/cpu-hotplug: introduce help function to keep bit setting in one place

2014-09-16 Thread Gu Zheng
Introduce help function acpi_set_local_sts() to simplify acpi_cpu_plug_cb and acpi_cpu_hotplug_init, so that we can keep bit setting in one place. Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c | 22 +++--- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/hw

Re: [Qemu-devel] [PATCH V3 0/7] cpu/acpi: convert cpu hot plug to hotplug_handler API

2014-09-18 Thread Gu Zheng
Hi Igor, The issues you mentioned in previous comments are fixed in this version. Could please help to review it? Thanks, Gu On 09/17/2014 09:23 AM, Gu Zheng wrote: > Previously we use cpu_added_notifiers to register cpu hotplug notifier > callback > which is not able to pass/handle e

Re: [Qemu-devel] [PATCH V3 0/7] cpu/acpi: convert cpu hot plug to hotplug_handler API

2014-09-23 Thread Gu Zheng
ping... On 09/17/2014 09:23 AM, Gu Zheng wrote: > Previously we use cpu_added_notifiers to register cpu hotplug notifier > callback > which is not able to pass/handle errors, so we switch it to unified hotplug > handler API which allows to pass errors and would allow to cancel dev

Re: [Qemu-devel] [PATCH V3 4/7] pc: add cpu hotplug handler to PC_MACHINE

2014-09-28 Thread Gu Zheng
Hi Igor, On 09/26/2014 09:06 PM, Igor Mammedov wrote: > On Wed, 17 Sep 2014 09:24:00 +0800 > Gu Zheng wrote: > >> Add cpu hotplug handler to PC_MACHINE, which will perform the acpi >> cpu hotplug callback via hotplug_handler API. >> >> v3: >> -deal with s

Re: [Qemu-devel] [PATCH V3 5/7] pc: Update rtc_cmos in pc_cpu_plug

2014-09-28 Thread Gu Zheng
Hi Igor, On 09/26/2014 09:23 PM, Igor Mammedov wrote: > On Wed, 17 Sep 2014 09:24:01 +0800 > Gu Zheng wrote: > >> Update rtc_cmos in pc_cpu_plug directly instead of the notifier, with >> this change, there will no user of CPU hot-plug notifier any more, so >> remove

Re: [Qemu-devel] [PATCH V3 7/7] acpi/cpu-hotplug: introduce help function to keep bit setting in one place

2014-09-29 Thread Gu Zheng
Hi Igor, On 09/26/2014 09:37 PM, Igor Mammedov wrote: > On Wed, 17 Sep 2014 09:24:03 +0800 > Gu Zheng wrote: > >> Introduce help function acpi_set_local_sts() to simplify acpi_cpu_plug_cb >> and acpi_cpu_hotplug_init, so that we can keep bit setting in one place. >>

Re: [Qemu-devel] [PATCH V3 7/7] acpi/cpu-hotplug: introduce help function to keep bit setting in one place

2014-09-29 Thread Gu Zheng
On 09/29/2014 05:47 PM, Igor Mammedov wrote: > On Mon, 29 Sep 2014 17:22:08 +0800 > Gu Zheng wrote: > >> Hi Igor, >> On 09/26/2014 09:37 PM, Igor Mammedov wrote: >> >>> On Wed, 17 Sep 2014 09:24:03 +0800 >>> Gu Zheng wrote: >>> >>

[Qemu-devel] [PATCH V4 5/8] pc: Update rtc_cmos in pc_cpu_plug

2014-09-29 Thread Gu Zheng
Update rtc_cmos in pc_cpu_plug directly instead of the notifier. v4: -Make link property in PCMachine rather than the global variables. -Split out the removal of unused notifier into separate patch. Signed-off-by: Gu Zheng --- hw/i386/pc.c | 37

[Qemu-devel] [PATCH V4 1/8] acpi/cpu: add cpu hotplug callback function to match hotplug_handler API

2014-09-29 Thread Gu Zheng
v4: -convert CPUState *cpu to DeviceState *dev like it's done for other handlers and do cast to CPU inside. v2: -add errp argument to catch error. -return error instead of aborting if cpu id is invalid. -make acpi_cpu_plug_cb as a wrapper around AcpiCpuHotplug_add. Signed-off-by: Gu

[Qemu-devel] [PATCH V4 0/8] cpu/acpi: convert cpu hot plug to hotplug_handler API

2014-09-29 Thread Gu Zheng
ug notifier to hotplug handler API, and remove the unused cpu hotplug notify. Patch 6/7: -split the function rename (just cleanup) into single patch. Patch 7/7: -introduce help function acpi_set_local_sts to keep the bit setting in one place. Gu Zheng (8): acpi/cpu: add cpu hotplug call

[Qemu-devel] [PATCH V4 2/8] acpi:ich9: convert cpu hotplug handle to hotplug_handler API

2014-09-29 Thread Gu Zheng
Convert notifier based hotplug handle to hotplug_handler API. Signed-off-by: Gu Zheng --- hw/acpi/ich9.c | 13 ++--- include/hw/acpi/ich9.h |1 - 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 7b14bbb..7585364 100644

[Qemu-devel] [PATCH V4 3/8] acpi:piix4: convert cpu hotplug handle to hotplug_handler API

2014-09-29 Thread Gu Zheng
Convert notifier based hotplug handle to hotplug_handler API, and remove the unused AcpiCpuHotplug_add(). v2: -remove the unused AcpiCpuHotplug_add(). Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c | 14 ++ hw/acpi/piix4.c | 14 ++ include

[Qemu-devel] [PATCH V4 8/8] acpi/cpu-hotplug: introduce help function to keep bit setting in one place

2014-09-29 Thread Gu Zheng
Introduce help function acpi_set_local_sts() to simplify acpi_cpu_plug_cb and acpi_cpu_hotplug_init, so that we can keep bit setting in one place. Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c | 23 +++ 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH V4 7/8] cpu-hotplug: rename function for better readability

2014-09-29 Thread Gu Zheng
Rename: AcpiCpuHotplug_init --> acpi_cpu_hotplug_init AcpiCpuHotplug_ops --> acpi_cpu_hotplug_ops for better readability, just cleanup. Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c |4 ++-- hw/acpi/ich9.c|4 ++-- hw/acpi/piix4.c

[Qemu-devel] [PATCH V4 6/8] qom/cpu: remove the unused CPU hot-plug notifier

2014-09-29 Thread Gu Zheng
Signed-off-by: Gu Zheng --- include/sysemu/sysemu.h |3 --- qom/cpu.c |9 - 2 files changed, 0 insertions(+), 12 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index d8539fd..acfe494 100644 --- a/include/sysemu/sysemu.h +++ b/include

[Qemu-devel] [PATCH V4 4/8] pc: add cpu hotplug handler to PC_MACHINE

2014-09-29 Thread Gu Zheng
Add cpu hotplug handler to PC_MACHINE, which will perform the acpi cpu hotplug callback via hotplug_handler API. v3: -deal with start up cpus in a more neat way as Igor suggested. v2: -just rebase. Signed-off-by: Gu Zheng --- hw/i386/pc.c | 26 +- 1 files changed

Re: [Qemu-devel] [PATCH V4 5/8] pc: Update rtc_cmos in pc_cpu_plug

2014-10-07 Thread Gu Zheng
Hi Igor, On 10/07/2014 09:01 PM, Igor Mammedov wrote: > On Mon, 29 Sep 2014 18:52:34 +0800 > Gu Zheng wrote: > >> Update rtc_cmos in pc_cpu_plug directly instead of the notifier. >> >> v4: >> -Make link property in PCMachine rather than the global >> v

Re: [Qemu-devel] [RFC PATCH 00/10] cpu: add device_add foo-x86_64-cpu and i386 cpu hot remove support

2014-08-18 Thread Gu Zheng
Hi Igor, Andreas, Could you please help to review this series? Any comment is welcome. Regards, Gu On 08/07/2014 12:53 PM, Gu Zheng wrote: > This series is based on the previous patchset from Chen Fan: > https://lists.nongnu.org/archive/html/qemu-devel/2014-05/msg02360.html &

[Qemu-devel] [RFC V2 00/10] cpu: add device_add foo-x86_64-cpu and i386 cpu hot remove support

2014-08-27 Thread Gu Zheng
cpu hotplug: implement function cpu_status_write() for vcpu ejection Gu Zheng (4): qom/cpu: move register_vmstate to common CPUClass.realizefn i386: add cpu device_del support qom cpu: add UNPLUG cpu notify support cpus: reclaim allocated vCPU objects cpus.c|

[Qemu-devel] [RFC V2 01/10] cpu: introduce CpuTopoInfo structure for argument simplification

2014-08-27 Thread Gu Zheng
From: Chen Fan Reviewed-by: Eduardo Habkost Signed-off-by: Chen Fan Signed-off-by: Gu Zheng --- target-i386/topology.h | 33 + 1 files changed, 17 insertions(+), 16 deletions(-) diff --git a/target-i386/topology.h b/target-i386/topology.h index 07a6c5f

[Qemu-devel] [RFC V2 05/10] i386: add cpu device_del support

2014-08-27 Thread Gu Zheng
In order to add cpu(i386) device_del support, introduce the cpu hot unplug hanlde(x86_cpu_unplug) which will trigger the unrealize routine, and just register it to the cpu class unplug handle. Signed-off-by: Chen Fan Signed-off-by: Gu Zheng --- target-i386/cpu.c | 22

[Qemu-devel] [RFC V2 06/10] qom cpu: rename variable 'cpu_added_notifier' to 'cpu_hotplug_notifier'

2014-08-27 Thread Gu Zheng
From: Chen Fan Rename variable 'cpu_added_notifier' to 'cpu_hotplug_notifier' for adding remove vcpu notifier support. Signed-off-by: Chen Fan Signed-off-by: Gu Zheng --- hw/acpi/ich9.c |8 hw/acpi/piix4.c | 10 +- hw/i386/pc

[Qemu-devel] [RFC V2 04/10] x86: add x86_cpu_unrealizefn() for cpu apic remove

2014-08-27 Thread Gu Zheng
From: Chen Fan Implement x86_cpu_unrealizefn() for corresponding x86_cpu_realizefn(), which is mostly used to clean the apic related allocation and vmstates at here. Signed-off-by: Chen Fan Signed-off-by: Gu Zheng --- hw/i386/kvm/apic.c |8 +++ hw/intc/apic.c

[Qemu-devel] [RFC V2 07/10] qom cpu: add UNPLUG cpu notify support

2014-08-27 Thread Gu Zheng
Introduce a common cpu hotplug notifier(CPUNotifier) to support UNPLUG cpu notify. Signed-off-by: Gu Zheng Signed-off-by: Chen Fan --- hw/acpi/cpu_hotplug.c | 15 +++ hw/acpi/ich9.c|5 - hw/acpi/piix4.c | 11 +++ include/hw

[Qemu-devel] [RFC V2 03/10] cpu: add device_add foo-x86_64-cpu support

2014-08-27 Thread Gu Zheng
w function get_free_apic_id() to provide the first free apid id each time to avoid apic id duplicate. Signed-off-by: Chen Fan Signed-off-by: Gu Zheng --- include/qom/cpu.h |1 + qdev-monitor.c |1 + target-i386/cpu.c | 61 +++- t

[Qemu-devel] [RFC V2 08/10] i386: implement pc interface cpu_common_unrealizefn() in qom/cpu.c

2014-08-27 Thread Gu Zheng
From: Chen Fan add interface cpu_common_unrealizefn() for emiting vcpu unplug notifier to ACPI, then ACPI could send sci interrupt to OS for hot-remove vcpu. Signed-off-by: Chen Fan Signed-off-by: Gu Zheng --- qom/cpu.c | 12 1 files changed, 12 insertions(+), 0 deletions

[Qemu-devel] [RFC V2 09/10] cpu hotplug: implement function cpu_status_write() for vcpu ejection

2014-08-27 Thread Gu Zheng
-by: Chen Fan Signed-off-by: Gu Zheng --- cpus.c|7 ++ hw/acpi/cpu_hotplug.c | 40 - hw/i386/acpi-dsdt-cpu-hotplug.dsl |6 - include/hw/acpi/cpu_hotplug.h |1 + include/qom/cpu.h |

[Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-08-27 Thread Gu Zheng
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. But we do not close KVM vcpu fd, just record it into a list, in order to reuse it. Signed-off-by: Chen Fan Signed-off-by: Gu Zheng

[Qemu-devel] [RFC V2 02/10] qom/cpu: move register_vmstate to common CPUClass.realizefn

2014-08-27 Thread Gu Zheng
put to fix the index duplicated issue when hotadd a hot-removed cpu. v2: -fix the cpu index duplicated issue in the QMP/HMP command output. Signed-off-by: Gu Zheng --- cpus.c |4 +++- exec.c | 32 +++- h

Re: [Qemu-devel] [PATCH V4 5/8] pc: Update rtc_cmos in pc_cpu_plug

2014-10-08 Thread Gu Zheng
On 10/08/2014 08:25 PM, Igor Mammedov wrote: > On Wed, 8 Oct 2014 09:12:11 +0800 > Gu Zheng wrote: > >> Hi Igor, >> >> On 10/07/2014 09:01 PM, Igor Mammedov wrote: >> >>> On Mon, 29 Sep 2014 18:52:34 +0800 >>> Gu Zheng wrote: >>>

[Qemu-devel] [PATCH V5 0/8] cpu/acpi: convert cpu hot plug to hotplug_handler API

2014-10-09 Thread Gu Zheng
. Patch 5/7: -switch the last user of cpu hotplug notifier to hotplug handler API, and remove the unused cpu hotplug notify. Patch 6/7: -split the function rename (just cleanup) into single patch. Patch 7/7: -introduce help function acpi_set_local_sts to keep the bit setting in one p

[Qemu-devel] [PATCH V5 1/8] acpi/cpu: add cpu hotplug callback function to match hotplug_handler API

2014-10-09 Thread Gu Zheng
Add cpu hotplug callback function (acpi_cpu_plug_cb) to match hotplug_handler API. Signed-off-by: Gu Zheng --- v4: -convert CPUState *cpu to DeviceState *dev like it's done for other handlers and do cast to CPU inside. v2: -add errp argument to catch error. -return error inste

[Qemu-devel] [PATCH V5 2/8] acpi:ich9: convert cpu hotplug to hotplug_handler API

2014-10-09 Thread Gu Zheng
Convert notifier based hotplug to hotplug_handler API. Signed-off-by: Gu Zheng --- v5: -drop 'handle' from the comment and subject. hw/acpi/ich9.c | 13 ++--- include/hw/acpi/ich9.h |1 - 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/hw/acpi/i

[Qemu-devel] [PATCH V5 3/8] acpi:piix4: convert cpu hotplug to hotplug_handler API

2014-10-09 Thread Gu Zheng
Convert notifier based hotplug to hotplug_handler API, and remove the unused AcpiCpuHotplug_add(). Signed-off-by: Gu Zheng --- v5: -drop 'handle' from the comment and subject. v2: -remove the unused AcpiCpuHotplug_add(). hw/acpi/cpu_hotplug.c | 14 ++ hw/ac

[Qemu-devel] [PATCH V5 4/8] pc: add cpu hotplug handler to PC_MACHINE

2014-10-09 Thread Gu Zheng
Add cpu hotplug handler to PC_MACHINE, which will perform the acpi cpu hotplug callback via hotplug_handler API. Signed-off-by: Gu Zheng --- v5: -split the check out of acpi_dev block. v3: -deal with start up cpus in a more neat way as Igor suggested. v2: -just rebase. hw/i386/pc.c | 28

[Qemu-devel] [PATCH V5 5/8] pc: Update rtc_cmos in pc_cpu_plug

2014-10-09 Thread Gu Zheng
Update rtc_cmos in pc_cpu_plug() directly, instead of the notifier. Signed-off-by: Gu Zheng --- v5: -move CPU hot-plug notifier cleanup hunk into Patch 6/8. v4: -Make link property in PCMachine rather than the global variables. -Split out the removal of unused notifier into separate patch

[Qemu-devel] [PATCH V5 6/8] qom/cpu: remove the unused CPU hot-plug notifier

2014-10-09 Thread Gu Zheng
Remove the unused CPU hot-plug notifier. Signed-off-by: Gu Zheng --- v5: -delete the caller of notifier_list_notify() in this patch. include/sysemu/sysemu.h |3 --- qom/cpu.c | 10 -- 2 files changed, 0 insertions(+), 13 deletions(-) diff --git a/include/sysemu

[Qemu-devel] [PATCH V5 7/8] cpu-hotplug: rename function for better readability

2014-10-09 Thread Gu Zheng
Rename: AcpiCpuHotplug_init --> acpi_cpu_hotplug_init AcpiCpuHotplug_ops --> acpi_cpu_hotplug_ops for better readability, just cleanup. Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c |4 ++-- hw/acpi/ich9.c|4 ++-- hw/acpi/piix4.c

[Qemu-devel] [PATCH V5 8/8] acpi/cpu-hotplug: introduce helper function to keep bit setting in one place

2014-10-09 Thread Gu Zheng
Introduce helper function acpi_set_cpu_present_bit() to simplify acpi_cpu_plug_cb and acpi_cpu_hotplug_init, so that we can keep bit setting in one place. Signed-off-by: Gu Zheng --- v5: -rename acpi_set_local_sts to acpi_set_cpu_present_bit for better readability. hw/acpi/cpu_hotplug.c

Re: [Qemu-devel] [PATCH V5 0/8] cpu/acpi: convert cpu hot plug to hotplug_handler API

2014-10-16 Thread Gu Zheng
ping... On 10/10/2014 10:15 AM, Gu Zheng wrote: > Previously we use cpu_added_notifiers to register cpu hotplug notifier > callback > which is not able to pass/handle errors, so we switch it to unified hotplug > handler API which allows to pass errors and would allow to cancel dev

Re: [Qemu-devel] [PATCH V5 0/8] cpu/acpi: convert cpu hot plug to hotplug_handler API

2014-10-20 Thread Gu Zheng
Hi Igor, How about this version? Regards, Gu On 10/10/2014 10:15 AM, Gu Zheng wrote: > Previously we use cpu_added_notifiers to register cpu hotplug notifier > callback > which is not able to pass/handle errors, so we switch it to unified hotplug > handler API which allows to pas

Re: [Qemu-devel] [PATCH V5 8/8] acpi/cpu-hotplug: introduce helper function to keep bit setting in one place

2014-10-20 Thread Gu Zheng
Hi Igor, On 10/20/2014 11:09 PM, Igor Mammedov wrote: > On Fri, 10 Oct 2014 10:16:07 +0800 > Gu Zheng wrote: > >> Introduce helper function acpi_set_cpu_present_bit() to simplify >> acpi_cpu_plug_cb >> and acpi_cpu_hotplug_init, so that we can keep bit setting in one

[Qemu-devel] [PATCH V6 0/8] cpu/acpi: convert cpu hot plug to hotplug_handler API

2014-10-21 Thread Gu Zheng
me (just cleanup) into single patch. Patch 7/7: -introduce help function acpi_set_local_sts to keep the bit setting in one place. --- Gu Zheng (8): acpi/cpu: add cpu hotplug callback function to match hotplug_handler API acpi:ich9: convert cpu hotplug to hotplug_handler API acpi:piix4:

[Qemu-devel] [PATCH V6 1/8] acpi/cpu: add cpu hotplug callback function to match hotplug_handler API

2014-10-21 Thread Gu Zheng
Add cpu hotplug callback function (acpi_cpu_plug_cb) to match hotplug_handler API. Reviewed-by: Igor Mammedov Signed-off-by: Gu Zheng --- v4: -convert CPUState *cpu to DeviceState *dev like it's done for other handlers and do cast to CPU inside. v2: -add errp argument to catch

[Qemu-devel] [PATCH V6 2/8] acpi:ich9: convert cpu hotplug to hotplug_handler API

2014-10-21 Thread Gu Zheng
Convert notifier based hotplug to hotplug_handler API. Reviewed-by: Igor Mammedov Signed-off-by: Gu Zheng --- v5: -drop 'handle' from the comment and subject. hw/acpi/ich9.c | 13 ++--- include/hw/acpi/ich9.h |1 - 2 files changed, 2 insertions(+), 12 deletion

[Qemu-devel] [PATCH V6 3/8] acpi:piix4: convert cpu hotplug to hotplug_handler API

2014-10-21 Thread Gu Zheng
Convert notifier based hotplug to hotplug_handler API, and remove the unused AcpiCpuHotplug_add(). Reviewed-by: Igor Mammedov Signed-off-by: Gu Zheng --- v5: -drop 'handle' from the comment and subject. v2: -remove the unused AcpiCpuHotplug_add(). hw/acpi/cpu_hotplug.c

[Qemu-devel] [PATCH V6 4/8] pc: add cpu hotplug handler to PC_MACHINE

2014-10-21 Thread Gu Zheng
Add cpu hotplug handler to PC_MACHINE, which will perform the acpi cpu hotplug callback via hotplug_handler API. Reviewed-by: Igor Mammedov Signed-off-by: Gu Zheng --- v5: -split the check out of acpi_dev block. v3: -deal with start up cpus in a more neat way as Igor suggested. v2: -just

[Qemu-devel] [PATCH V6 5/8] pc: Update rtc_cmos in pc_cpu_plug

2014-10-21 Thread Gu Zheng
Update rtc_cmos in pc_cpu_plug() directly, instead of the notifier. Reviewed-by: Igor Mammedov Signed-off-by: Gu Zheng --- v5: -move CPU hot-plug notifier cleanup hunk into Patch 6/8. v4: -Make link property in PCMachine rather than the global variables. -Split out the removal of unused

[Qemu-devel] [PATCH V6 6/8] qom/cpu: remove the unused CPU hot-plug notifier

2014-10-21 Thread Gu Zheng
Remove the unused CPU hot-plug notifier. Reviewed-by: Igor Mammedov Signed-off-by: Gu Zheng --- v5: -delete the caller of notifier_list_notify() in this patch. include/sysemu/sysemu.h |3 --- qom/cpu.c | 10 -- 2 files changed, 0 insertions(+), 13 deletions

[Qemu-devel] [PATCH V6 7/8] cpu-hotplug: rename function for better readability

2014-10-21 Thread Gu Zheng
Rename: AcpiCpuHotplug_init --> acpi_cpu_hotplug_init AcpiCpuHotplug_ops --> acpi_cpu_hotplug_ops for better readability, just cleanup. Reviewed-by: Igor Mammedov Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c |4 ++-- hw/acpi/ich9.c|4 ++-- hw/acpi/p

[Qemu-devel] [PATCH V6 8/8] acpi/cpu-hotplug: introduce helper function to keep bit setting in one place

2014-10-21 Thread Gu Zheng
Introduce helper function acpi_set_cpu_present_bit() to simplify acpi_cpu_plug_cb and acpi_cpu_hotplug_init, so that we can keep bit setting in one place. Signed-off-by: Gu Zheng --- v6: -using error_abort instead of local_err, so that we can gain the error report before abort (suggested by

Re: [Qemu-devel] [PATCH V6 0/8] cpu/acpi: convert cpu hot plug to hotplug_handler API

2014-10-23 Thread Gu Zheng
Hi, This series has been reviewed by Igor, could you please apply it? Thanks, Gu On 10/22/2014 11:24 AM, Gu Zheng wrote: > Previously we use cpu_added_notifiers to register cpu hotplug notifier > callback > which is not able to pass/handle errors, so we switch it to unified hotplug

Re: [Qemu-devel] [PATCH V6 0/8] cpu/acpi: convert cpu hot plug to hotplug_handler API

2014-11-02 Thread Gu Zheng
Hi Michael, Could you please have a look at this series? Thanks, Gu On 10/22/2014 11:24 AM, Gu Zheng wrote: > Previously we use cpu_added_notifiers to register cpu hotplug notifier > callback > which is not able to pass/handle errors, so we switch it to unified hotplug > handl

[Qemu-devel] [PATCH 0/5] cpu/acpi: convert cpu hot plug to hotplug_handler API

2014-09-03 Thread Gu Zheng
Gu Zheng (5): acpi/cpu: add cpu hotplug callback function to match hotplug_handler API acpi:ich9: convert cpu hotplug handle to hotplug_handler API acpi:piix4: convert cpu hotplug handle to hotplug_handler API pc: add cpu hotplug handler to PC_MACHINE cpu/hotplug: remove the left

[Qemu-devel] [PATCH 1/5] acpi/cpu: add cpu hotplug callback function to match hotplug_handler API

2014-09-03 Thread Gu Zheng
Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c | 17 + include/hw/acpi/cpu_hotplug.h |3 +++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c index 2ad83a0..92c189b 100644 --- a/hw/acpi/cpu_hotplug.c

[Qemu-devel] [PATCH 2/5] acpi:ich9: convert cpu hotplug handle to hotplug_handler API

2014-09-03 Thread Gu Zheng
Convert notifier based hotplug handle to hotplug_handler API. Signed-off-by: Gu Zheng --- hw/acpi/ich9.c | 13 ++--- include/hw/acpi/ich9.h |1 - 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 7b14bbb..89f97d7 100644

[Qemu-devel] [PATCH 3/5] acpi:piix4: convert cpu hotplug handle to hotplug_handler API

2014-09-03 Thread Gu Zheng
Convert notifier based hotplug handle to hotplug_handler API. Signed-off-by: Gu Zheng --- hw/acpi/piix4.c | 14 ++ 1 files changed, 2 insertions(+), 12 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index b72b34e..6209385 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi

[Qemu-devel] [PATCH 4/5] pc: add cpu hotplug handler to PC_MACHINE

2014-09-03 Thread Gu Zheng
Add cpu hotplug handler to PC_MACHINE, which will perform the acpi cpu hotplug callback via hotplug_handler API. Signed-off-by: Gu Zheng --- hw/i386/pc.c | 26 +- qom/cpu.c|1 - 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc.c b/hw

[Qemu-devel] [PATCH 5/5] cpu/hotplug: remove the left unused cpu hotplug notifier function

2014-09-03 Thread Gu Zheng
Remove the left unused cpu hotplug notifier function, and rename AcpiCpuHotplug_init --> acpi_cpu_hotplug_init AcpiCpuHotplug_ops --> acpi_cpu_hotplug_ops to match the coding style. Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c | 17 +++-- hw/acpi/

Re: [Qemu-devel] [RFC V2 02/10] qom/cpu: move register_vmstate to common CPUClass.realizefn

2014-09-09 Thread Gu Zheng
Hi Igor, On 09/09/2014 08:17 PM, Igor Mammedov wrote: > On Thu, 28 Aug 2014 11:36:34 +0800 > Gu Zheng wrote: > >> Move cpu vmstate register from cpu_exec_init into cpu_common_realizefn, >> apic vmstate register into x86_cpu_apic_realize. And use the >> cc->get_a

Re: [Qemu-devel] [RFC V2 03/10] cpu: add device_add foo-x86_64-cpu support

2014-09-09 Thread Gu Zheng
Hi Igor, On 09/09/2014 08:44 PM, Igor Mammedov wrote: > On Thu, 28 Aug 2014 11:36:35 +0800 > Gu Zheng wrote: > >> From: Chen Fan >> >> Add support to device_add foo-x86_64-cpu, and additional checks of >> apic id are added into x86_cpuid_set_apic_id() and x86_c

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-09 Thread Gu Zheng
Hi Igor, On 09/09/2014 10:40 PM, Igor Mammedov wrote: > On Thu, 28 Aug 2014 11:36:42 +0800 > Gu Zheng wrote: > >> 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 vCP

Re: [Qemu-devel] [PATCH 0/5] cpu/acpi: convert cpu hot plug to hotplug_handler API

2014-09-10 Thread Gu Zheng
Hi Igor, Thanks very much for your review and suggestion. On 09/10/2014 10:12 PM, Igor Mammedov wrote: > On Wed, 3 Sep 2014 17:06:12 +0800 > Gu Zheng wrote: > >> >> Gu Zheng (5): >> acpi/cpu: add cpu hotplug callback function to match hotplug_handler >>

Re: [Qemu-devel] [PATCH 1/5] acpi/cpu: add cpu hotplug callback function to match hotplug_handler API

2014-09-10 Thread Gu Zheng
Hi Igor, On 09/10/2014 09:28 PM, Igor Mammedov wrote: > On Wed, 3 Sep 2014 17:06:13 +0800 > Gu Zheng wrote: > >> >> Signed-off-by: Gu Zheng >> --- >> hw/acpi/cpu_hotplug.c | 17 + >> include/hw/acpi/cpu_hotplug.h |3 +++ &

Re: [Qemu-devel] [RFC V2 04/10] x86: add x86_cpu_unrealizefn() for cpu apic remove

2014-09-10 Thread Gu Zheng
Hi Igor, On 09/09/2014 09:58 PM, Igor Mammedov wrote: > On Thu, 28 Aug 2014 11:36:36 +0800 > Gu Zheng wrote: > >> From: Chen Fan >> >> Implement x86_cpu_unrealizefn() for corresponding x86_cpu_realizefn(), >> which is mostly used to clean the apic related a

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-11 Thread Gu Zheng
On 09/11/2014 05:35 PM, Bharata B Rao wrote: > On Thu, Aug 28, 2014 at 9:06 AM, Gu Zheng wrote: >> 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. >> But

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-11 Thread Gu Zheng
On 09/11/2014 05:35 PM, Bharata B Rao wrote: > On Thu, Aug 28, 2014 at 9:06 AM, Gu Zheng wrote: >> 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. >> But

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-11 Thread Gu Zheng
Hi Bharata, On 09/11/2014 08:37 PM, Bharata B Rao wrote: > On Thu, Sep 11, 2014 at 3:23 PM, Gu Zheng wrote: >> On 09/11/2014 05:35 PM, Bharata B Rao wrote: >> >>> On Thu, Aug 28, 2014 at 9:06 AM, Gu Zheng wrote: >>>> After ACPI get a signal to eject a vCPU

Re: [Qemu-devel] [PATCH 1/5] acpi/cpu: add cpu hotplug callback function to match hotplug_handler API

2014-09-11 Thread Gu Zheng
Hi Igor, On 09/11/2014 06:12 PM, Igor Mammedov wrote: > On Thu, 11 Sep 2014 11:04:10 +0800 > Gu Zheng wrote: > >> Hi Igor, >> On 09/10/2014 09:28 PM, Igor Mammedov wrote: >> >>> On Wed, 3 Sep 2014 17:06:13 +0800 >>> Gu Zheng wrote: >>> >

Re: [Qemu-devel] [PATCH 4/5] pc: add cpu hotplug handler to PC_MACHINE

2014-09-11 Thread Gu Zheng
Hi Igor, On 09/10/2014 09:55 PM, Igor Mammedov wrote: > On Wed, 3 Sep 2014 17:06:16 +0800 > Gu Zheng wrote: > >> Add cpu hotplug handler to PC_MACHINE, which will perform the acpi >> cpu hotplug callback via hotplug_handler API. >> >> Signed-off-by: Gu Zhen

[Qemu-devel] [PATCH V2 0/7] cpu/acpi: convert cpu hot plug to hotplug_handler API

2014-09-12 Thread Gu Zheng
uce help function acpi_set_local_sts to keep the bit setting in one place. Gu Zheng (7): acpi/cpu: add cpu hotplug callback function to match hotplug_handler API acpi:ich9: convert cpu hotplug handle to hotplug_handler API acpi:piix4: convert cpu hotplug handle to hotplug_handler API pc: add cpu h

[Qemu-devel] [PATCH V2 1/7] acpi/cpu: add cpu hotplug callback function to match hotplug_handler API

2014-09-12 Thread Gu Zheng
--- v2: -add errp argument to catch error. -return error instead of aborting if cpu id is invalid. -make acpi_cpu_plug_cb as a wrapper around AcpiCpuHotplug_add. --- Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c | 17 + include/hw/acpi/cpu_hotplug.h |3

[Qemu-devel] [PATCH V2 2/7] acpi:ich9: convert cpu hotplug handle to hotplug_handler API

2014-09-12 Thread Gu Zheng
Convert notifier based hotplug handle to hotplug_handler API. Signed-off-by: Gu Zheng --- hw/acpi/ich9.c | 14 +++--- include/hw/acpi/ich9.h |1 - 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 7b14bbb..c53d4ab 100644

[Qemu-devel] [PATCH V2 3/7] acpi:piix4: convert cpu hotplug handle to hotplug_handler API

2014-09-12 Thread Gu Zheng
Convert notifier based hotplug handle to hotplug_handler API, and remove the unused AcpiCpuHotplug_add(). Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c | 14 ++ hw/acpi/piix4.c | 14 ++ include/hw/acpi/cpu_hotplug.h |2 -- 3 files

[Qemu-devel] [PATCH V2 4/7] pc: add cpu hotplug handler to PC_MACHINE

2014-09-12 Thread Gu Zheng
Add cpu hotplug handler to PC_MACHINE, which will perform the acpi cpu hotplug callback via hotplug_handler API. Signed-off-by: Gu Zheng --- hw/i386/pc.c | 26 +- 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index b6c9b61

[Qemu-devel] [PATCH V2 5/7] pc: Update rtc_cmos in pc_cpu_plug

2014-09-12 Thread Gu Zheng
Update rtc_cmos in pc_cpu_plug directly instead of the notifier, with this change, there will no user of CPU hot-plug notifier any more, so remove it. Signed-off-by: Gu Zheng --- hw/i386/pc.c| 25 ++--- include/sysemu/sysemu.h |3 --- qom/cpu.c

[Qemu-devel] [PATCH V2 6/7] cpu-hotplug: rename function for better readability

2014-09-12 Thread Gu Zheng
Rename: AcpiCpuHotplug_init --> acpi_cpu_hotplug_init AcpiCpuHotplug_ops --> acpi_cpu_hotplug_ops for better readability, just cleanup. Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c |4 ++-- hw/acpi/ich9.c|4 ++-- hw/acpi/piix4.c

[Qemu-devel] [PATCH V2 7/7] acpi/cpu-hotplug: introduce help function to keep bit setting in one place

2014-09-12 Thread Gu Zheng
Introduce help function acpi_set_local_sts() to simplify acpi_cpu_plug_cb and acpi_cpu_hotplug_init, so that we can keep bit setting in one place. Signed-off-by: Gu Zheng --- hw/acpi/cpu_hotplug.c | 22 +++--- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/hw

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-12 Thread Gu Zheng
Hi Bharata, On 09/12/2014 04:09 PM, Bharata B Rao wrote: > On Fri, Sep 12, 2014 at 6:54 AM, Gu Zheng wrote: >> Is guest os enabled acpi cpu hotplug? What's the guest's cpu info? >> Please try latest QEMU, and any feedback is welcome. >> > > Tried with lates

Re: [Qemu-devel] [PATCH 4/5] pc: add cpu hotplug handler to PC_MACHINE

2014-09-14 Thread Gu Zheng
Hi Igor, On 09/12/2014 10:28 PM, Igor Mammedov wrote: > On Fri, 12 Sep 2014 11:02:09 +0800 > Gu Zheng wrote: > >> Hi Igor, >> On 09/10/2014 09:55 PM, Igor Mammedov wrote: >> >>> On Wed, 3 Sep 2014 17:06:16 +0800 >>> Gu Zheng wrote: >>>

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-14 Thread Gu Zheng
Hi Igor, On 09/12/2014 10:15 PM, Igor Mammedov wrote: > On Thu, 28 Aug 2014 11:36:42 +0800 > Gu Zheng wrote: > >> 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 vCP

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-14 Thread Gu Zheng
Hi Bharata, On 09/12/2014 09:52 PM, Bharata B Rao wrote: > On Fri, Sep 12, 2014 at 4:23 PM, Anshul Makkar > wrote: >> During plugging we can see this event: echo 1 > cpu8/online. >> >> But during unplugging , we can't see the event echo 0 > cpu8/online. > > That's because I didn't do that explic

Re: [Qemu-devel] [RFC PATCH 0/7] i386: add cpu hot remove support

2014-07-14 Thread Gu Zheng
ping... On 07/11/2014 05:59 PM, Gu Zheng wrote: > 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, in

Re: [Qemu-devel] [RFC PATCH 7/7] cpus: reclaim allocated vCPU objects

2014-07-17 Thread Gu Zheng
"cpu_add/del". <http://wiki.qemu.org/Features/CPUHotplug> so we intend to use device_del rather than the cpu_del. And IMO, the cpu_add will be replaced by "device_add" sooner or later. Thanks, Gu > > Thanks > Anshul Makkar > > On Fri, Jul 11, 2014 at 11:59 AM,

Re: [Qemu-devel] [RFC PATCH 0/7] i386: add cpu hot remove support

2014-07-21 Thread Gu Zheng
Hi Igor, Andreas, How about this patchset? Could you please help to review it? Any comment is welcome. Regards, Gu On 07/11/2014 05:59 PM, Gu Zheng wrote: > Via implementing ACPI standard methods _EJ0 in ACPI table, after Guest OS > remove > one vCPU online, the fireware will stor

Re: [Qemu-devel] [RFC PATCH 7/7] cpus: reclaim allocated vCPU objects

2014-07-31 Thread Gu Zheng
can reuse it. > > Am I missing something or this bit is yet to be implmented. Yes, it is implemented, in the same way as you mention above, please refer to function kvm_get_vcpu(). Thanks, Gu > > Thanks > Anshul Makkar > > On Fri, Jul 18, 2014 at 4:09 AM, Gu Zheng wrot

Re: [Qemu-devel] [RFC PATCH 7/7] cpus: reclaim allocated vCPU objects

2014-08-06 Thread Gu Zheng
> > On Fri, Aug 1, 2014 at 6:42 AM, Gu Zheng wrote: >> Hi Anshul, >> Thanks for your test. >> On 07/30/2014 10:31 PM, Anshul Makkar wrote: >> >>> Hi, >>> >>> I am testing the cpu-hotunplug patches. I observed that after the >>> delet

[Qemu-devel] [RFC PATCH 00/10] cpu: add device_add foo-x86_64-cpu and i386 cpu hot remove support

2014-08-06 Thread Gu Zheng
ort x86: add x86_cpu_unrealizefn() for cpu apic remove qom cpu: rename variable 'cpu_added_notifier' to 'cpu_hotplug_notifier' i386: implement pc interface cpu_common_unrealizefn() in qom/cpu.c cpu hotplug: implement function cpu_status_write() for vcpu ejecti

[Qemu-devel] [RFC PATCH 01/10] cpu: introduce CpuTopoInfo structure for argument simplification

2014-08-06 Thread Gu Zheng
From: Chen Fan Reviewed-by: Eduardo Habkost Signed-off-by: Chen Fan Signed-off-by: Gu Zheng --- target-i386/topology.h | 33 + 1 files changed, 17 insertions(+), 16 deletions(-) diff --git a/target-i386/topology.h b/target-i386/topology.h index 07a6c5f

[Qemu-devel] [RFC PATCH 02/10] qom/cpu: move register_vmstate to common CPUClass.realizefn

2014-08-06 Thread Gu Zheng
Move cpu vmstate register from cpu_exec_init into cpu_common_realizefn, apic vmstate register into x86_cpu_apic_realize. And use the cc->get_arch_id as the instance id that suggested by Igor to fix the migration issue. Signed-off-by: Gu Zheng --- exec.c |

[Qemu-devel] [RFC PATCH 03/10] cpu: add device_add foo-x86_64-cpu support

2014-08-06 Thread Gu Zheng
w function get_free_apic_id() to provide the first free apid id each time to avoid apic id duplicate. Signed-off-by: Chen Fan Signed-off-by: Gu Zheng --- include/qom/cpu.h |1 + qdev-monitor.c |1 + target-i386/cpu.c | 61 +++- t

[Qemu-devel] [RFC PATCH 04/10] x86: add x86_cpu_unrealizefn() for cpu apic remove

2014-08-06 Thread Gu Zheng
From: Chen Fan Implement x86_cpu_unrealizefn() for corresponding x86_cpu_realizefn(), which is mostly used to clean the apic related allocation and vmstates at here. Signed-off-by: Chen Fan Signed-off-by: Gu Zheng --- hw/i386/kvm/apic.c |8 +++ hw/intc/apic.c

[Qemu-devel] [RFC PATCH 05/10] i386: add cpu device_del support

2014-08-06 Thread Gu Zheng
In order to add cpu(i386) device_del support, introduce the cpu hot unplug hanlde(x86_cpu_unplug) which will trigger the unrealize routine, and just register it to the cpu class unplug handle. Signed-off-by: Chen Fan Signed-off-by: Gu Zheng --- target-i386/cpu.c | 22

  1   2   >