qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	Richard Henderson <rth@twiddle.net>,
	Eduardo Habkost <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	Alexander Graf <agraf@suse.de>, Riku Voipio <riku.voipio@iki.fi>,
	Bharata B Rao <bharata@linux.vnet.ibm.com>,
	qemu-ppc@nongnu.org
Subject: [Qemu-devel] [PATCH 7/8] Revert "pc: Enforce adding CPUs contiguously and removing them in opposite order"
Date: Thu, 21 Jul 2016 17:54:38 +0200	[thread overview]
Message-ID: <1469116479-233280-8-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1469116479-233280-1-git-send-email-imammedo@redhat.com>

This reverts commit 4da7faaeb0c7dd3f7f233165d336c878f78fd1eb.

However since commit:
  pc: init CPUState->cpu_index with index in possible_cpus[]
cpu_index is stable regardless of the order cpus were created
and QEMU instance stays migratable always so limitation added
by 4da7faaeb could be safely removed.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/i386/pc.c | 34 ----------------------------------
 1 file changed, 34 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 316fb43..d0e392a 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1815,23 +1815,6 @@ static void pc_cpu_unplug_request_cb(HotplugHandler *hotplug_dev,
         goto out;
     }
 
-    if (idx < pcms->possible_cpus->len - 1 &&
-        pcms->possible_cpus->cpus[idx + 1].cpu != NULL) {
-        X86CPU *cpu;
-
-        for (idx = pcms->possible_cpus->len - 1;
-             pcms->possible_cpus->cpus[idx].cpu == NULL; idx--) {
-            ;;
-        }
-
-        cpu = X86_CPU(pcms->possible_cpus->cpus[idx].cpu);
-        error_setg(&local_err, "CPU [socket-id: %u, core-id: %u,"
-                   " thread-id: %u] should be removed first",
-                   cpu->socket_id, cpu->core_id, cpu->thread_id);
-        goto out;
-
-    }
-
     hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev);
     hhc->unplug_request(HOTPLUG_HANDLER(pcms->acpi_dev), dev, &local_err);
 
@@ -1929,23 +1912,6 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev,
         return;
     }
 
-    if (idx != 0 && pcms->possible_cpus->cpus[idx - 1].cpu == NULL) {
-        PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
-
-        for (idx = 1; pcms->possible_cpus->cpus[idx].cpu != NULL; idx++) {
-            ;;
-        }
-
-        x86_topo_ids_from_apicid(pcms->possible_cpus->cpus[idx].arch_id,
-                                 smp_cores, smp_threads, &topo);
-
-        if (!pcmc->legacy_cpu_hotplug) {
-            error_setg(errp, "CPU [socket: %u, core: %u, thread: %u] should be"
-                       " added first", topo.pkg_id, topo.core_id, topo.smt_id);
-            return;
-        }
-    }
-
     /* if 'address' properties socket-id/core-id/thread-id are not set, set them
      * so that query_hotpluggable_cpus would show correct values
      */
-- 
2.7.4

  parent reply	other threads:[~2016-07-21 15:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21 15:54 [Qemu-devel] [PATCH 0/8] Fix migration issues with arbitrary cpu-hot(un)plug Igor Mammedov
2016-07-21 15:54 ` [Qemu-devel] [PATCH 1/8] exec: reduce CONFIG_USER_ONLY ifdeffenery Igor Mammedov
2016-07-22  1:30   ` David Gibson
2016-07-21 15:54 ` [Qemu-devel] [PATCH 2/8] exec: don't use cpu_index to detect if cpu_exec_init()'s been called for cpu Igor Mammedov
2016-07-22  1:32   ` David Gibson
2016-07-22 20:46     ` Eduardo Habkost
2016-07-25  8:30       ` Igor Mammedov
2016-07-21 15:54 ` [Qemu-devel] [PATCH 3/8] exec: set cpu_index only if it's been explictly set Igor Mammedov
2016-07-22  1:35   ` David Gibson
2016-07-21 15:54 ` [Qemu-devel] [PATCH 4/8] qdev: fix object reference leak in case device.realize() fails Igor Mammedov
2016-07-22  1:39   ` David Gibson
2016-07-21 15:54 ` [Qemu-devel] [PATCH 5/8] pc: init CPUState->cpu_index with index in possible_cpus[] Igor Mammedov
2016-07-22  1:41   ` David Gibson
2016-07-21 15:54 ` [Qemu-devel] [PATCH 6/8] spapr: init CPUState->cpu_index with index relative to core-id Igor Mammedov
2016-07-22  3:23   ` David Gibson
2016-07-22  6:10     ` Bharata B Rao
2016-07-22  7:14       ` David Gibson
2016-07-22  7:20         ` Bharata B Rao
2016-07-22  8:42         ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2016-07-26  3:27   ` [Qemu-devel] " David Gibson
2016-07-21 15:54 ` Igor Mammedov [this message]
2016-07-21 15:54 ` [Qemu-devel] [PATCH 8/8] Revert "spapr: Ensure CPU cores are added contiguously and removed in LIFO order" Igor Mammedov
2016-07-21 21:56 ` [Qemu-devel] [PATCH 0/8] Fix migration issues with arbitrary cpu-hot(un)plug Michael S. Tsirkin
2016-07-22  4:35   ` David Gibson
2016-07-22 10:01     ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469116479-233280-8-git-send-email-imammedo@redhat.com \
    --to=imammedo@redhat.com \
    --cc=agraf@suse.de \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=ehabkost@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=riku.voipio@iki.fi \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).