[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 27/28] target-i386: Add x86_cpu_unrealizefn()
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL 27/28] target-i386: Add x86_cpu_unrealizefn() |
Date: |
Tue, 19 Jul 2016 14:22:55 -0300 |
From: Igor Mammedov <address@hidden>
First remove VCPU from exec loop and only then remove lapic.
Signed-off-by: Chen Fan <address@hidden>
Signed-off-by: Gu Zheng <address@hidden>
Signed-off-by: Zhu Guihua <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
target-i386/cpu.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 73ed447..f904671 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -3117,6 +3117,21 @@ out:
}
}
+static void x86_cpu_unrealizefn(DeviceState *dev, Error **errp)
+{
+ X86CPU *cpu = X86_CPU(dev);
+
+#ifndef CONFIG_USER_ONLY
+ cpu_remove_sync(CPU(dev));
+ qemu_unregister_reset(x86_cpu_machine_reset_cb, dev);
+#endif
+
+ if (cpu->apic_state) {
+ object_unparent(OBJECT(cpu->apic_state));
+ cpu->apic_state = NULL;
+ }
+}
+
typedef struct BitProperty {
uint32_t *ptr;
uint32_t mask;
@@ -3363,6 +3378,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc,
void *data)
xcc->parent_realize = dc->realize;
dc->realize = x86_cpu_realizefn;
+ dc->unrealize = x86_cpu_unrealizefn;
dc->props = x86_cpu_properties;
xcc->parent_reset = cc->reset;
--
2.5.5
- [Qemu-devel] [PULL 16/28] pc: Delay setting number of boot CPUs to machine_done time, (continued)
- [Qemu-devel] [PULL 16/28] pc: Delay setting number of boot CPUs to machine_done time, Eduardo Habkost, 2016/07/19
- [Qemu-devel] [PULL 18/28] pc: Forbid BSP removal, Eduardo Habkost, 2016/07/19
- [Qemu-devel] [PULL 19/28] pc: Enforce adding CPUs contiguously and removing them in opposite order, Eduardo Habkost, 2016/07/19
- [Qemu-devel] [PULL 20/28] pc: cpu: Allow device_add to be used with x86 cpu, Eduardo Habkost, 2016/07/19
- [Qemu-devel] [PULL 21/28] pc: Implement query-hotpluggable-cpus callback, Eduardo Habkost, 2016/07/19
- [Qemu-devel] [PULL 23/28] apic: Drop APICCommonState.idx and use APIC ID as index in local_apics[], Eduardo Habkost, 2016/07/19
- [Qemu-devel] [PULL 22/28] apic: move MAX_APICS check to 'apic' class, Eduardo Habkost, 2016/07/19
- [Qemu-devel] [PULL 24/28] apic: kvm-apic: Fix crash due to access to freed memory region, Eduardo Habkost, 2016/07/19
- [Qemu-devel] [PULL 25/28] (kvm)apic: Add unrealize callbacks, Eduardo Habkost, 2016/07/19
- [Qemu-devel] [PULL 26/28] apic: Use apic_id as apic's migration instance_id, Eduardo Habkost, 2016/07/19
- [Qemu-devel] [PULL 27/28] target-i386: Add x86_cpu_unrealizefn(),
Eduardo Habkost <=
- [Qemu-devel] [PULL 28/28] pc: Make device_del CPU work for x86 CPUs, Eduardo Habkost, 2016/07/19
- Re: [Qemu-devel] [PULL 00/28] x86 queue for -rc0, Peter Maydell, 2016/07/20