Re: [Qemu-devel] [PATCH 1/2] pc-dimm: No numa option shouldn't break hotplug memory feature

2014-09-17 Thread Tang Chen
,maxmem=8G (2) Hotplug memory It will fail and reports: "'DIMM property node has value 0' which exceeds the number of numa nodes: 0" I rememberd Tang Chen had a patch for this bug, this is what Andrey suggested: I thnk that there should be no cases when dimm is plugged (and

Re: [Qemu-devel] [PATCH 1/2] pc-dimm: No numa option shouldn't break hotplug memory feature

2014-09-22 Thread Tang Chen
reproduce: (1) Start VM: qemu-kvm -m 1024,slots=4,maxmem=8G (2) Hotplug memory It will fail and reports: "'DIMM property node has value 0' which exceeds the number of numa nodes: 0" I rememberd Tang Chen had a patch for this bug, this is what Andrey suggested: I thnk that there s

Re: [Qemu-devel] [PATCH 1/2] pc-dimm: No numa option shouldn't break hotplug memory feature

2014-09-23 Thread Tang Chen
On 09/23/2014 04:40 PM, Igor Mammedov wrote: .. It's fine to use SRAT for these purposes on baremetal NUMA systems since due to used chipset constrains it's possible statically allocate ranges for every possible DIMM socket. However SRAT(which is optional table BTW) entries are not mandatory

Re: [Qemu-devel] [PATCH 1/2] pc-dimm: No numa option shouldn't break hotplug memory feature

2014-09-23 Thread Tang Chen
On 09/23/2014 06:11 PM, zhanghailiang wrote: On 2014/9/23 16:58, Tang Chen wrote: On 09/23/2014 04:40 PM, Igor Mammedov wrote: .. It's fine to use SRAT for these purposes on baremetal NUMA systems since due to used chipset constrains it's possible statically allocate ranges

Re: [Qemu-devel] [RESEND PATCH v3 5/8] pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support.

2014-09-24 Thread Tang Chen
Hi Igor, Zhang, On 09/12/2014 09:17 PM, Igor Mammedov wrote: .. Actually, this patch also fix the bug *when hotplug memory failing in the place where after pc_dimm_plug but before the end of device_set_realized, it does not clear the work done by pc_dimm_plug*. For there is no callback like

Re: [Qemu-devel] [PATCH 11/30] qdev: HotplugHandler: provide unplug callback

2014-09-24 Thread Tang Chen
On 09/24/2014 07:48 PM, Igor Mammedov wrote: it to be called for actual device removal and will allow to separate request and removal handling phases of x86-CPU devices and also it's a handler to be called for synchronously removable devices. Signed-off-by: Igor Mammedov --- unplug handling fo

Re: [Qemu-devel] [PATCH 09/30] access BusState.allow_hotplug using wraper qbus_is_hotpluggable()

2014-09-24 Thread Tang Chen
On 09/24/2014 07:47 PM, Igor Mammedov wrote: it would allow transparently switch detection if Bus is hotpluggable from allow_hotplug field to hotplug_handler link and drop allow_hotplug field once all users are converted to hotplug handler API. Signed-off-by: Igor Mammedov --- hw/core/qdev.c

Re: [Qemu-devel] [PATCH 13/30] qdev: hotplug: set handler only if HOTPLUG_HANDLER interface is supported

2014-09-24 Thread Tang Chen
On 09/24/2014 07:48 PM, Igor Mammedov wrote: Check if 'handler' implements HOTPLUG_HANDLER interface before setting it, if it's not then do nothing and leave bus not hotpluggable. That would allow to reuse the same code for creating bus for example 'scsi_bus_new()' for both hotpluggable and not

[Qemu-devel] [PATCH v3 3/8] pc: Add memory hot unplug support for pc machine.

2014-08-18 Thread Tang Chen
From: Hu Tao Implement device unplug callback for PCMachine. And it now only support pc-dimm hot-remove. The callback will call piix4 or ich9 callbacks introduced in previous patches. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/i386/pc.c | 32 1

[Qemu-devel] [PATCH v3 5/8] pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support.

2014-08-18 Thread Tang Chen
From: Hu Tao Implement unrealize function for pc-dimm device. It delete subregion from hotplug region, and delete ram address range from guest ram list. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/mem/pc-dimm.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/mem

[Qemu-devel] [PATCH v3 2/8] acpi, ich9: Add memory hot unplug support for ich9.

2014-08-18 Thread Tang Chen
Implement ich9_pm_device_unplug_cb() to support memory hot-remove, calling acpi_memory_unplug_cb(). And itself will be called in ich9_device_unplug_cb(). Signed-off-by: Tang Chen --- hw/acpi/ich9.c | 12 hw/isa/lpc_ich9.c | 5 +++-- include/hw/acpi/ich9.h | 2 ++ 3

[Qemu-devel] [PATCH v3 1/8] acpi, piix4: Add memory hot unplug support for piix4.

2014-08-18 Thread Tang Chen
From: Hu Tao Implement acpi_memory_unplug_cb(), sending an sci to guest to trigger memory hot-remove, and call it in piix4_device_unplug_cb(). Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 25 + hw/acpi/piix4.c

[Qemu-devel] [PATCH v3 6/8] acpi: Add hardware implementation for memory hot unplug.

2014-08-18 Thread Tang Chen
ister when triggering memory hot-remove in guest. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 52 ++-- include/hw/acpi/acpi.h | 14 +++ include/hw/acpi/memory_hotplug.h | 1 + 3 files changed, 65 insert

[Qemu-devel] [PATCH v3 7/8] pc, acpi bios: Add memory hot unplug interface.

2014-08-18 Thread Tang Chen
From: Hu Tao This patch implements MEMORY_SLOT_EJECT_METHOD according to ACPI spec. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/i386/ssdt-mem.dsl | 5 + hw/i386/ssdt-misc.dsl| 15 ++- include/hw/acpi/pc-hotplug.h | 2 ++ 3 files changed, 21

[Qemu-devel] [PATCH v3 0/8] QEmu memory hot unplug support.

2014-08-18 Thread Tang Chen
ess devices. pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support. acpi: Add hardware implementation for memory hot unplug. pc, acpi bios: Add memory hot unplug interface. monitor: Add memory hot unplug support for device_del command. Tang Chen (1): acpi, ich9: Add memory hot unp

[Qemu-devel] [PATCH v3 8/8] monitor: Add memory hot unplug support for device_del command.

2014-08-18 Thread Tang Chen
From: Hu Tao Implement find_peripheral_device() to find bus-less device, and call it in qmp_device_del() so that device_del command will be able to remove memory device. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- include/qom/object.h | 1 + qdev-monitor.c | 26

[Qemu-devel] [PATCH v3 4/8] qdev: Add memory hot unplug support for bus-less devices.

2014-08-18 Thread Tang Chen
From: Hu Tao Implement bus-less device hot-remove in qdev_unplug(). It will call PCMachine callback introduced in previous patch. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/core/qdev.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c

[Qemu-devel] [PATCH v3 2/8] acpi, ich9: Add memory hot unplug support for ich9.

2014-08-18 Thread Tang Chen
Implement ich9_pm_device_unplug_cb() to support memory hot-remove, calling acpi_memory_unplug_cb(). And itself will be called in ich9_device_unplug_cb(). Signed-off-by: Tang Chen --- hw/acpi/ich9.c | 12 hw/isa/lpc_ich9.c | 5 +++-- include/hw/acpi/ich9.h | 2 ++ 3

[Qemu-devel] [PATCH v3 4/8] qdev: Add memory hot unplug support for bus-less devices.

2014-08-18 Thread Tang Chen
From: Hu Tao Implement bus-less device hot-remove in qdev_unplug(). It will call PCMachine callback introduced in previous patch. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/core/qdev.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c

[Qemu-devel] [PATCH v3 5/8] pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support.

2014-08-18 Thread Tang Chen
From: Hu Tao Implement unrealize function for pc-dimm device. It delete subregion from hotplug region, and delete ram address range from guest ram list. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/mem/pc-dimm.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/mem

[Qemu-devel] [PATCH v3 3/8] pc: Add memory hot unplug support for pc machine.

2014-08-18 Thread Tang Chen
From: Hu Tao Implement device unplug callback for PCMachine. And it now only support pc-dimm hot-remove. The callback will call piix4 or ich9 callbacks introduced in previous patches. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/i386/pc.c | 32 1

[Qemu-devel] [PATCH v3 7/8] pc, acpi bios: Add memory hot unplug interface.

2014-08-18 Thread Tang Chen
From: Hu Tao This patch implements MEMORY_SLOT_EJECT_METHOD according to ACPI spec. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/i386/ssdt-mem.dsl | 5 + hw/i386/ssdt-misc.dsl| 15 ++- include/hw/acpi/pc-hotplug.h | 2 ++ 3 files changed, 21

[Qemu-devel] [PATCH v3 1/8] acpi, piix4: Add memory hot unplug support for piix4.

2014-08-18 Thread Tang Chen
From: Hu Tao Implement acpi_memory_unplug_cb(), sending an sci to guest to trigger memory hot-remove, and call it in piix4_device_unplug_cb(). Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 25 + hw/acpi/piix4.c

[Qemu-devel] [PATCH v3 8/8] monitor: Add memory hot unplug support for device_del command.

2014-08-18 Thread Tang Chen
From: Hu Tao Implement find_peripheral_device() to find bus-less device, and call it in qmp_device_del() so that device_del command will be able to remove memory device. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- include/qom/object.h | 1 + qdev-monitor.c | 26

[Qemu-devel] [PATCH v3 6/8] acpi: Add hardware implementation for memory hot unplug.

2014-08-18 Thread Tang Chen
ister when triggering memory hot-remove in guest. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 52 ++-- include/hw/acpi/acpi.h | 14 +++ include/hw/acpi/memory_hotplug.h | 1 + 3 files changed, 65 insert

[Qemu-devel] [PATCH v3 0/8] QEmu memory hot unplug support.

2014-08-18 Thread Tang Chen
ess devices. pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support. acpi: Add hardware implementation for memory hot unplug. pc, acpi bios: Add memory hot unplug interface. monitor: Add memory hot unplug support for device_del command. Tang Chen (1): acpi, ich9: Add memory hot unp

[Qemu-devel] [PATCH 1/1] pc-dimm: Change PCDIMMDevice->node from UINT32 to INT32, and initialize it as -1.

2014-08-18 Thread Tang Chen
de should be initialized to -1. This is for users who do not use NUMA. Signed-off-by: Tang Chen --- hw/mem/pc-dimm.c | 2 +- include/hw/mem/pc-dimm.h | 2 +- include/sysemu/sysemu.h | 6 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc

[Qemu-devel] [PATCH v2 1/1] pc-dimm: Change PCDIMMDevice->node from UINT32 to INT32, and initialize it as -1.

2014-08-18 Thread Tang Chen
de should be initialized to -1. This is for users who do not use NUMA. Signed-off-by: Tang Chen --- Change log v1 -> v2: 1. Simplify the comment. 2. Move the definition of NO_NODE_ID near where it is used. hw/mem/pc-dimm.c | 7 ++- include/hw/mem/pc-dimm.h | 2 +- 2 files changed,

[Qemu-devel] [PATCH 1/1] Rename piix4_acpi_system_hot_add_init() to piix4_acpi_system_hotplug_init().

2014-08-27 Thread Tang Chen
piix4_acpi_system_hot_add_init() handles not only memory hot add initialization, but the whole memory hotplug initialization. So rename it to piix4_acpi_system_hotplug_init(). Signed-off-by: Tang Chen --- hw/acpi/piix4.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[Qemu-devel] [RESEND PATCH v3 0/8] QEmu memory hot unplug support.

2014-08-27 Thread Tang Chen
ine. qdev: Add memory hot unplug support for bus-less devices. pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support. pc, acpi bios: Add memory hot unplug interface. monitor: Add memory hot unplug support for device_del command. Tang Chen (2): acpi, ich9: Add memory hot unp

[Qemu-devel] [RESEND PATCH v3 2/8] acpi, ich9: Add memory hot unplug support for ich9.

2014-08-27 Thread Tang Chen
Implement ich9_pm_device_unplug_cb() to support memory hot-remove, calling acpi_memory_unplug_cb(). And itself will be called in ich9_device_unplug_cb(). Signed-off-by: Tang Chen --- hw/acpi/ich9.c | 12 hw/isa/lpc_ich9.c | 5 +++-- include/hw/acpi/ich9.h | 2 ++ 3

[Qemu-devel] [RESEND PATCH v3 1/8] acpi, piix4: Add memory hot unplug support for piix4.

2014-08-27 Thread Tang Chen
From: Hu Tao Implement acpi_memory_unplug_cb(), sending an sci to guest to trigger memory hot-remove, and call it in piix4_device_unplug_cb(). Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 25 + hw/acpi/piix4.c

[Qemu-devel] [RESEND PATCH v3 4/8] qdev: Add memory hot unplug support for bus-less devices.

2014-08-27 Thread Tang Chen
From: Hu Tao Implement bus-less device hot-remove in qdev_unplug(). It will call PCMachine callback introduced in previous patch. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/core/qdev.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c

[Qemu-devel] [RESEND PATCH v3 3/8] pc: Add memory hot unplug support for pc machine.

2014-08-27 Thread Tang Chen
From: Hu Tao Implement device unplug callback for PCMachine. And it now only support pc-dimm hot-remove. The callback will call piix4 or ich9 callbacks introduced in previous patches. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/i386/pc.c | 32 1

[Qemu-devel] [RFC PATCH v1 2/4] Add event handling for memory device insertion.

2014-08-27 Thread Tang Chen
Define device insertion OST event and status, and add a function to handle memory insertion. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 18 ++ include/hw/acpi/acpi.h | 10 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/hw/acpi

[Qemu-devel] [RESEND PATCH v3 8/8] monitor: Add memory hot unplug support for device_del command.

2014-08-27 Thread Tang Chen
From: Hu Tao Implement find_peripheral_device() to find bus-less device, and call it in qmp_device_del() so that device_del command will be able to remove memory device. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- include/qom/object.h | 1 + qdev-monitor.c | 23

[Qemu-devel] [RFC PATCH v1 0/4] Handle memory hotplug errors from guest OS.

2014-08-27 Thread Tang Chen
ACPI hardware operations. So this patch-set introduces a wait condition variable to synchronize these two threads. Tang Chen (4): Use macro to define ACPI notification event. Add event handling for memory device insertion. Introduce wait condition to catch guest OS memory hotplug error. Handle m

[Qemu-devel] [RESEND PATCH v3 5/8] pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support.

2014-08-27 Thread Tang Chen
From: Hu Tao Implement unrealize function for pc-dimm device. It delete subregion from hotplug region, and delete ram address range from guest ram list. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/mem/pc-dimm.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/mem

[Qemu-devel] [RFC PATCH v1 4/4] Handle memory hotplug error from guest OS in QEmu.

2014-08-27 Thread Tang Chen
vcpu thread after OST status is written to ACPI register, this patch checks OST status, and report an error to users, and cancel hotplug progress if necessary. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 83 +--- 1 file changed, 79 inser

[Qemu-devel] [RESEND PATCH v3 6/8] acpi: Add hardware implementation for memory hot unplug.

2014-08-27 Thread Tang Chen
ing memory hot-remove in guest. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 62 ++-- include/hw/acpi/acpi.h | 14 + include/hw/acpi/memory_hotplug.h | 1 + 3 files changed, 74 insertions(+), 3 deletion

[Qemu-devel] [RFC PATCH v1 3/4] Introduce wait condition to catch guest OS memory hotplug error.

2014-08-27 Thread Tang Chen
signal QEmu when OST status is written into ACPI register. This is used by the following patch. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index

[Qemu-devel] [RESEND PATCH v3 7/8] pc, acpi bios: Add memory hot unplug interface.

2014-08-27 Thread Tang Chen
From: Hu Tao This patch implements MEMORY_SLOT_EJECT_METHOD according to ACPI spec. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/i386/ssdt-mem.dsl | 5 + hw/i386/ssdt-misc.dsl| 15 ++- include/hw/acpi/pc-hotplug.h | 2 ++ 3 files changed, 21

[Qemu-devel] [RFC PATCH v1 1/4] Use macro to define ACPI notification event.

2014-08-27 Thread Tang Chen
According to ACPI spec, device object notification values define insertion request (Device Check) as 1, and ejection request as 3. Use macro to define them. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 7 +-- include/hw/acpi/acpi.h | 5 - 2 files changed, 9 insertions

[Qemu-devel] [PATCH v4 00/12] QEmu memory hot unplug support.

2014-10-15 Thread Tang Chen
t for pc machine. qdev: Add memory hot unplug support for bus-less devices. pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support. pc, acpi bios: Add memory hot unplug interface. monitor: Add memory hot unplug support for device_del command. Tang Chen (6): acpi, mem-hotp

[Qemu-devel] [PATCH v4 05/12] acpi, piix4: Add memory hot unplug support for piix4.

2014-10-15 Thread Tang Chen
From: Hu Tao Implement acpi_memory_unplug_cb(), sending an sci to guest to trigger memory hot-remove, and call it in piix4_device_unplug_cb(). Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/acpi/piix4.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/acpi

[Qemu-devel] [PATCH v4 07/12] pc: Add memory hot unplug support for pc machine.

2014-10-15 Thread Tang Chen
From: Hu Tao Implement device unplug callback for PCMachine. And it now only support pc-dimm hot-remove. The callback will call piix4 or ich9 callbacks introduced in previous patches. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/i386/pc.c | 31 +++ 1 file

[Qemu-devel] [PATCH v4 01/12] acpi, mem-hotplug: Use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb().

2014-10-15 Thread Tang Chen
Replace string "slot" in acpi_memory_plug_cb() with MACRO PC_DIMM_SLOT_PROP. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index ed39241..c6580da 10064

[Qemu-devel] [PATCH v4 02/12] acpi, mem-hotplug: Add acpi_memory_get_slot_status_descriptor() to get MemStatus.

2014-10-15 Thread Tang Chen
Add a new API named acpi_memory_get_slot_status_descriptor() to obtain a single memory slot status. Doing this is because this procedure will be used by other functions in the next coming patches. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 27 +++ 1 file

[Qemu-devel] [PATCH v4 03/12] acpi, mem-hotplug: Add acpi_memory_hotplug_sci() to rise sci for memory hotplug.

2014-10-15 Thread Tang Chen
Add a new API named acpi_memory_hotplug_sci() to send memory hotplug SCI. Doing this is because this procedure will be used by other functions in the next coming patches. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 12 1 file changed, 8 insertions(+), 4 deletions

[Qemu-devel] [PATCH v4 04/12] acpi, mem-hotplug: Add acpi_memory_unplug_cb() to implement memory unplug.

2014-10-15 Thread Tang Chen
Add a new bool member named is_removing to MemStatus indicating that the memory solt is being removed. Set it to true in acpi_memory_unplug_cb(), and send SCI to guest. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 15 +++ include/hw/acpi/memory_hotplug.h | 3

[Qemu-devel] [PATCH v4 11/12] pc, acpi bios: Add memory hot unplug interface.

2014-10-15 Thread Tang Chen
From: Hu Tao This patch implements MEMORY_SLOT_EJECT_METHOD according to ACPI spec. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/i386/ssdt-mem.dsl | 5 + hw/i386/ssdt-misc.dsl| 13 - include/hw/acpi/pc-hotplug.h | 2 ++ 3 files changed, 19

[Qemu-devel] [PATCH v4 06/12] acpi, ich9: Add memory hot unplug support for ich9.

2014-10-15 Thread Tang Chen
Implement ich9_pm_device_unplug_cb() to support memory hot-remove, calling acpi_memory_unplug_cb(). And itself will be called in ich9_device_unplug_cb(). Signed-off-by: Tang Chen --- hw/acpi/ich9.c | 12 hw/isa/lpc_ich9.c | 5 +++-- include/hw/acpi/ich9.h | 2 ++ 3

[Qemu-devel] [PATCH v4 08/12] qdev: Add memory hot unplug support for bus-less devices.

2014-10-15 Thread Tang Chen
From: Hu Tao Implement bus-less device hot-remove in qdev_unplug(). For now, only pc-dimm is bus-less device, but this is generic handling that applies to other devices. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/core/qdev.c | 8 1 file changed, 8 insertions(+) diff

[Qemu-devel] [PATCH v4 09/12] pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support.

2014-10-15 Thread Tang Chen
From: Hu Tao Implement unrealize function for pc-dimm device. It remove subregion from hotplug region, and delete ram address range from guest ram list. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/mem/pc-dimm.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/mem

[Qemu-devel] [PATCH v4 10/12] acpi: Add hardware implementation for memory hot unplug.

2014-10-15 Thread Tang Chen
Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- docs/specs/acpi_mem_hotplug.txt | 8 ++-- hw/acpi/memory_hotplug.c| 14 +++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/specs/acpi_mem_hotplug.txt b/docs/specs/acpi_mem_hotplug.txt index 1290994..5

[Qemu-devel] [PATCH v4 12/12] monitor: Add memory hot unplug support for device_del command.

2014-10-15 Thread Tang Chen
From: Hu Tao Implement find_peripheral_device() to find bus-less device, and call it in qmp_device_del() so that device_del command will be able to remove memory device. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- qdev-monitor.c | 46 ++ 1

[Qemu-devel] [RESEND PATCH v4 03/10] acpi, mem-hotplug: Add acpi_memory_hotplug_sci() to rise sci for memory hotplug.

2014-10-22 Thread Tang Chen
Add a new API named acpi_memory_hotplug_sci() to send memory hotplug SCI. Doing this is because this procedure will be used by other functions in the next coming patches. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 12 1 file changed, 8 insertions(+), 4 deletions

[Qemu-devel] [RESEND PATCH v4 05/10] acpi, piix4: Add memory hot unplug support for piix4.

2014-10-22 Thread Tang Chen
From: Hu Tao Implement acpi_memory_unplug_cb(), sending an sci to guest to trigger memory hot-remove, and call it in piix4_device_unplug_cb(). Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/acpi/piix4.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/acpi

[Qemu-devel] [RESEND PATCH v4 00/10] QEmu memory hot unplug support.

2014-10-22 Thread Tang Chen
k. Hu Tao (4): acpi, piix4: Add memory hot unplug support for piix4. pc: Add memory hot unplug support for pc machine. pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support. pc, acpi bios: Add memory hot unplug interface. Tang Chen (6): acpi, mem-hotplug: Use PC_DIMM

[Qemu-devel] [RESEND PATCH v4 01/10] acpi, mem-hotplug: Use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb().

2014-10-22 Thread Tang Chen
Replace string "slot" in acpi_memory_plug_cb() with MACRO PC_DIMM_SLOT_PROP. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index ed39241..c6580da 10064

[Qemu-devel] [RESEND PATCH v4 04/10] acpi, mem-hotplug: Add acpi_memory_unplug_cb() to implement memory unplug.

2014-10-22 Thread Tang Chen
Add a new bool member named is_removing to MemStatus indicating that the memory solt is being removed. Set it to true in acpi_memory_unplug_cb(), and send SCI to guest. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 15 +++ include/hw/acpi/memory_hotplug.h | 3

[Qemu-devel] [RESEND PATCH v4 10/10] pc, acpi bios: Add memory hot unplug interface.

2014-10-22 Thread Tang Chen
From: Hu Tao This patch implements MEMORY_SLOT_EJECT_METHOD according to ACPI spec. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/i386/ssdt-mem.dsl | 5 + hw/i386/ssdt-misc.dsl| 13 - include/hw/acpi/pc-hotplug.h | 2 ++ 3 files changed, 19

[Qemu-devel] [RESEND PATCH v4 02/10] acpi, mem-hotplug: Add acpi_memory_get_slot_status_descriptor() to get MemStatus.

2014-10-22 Thread Tang Chen
Add a new API named acpi_memory_get_slot_status_descriptor() to obtain a single memory slot status. Doing this is because this procedure will be used by other functions in the next coming patches. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 27 +++ 1 file

[Qemu-devel] [RESEND PATCH v4 08/10] pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support.

2014-10-22 Thread Tang Chen
From: Hu Tao Implement unrealize function for pc-dimm device. It remove subregion from hotplug region, and delete ram address range from guest ram list. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/mem/pc-dimm.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/mem

[Qemu-devel] [RESEND PATCH v4 06/10] acpi, ich9: Add memory hot unplug support for ich9.

2014-10-22 Thread Tang Chen
Implement ich9_pm_device_unplug_cb() to support memory hot-remove, calling acpi_memory_unplug_cb(). And itself will be called in ich9_device_unplug_cb(). Signed-off-by: Tang Chen --- hw/acpi/ich9.c | 12 hw/isa/lpc_ich9.c | 5 +++-- include/hw/acpi/ich9.h | 2 ++ 3

[Qemu-devel] [RESEND PATCH v4 09/10] acpi: Add hardware implementation for memory hot unplug.

2014-10-22 Thread Tang Chen
Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- docs/specs/acpi_mem_hotplug.txt | 8 ++-- hw/acpi/memory_hotplug.c| 14 +++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/specs/acpi_mem_hotplug.txt b/docs/specs/acpi_mem_hotplug.txt index 1290994..5

[Qemu-devel] [RESEND PATCH v4 07/10] pc: Add memory hot unplug support for pc machine.

2014-10-22 Thread Tang Chen
From: Hu Tao Implement device unplug callback for PCMachine. And it now only support pc-dimm hot-remove. The callback will call piix4 or ich9 callbacks introduced in previous patches. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/i386/pc.c | 31 +++ 1 file

Re: [Qemu-devel] [RESEND PATCH v4 00/10] QEmu memory hot unplug support.

2014-10-29 Thread Tang Chen
On 10/29/2014 05:37 PM, Igor Mammedov wrote: On Wed, 22 Oct 2014 18:00:02 +0800 Tang Chen wrote: This patch-set implements memory hot-remove for QEmu. Rebased on Igor's asynchronize hotplug framework (qemu v2.1.2, the latest). Approach: QEmu sets GPE status bit, then triggers SCI to n

Re: [Qemu-devel] [RESEND PATCH v3 1/8] acpi, piix4: Add memory hot unplug support for piix4.

2014-09-15 Thread Tang Chen
Hi Igor, On 09/04/2014 08:15 PM, Igor Mammedov wrote: On Wed, 27 Aug 2014 16:08:32 +0800 Tang Chen wrote: From: Hu Tao Implement acpi_memory_unplug_cb(), sending an sci to guest to trigger memory hot-remove, and call it in piix4_device_unplug_cb(). Signed-off-by: Hu Tao Signed-off-by

Re: [Qemu-devel] [RESEND PATCH v3 2/8] acpi, ich9: Add memory hot unplug support for ich9.

2014-09-15 Thread Tang Chen
Hi Igor, On 09/04/2014 08:25 PM, Igor Mammedov wrote: On Wed, 27 Aug 2014 16:08:33 +0800 Tang Chen wrote: Implement ich9_pm_device_unplug_cb() to support memory hot-remove, calling acpi_memory_unplug_cb(). And itself will be called in ich9_device_unplug_cb(). Signed-off-by: Tang Chen

Re: [Qemu-devel] [RESEND PATCH v3 4/8] qdev: Add memory hot unplug support for bus-less devices.

2014-09-16 Thread Tang Chen
Hi Igor, On 09/04/2014 09:22 PM, Igor Mammedov wrote: On Wed, 27 Aug 2014 16:08:35 +0800 Tang Chen wrote: From: Hu Tao Implement bus-less device hot-remove in qdev_unplug(). It will call PCMachine callback introduced in previous patch. subject/commit message doesn't need to me

Re: [Qemu-devel] [RESEND PATCH v3 6/8] acpi: Add hardware implementation for memory hot unplug.

2014-09-16 Thread Tang Chen
Hi Igor, On 09/04/2014 10:20 PM, Igor Mammedov wrote: .. + +acpi_handle_ost_event(mdev); _OST is optional and OSPM doesn't have to call it at all, it was already discussed on list and using _OST for device removal was evaluated as not usable. We use _OST here as supplementary status

Re: [Qemu-devel] [PATCH 17/35] dimm: add busy address check and address auto-allocation

2014-05-07 Thread Tang Chen
provided with -device/device_add command, attempt to use it or fail command if it's already occupied or falls inside of an existing DimmDevice memory region. Signed-off-by: Igor Mammedov Signed-off-by: Tang Chen --- hw/i386/pc.c | 16 +++- hw/mem/dimm.c | 70 +

[Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug.

2015-01-07 Thread Tang Chen
request cb. So this patch set introduces these commom functions as part1, and memory and CPU hot-unplug will come soon as part 2 and 3. This patch-set is based on QEmu 2.2 Tang Chen (5): acpi, pc: Add hotunplug request cb for pc machine. acpi, ich9: Add hotunplug request cb for ich9. acpi, pc

[Qemu-devel] [RESEND PATCH v1 2/5] acpi, ich9: Add hotunplug request cb for ich9.

2015-01-07 Thread Tang Chen
Memory and CPU hot unplug are both asynchronize procedures. They both need unplug request cb when the unplug operation happens. This patch adds hotunplug request cb for ich9, and memory and CPU hot unplug will base on it. --- hw/acpi/ich9.c | 7 +++ hw/isa/lpc_ich9.c | 5 +++-- i

[Qemu-devel] [RESEND PATCH v1 3/5] acpi, pc: Add unplug cb for pc machine.

2015-01-07 Thread Tang Chen
Memory and CPU hot unplug are both asynchronize procedures. When the unplug operation happens, unplug request cb is called first. And when ghest OS finished handling unplug, unplug cb will be called to do the real removal of device. This patch adds hotunplug cb for pc machine, and memory and CPU h

[Qemu-devel] [RESEND PATCH v1 4/5] acpi, ich9: Add unplug cb for ich9.

2015-01-07 Thread Tang Chen
Memory and CPU hot unplug are both asynchronize procedures. When the unplug operation happens, unplug request cb is called first. And when ghest OS finished handling unplug, unplug cb will be called to do the real removal of device. This patch adds hotunplug cb for ich9, and memory and CPU hot unp

[Qemu-devel] [RESEND PATCH v1 5/5] acpi, piix4: Add unplug cb for piix4.

2015-01-07 Thread Tang Chen
Memory and CPU hot unplug are both asynchronize procedures. When the unplug operation happens, unplug request cb is called first. And when ghest OS finished handling unplug, unplug cb will be called to do the real removal of device. This patch adds hotunplug cb for piix4, and memory and CPU hot un

[Qemu-devel] [RESEND PATCH v1 1/5] acpi, pc: Add hotunplug request cb for pc machine.

2015-01-07 Thread Tang Chen
Memory and CPU hot unplug are both asynchronous procedures. They both need unplug request callback to initiate unplug operation. Add unplug handler to pc machine that will be used by following CPU and memory unplug patches. --- hw/i386/pc.c | 8 1 file changed, 8 insertions(+) diff --gi

[Qemu-devel] [RESEND PATCH v1 00/13] QEmu memory hot unplug support.

2015-01-07 Thread Tang Chen
following patchset. [PATCH] Common unplug and unplug request cb for memory and CPU hot-unplug. https://www.mail-archive.com/qemu-devel@nongnu.org/msg272745.html Hu Tao (2): acpi, piix4: Add memory hot unplug request support for piix4. pc, acpi bios: Add memory hot unplug interface. Tang Chen (11

[Qemu-devel] [RESEND PATCH v1 01/13] acpi, mem-hotplug: Use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb().

2015-01-07 Thread Tang Chen
Replace string "slot" in acpi_memory_plug_cb() with MACRO PC_DIMM_SLOT_PROP. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index ed39241..c6580da 10064

[Qemu-devel] [RESEND PATCH v1 06/13] acpi, ich9: Add memory hot unplug request support for ich9.

2015-01-07 Thread Tang Chen
Call memory unplug request cb in ich9_pm_device_unplug_request_cb(). --- hw/acpi/ich9.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index c48d176..841f57d 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -304,8 +304,14 @@ void i

[Qemu-devel] [RESEND PATCH v1 02/13] acpi, mem-hotplug: Add acpi_memory_get_slot_status_descriptor() to get MemStatus.

2015-01-07 Thread Tang Chen
Add a new API named acpi_memory_get_slot_status_descriptor() to obtain a single memory slot status. Doing this is because this procedure will be used by other functions in the next coming patches. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 27 +++ 1 file

[Qemu-devel] [RESEND PATCH v1 04/13] acpi, mem-hotplug: Add unplug request cb for memory device.

2015-01-07 Thread Tang Chen
member named is_removing to MemStatus indicating that the memory slot is being removed. Set it to true in acpi_memory_unplug_request_cb(), and send SCI to guest. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 16 include/hw/acpi/memory_hotplug.h | 4 2 files

[Qemu-devel] [RESEND PATCH v1 03/13] acpi, mem-hotplug: Add acpi_memory_hotplug_sci() to rise sci for memory hotplug.

2015-01-07 Thread Tang Chen
Add a new API named acpi_memory_hotplug_sci() to send memory hotplug SCI. Doing this is because this procedure will be used by other functions in the next coming patches. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 12 1 file changed, 8 insertions(+), 4 deletions

[Qemu-devel] [RESEND PATCH v1 05/13] acpi, piix4: Add memory hot unplug request support for piix4.

2015-01-07 Thread Tang Chen
From: Hu Tao Call memory unplug request cb in piix4_device_unplug_request_cb(). Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/acpi/piix4.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 4407388..f809c3a 100644 --- a/hw

[Qemu-devel] [RESEND PATCH v1 07/13] pc-dimm: Add memory hot unplug request support for pc-dimm.

2015-01-07 Thread Tang Chen
Implement memory unplug request cb for pc-dimm, and call it in pc_machine_device_unplug_request_cb(). --- hw/i386/pc.c | 28 ++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 0f3b1e0..f501f1f 100644 --- a/hw/i386/pc.c +++

[Qemu-devel] [RESEND PATCH v1 11/13] pc-dimm: Add memory hot unplug support for pc-dimm.

2015-01-07 Thread Tang Chen
Implement unplug cb for pc-dimm. It remove the corresponding memory region, and unregister vmstat. At last, it calls memory unplug cb to reset memory status and do unparenting. --- hw/i386/pc.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/hw/i386/p

[Qemu-devel] [RESEND PATCH v1 10/13] acpi, ich9: Add memory hot unplug support for ich9.

2015-01-07 Thread Tang Chen
Call memory unplug cb in ich9_pm_device_unplug_cb(). --- hw/acpi/ich9.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 841f57d..0a8e757 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -317,8 +317,14 @@ void ich9_pm_device_un

[Qemu-devel] [RESEND PATCH v1 09/13] acpi, piix4: Add memory hot unplug support for piix4.

2015-01-07 Thread Tang Chen
Call memory unplug cb in piix4_device_unplug_cb(). --- hw/acpi/piix4.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index f809c3a..4ae4867 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -377,8 +377,16 @@ static void piix

[Qemu-devel] [RESEND PATCH v1 08/13] acpi, mem-hotplug: Add unplug cb for memory device.

2015-01-07 Thread Tang Chen
Reset all memory status, and unparent the memory device. --- hw/acpi/memory_hotplug.c | 16 include/hw/acpi/memory_hotplug.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index 3d8e398..2b0c8ca 100644 --- a/hw/

[Qemu-devel] [RESEND PATCH v1 13/13] pc, acpi bios: Add memory hot unplug interface.

2015-01-07 Thread Tang Chen
From: Hu Tao This patch implements MEMORY_SLOT_EJECT_METHOD according to ACPI spec. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/i386/acpi-dsdt-mem-hotplug.dsl | 11 ++- hw/i386/ssdt-mem.dsl | 5 + include/hw/acpi/pc-hotplug.h | 2 ++ 3 files changed

[Qemu-devel] [RESEND PATCH v1 12/13] acpi: Add hardware implementation for memory hot unplug.

2015-01-07 Thread Tang Chen
This patch adds a new bit to memory hotplug IO port indicating that ej0 has been evaluated by guest OS. And call pc-dimm unplug cb to do the real removal. Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- docs/specs/acpi_mem_hotplug.txt | 8 ++-- hw/acpi/memory_hotplug.c| 23

[Qemu-devel] [RESEND PATCH v4 01/10] acpi, mem-hotplug: Use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb().

2014-11-04 Thread Tang Chen
Replace string "slot" in acpi_memory_plug_cb() with MACRO PC_DIMM_SLOT_PROP. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index ed39241..c6580da 10064

[Qemu-devel] [RESEND PATCH v4 02/10] acpi, mem-hotplug: Add acpi_memory_get_slot_status_descriptor() to get MemStatus.

2014-11-04 Thread Tang Chen
Add a new API named acpi_memory_get_slot_status_descriptor() to obtain a single memory slot status. Doing this is because this procedure will be used by other functions in the next coming patches. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 27 +++ 1 file

[Qemu-devel] [RESEND PATCH v4 04/10] acpi, mem-hotplug: Add acpi_memory_unplug_cb() to implement memory unplug.

2014-11-04 Thread Tang Chen
Add a new bool member named is_removing to MemStatus indicating that the memory solt is being removed. Set it to true in acpi_memory_unplug_cb(), and send SCI to guest. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 15 +++ include/hw/acpi/memory_hotplug.h | 3

[Qemu-devel] [RESEND PATCH v4 05/10] acpi, piix4: Add memory hot unplug support for piix4.

2014-11-04 Thread Tang Chen
From: Hu Tao Implement acpi_memory_unplug_cb(), sending an sci to guest to trigger memory hot-remove, and call it in piix4_device_unplug_cb(). Signed-off-by: Hu Tao Signed-off-by: Tang Chen --- hw/acpi/piix4.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/acpi

[Qemu-devel] [RESEND PATCH v4 03/10] acpi, mem-hotplug: Add acpi_memory_hotplug_sci() to rise sci for memory hotplug.

2014-11-04 Thread Tang Chen
Add a new API named acpi_memory_hotplug_sci() to send memory hotplug SCI. Doing this is because this procedure will be used by other functions in the next coming patches. Signed-off-by: Tang Chen --- hw/acpi/memory_hotplug.c | 12 1 file changed, 8 insertions(+), 4 deletions

[Qemu-devel] [RESEND PATCH v4 06/10] acpi, ich9: Add memory hot unplug support for ich9.

2014-11-04 Thread Tang Chen
Implement ich9_pm_device_unplug_cb() to support memory hot-remove, calling acpi_memory_unplug_cb(). And itself will be called in ich9_device_unplug_cb(). Signed-off-by: Tang Chen --- hw/acpi/ich9.c | 12 hw/isa/lpc_ich9.c | 5 +++-- include/hw/acpi/ich9.h | 2 ++ 3

[Qemu-devel] [RESEND PATCH v4 00/10] QEmu memory hot unplug support.

2014-11-04 Thread Tang Chen
x4. pc: Add memory hot unplug support for pc machine. pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support. pc, acpi bios: Add memory hot unplug interface. Tang Chen (6): acpi, mem-hotplug: Use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb(). acpi, mem

  1   2   >