From patchwork Wed Jul 27 14:29:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 9249901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C2E39607F0 for ; Wed, 27 Jul 2016 14:34:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB42F26530 for ; Wed, 27 Jul 2016 14:34:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F49B26D08; Wed, 27 Jul 2016 14:34:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4ACB026530 for ; Wed, 27 Jul 2016 14:34:50 +0000 (UTC) Received: from localhost ([::1]:46803 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSPv6-0004h6-Vt for patchwork-qemu-devel@patchwork.kernel.org; Wed, 27 Jul 2016 10:34:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSPq9-0000lF-9l for qemu-devel@nongnu.org; Wed, 27 Jul 2016 10:29:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSPq7-0005P9-8A for qemu-devel@nongnu.org; Wed, 27 Jul 2016 10:29:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSPq7-0005Og-23 for qemu-devel@nongnu.org; Wed, 27 Jul 2016 10:29:39 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AA085C050938; Wed, 27 Jul 2016 14:29:38 +0000 (UTC) Received: from localhost (vpn1-5-116.gru2.redhat.com [10.97.5.116]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6RETbUj012959; Wed, 27 Jul 2016 10:29:38 -0400 From: Eduardo Habkost To: Peter Maydell Date: Wed, 27 Jul 2016 11:29:18 -0300 Message-Id: <1469629761-23274-7-git-send-email-ehabkost@redhat.com> In-Reply-To: <1469629761-23274-1-git-send-email-ehabkost@redhat.com> References: <1469629761-23274-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 27 Jul 2016 14:29:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 6/9] Revert "pc: Enforce adding CPUs contiguously and removing them in opposite order" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcel Apfelbaum , Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Igor Mammedov This reverts commit 4da7faaeb0c7dd3f7f233165d336c878f78fd1eb. 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 Reviewed-by: Michael S. Tsirkin Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index d6f0347..47593b7 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1818,23 +1818,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); @@ -1932,23 +1915,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 */