[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 04/16] pc: forbid BSP removal
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH v5 04/16] pc: forbid BSP removal |
Date: |
Tue, 19 Jul 2016 09:55:47 -0300 |
User-agent: |
Mutt/1.6.1 (2016-04-27) |
On Mon, Jul 18, 2016 at 10:31:22AM +0200, Igor Mammedov wrote:
> Boot CPU is assumed to always present in QEMU code, so
> untile that assumptions are gone, deny removal request,
> In another words QEMU won't support BSP hot-unplug.
>
> Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
> ---
> v5:
> - s/1st CPU (BSP)/Boot CPU/
> Eduardo Habkost <address@hidden>
> - intialize idx to -1 and assert on it,
> Eduardo Habkost <address@hidden>
> (note: that should nexer happen in current code as we don't
> have stray CPUs and most likely never will, but it doesn't
> hurt to cautios)
> ---
> hw/i386/pc.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 110f1bf..e15fcc1 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1757,10 +1757,18 @@ out:
> static void pc_cpu_unplug_request_cb(HotplugHandler *hotplug_dev,
> DeviceState *dev, Error **errp)
> {
> + int idx = -1;
> HotplugHandlerClass *hhc;
> Error *local_err = NULL;
> PCMachineState *pcms = PC_MACHINE(hotplug_dev);
>
> + pc_find_cpu_slot(pcms, CPU(dev), &idx);
> + assert(idx != -1);
> + if (idx == 0) {
> + error_setg(&local_err, "Boot CPU is unpluggable");
> + goto out;
> + }
> +
> hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev);
> hhc->unplug_request(HOTPLUG_HANDLER(pcms->acpi_dev), dev, &local_err);
>
> --
> 2.7.4
>
--
Eduardo
- Re: [Qemu-devel] [PATCH v4 02/16] pc: delay setting number of boot CPUs to machine_done time, (continued)
- [Qemu-devel] [PATCH v5 04/16] pc: forbid BSP removal, Igor Mammedov, 2016/07/18
- Re: [Qemu-devel] [PATCH v5 04/16] pc: forbid BSP removal,
Eduardo Habkost <=
[Qemu-devel] [PATCH v4 05/16] pc: enforce adding CPUs contiguously and removing them in opposit order, Igor Mammedov, 2016/07/14
[Qemu-devel] [PATCH v5 05/16] pc: enforce adding CPUs contiguously and removing them in opposit order, Igor Mammedov, 2016/07/18
Re: [Qemu-devel] [PATCH v4 05/16] pc: enforce adding CPUs contiguously and removing them in opposit order, Eric Blake, 2016/07/18
[Qemu-devel] [PATCH v4 06/16] pc: cpu: allow device_add to be used with x86 cpu, Igor Mammedov, 2016/07/14
[Qemu-devel] [PATCH v4 07/16] pc: implement query-hotpluggable-cpus callback, Igor Mammedov, 2016/07/14