From patchwork Fri Jul 29 04:53:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 653989 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s0xPM0fQtz9sC4 for ; Fri, 29 Jul 2016 15:00:23 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b=nAH3KY+U; dkim-atps=neutral Received: from localhost ([::1]:57410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSzuH-0006si-2w for incoming@patchwork.ozlabs.org; Fri, 29 Jul 2016 01:00:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSzmD-0007tC-NH for qemu-devel@nongnu.org; Fri, 29 Jul 2016 00:52:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSzm6-0002Yr-UF for qemu-devel@nongnu.org; Fri, 29 Jul 2016 00:52:01 -0400 Received: from ozlabs.org ([103.22.144.67]:52870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSzm6-0002YI-KH; Fri, 29 Jul 2016 00:51:54 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3s0xCV5jFgz9t2B; Fri, 29 Jul 2016 14:51:49 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1469767910; bh=aMLzlmADccXOYd0ZYiqhYz7ciQHdeeG1BQ+FU/P4nAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nAH3KY+Uga1X2QHhNK4e021cTl++R+b0JsItQczd+s3W/xvcDvJ/LrLlBFXD8mcoM MppWl26Yapj64REfaC2EBV6cQgBHYhgsW4sdT9UDz6pFiJcEcvJlZpxZ1NjtxqbdcM Hv/wIICwGTv+2aixtxbt5tN7pQmKkJYdQMgg3PeE= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 29 Jul 2016 14:53:43 +1000 Message-Id: <1469768024-32108-6-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1469768024-32108-1-git-send-email-david@gibson.dropbear.id.au> References: <1469768024-32108-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PULL 5/6] spapr: Prevent boot CPU core removal 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: pkrempa@redhat.com, ehabkost@redhat.com, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Bharata B Rao , imammedo@redhat.com, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Bharata B Rao Boot CPU is assumed to be always present in QEMU code. So until that assumptions are gone, deny removal request. In another words, QEMU won't support boot CPU core hot-unplug. Signed-off-by: Bharata B Rao [dwg: Tweaked error message for clarity] Signed-off-by: David Gibson --- hw/ppc/spapr_cpu_core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 5a132bf..ec81ee6 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -133,6 +133,11 @@ void spapr_core_unplug(HotplugHandler *hotplug_dev, DeviceState *dev, sPAPRDRConnectorClass *drck; Error *local_err = NULL; + if (index == 0) { + error_setg(errp, "Boot CPU core may not be unplugged"); + return; + } + g_assert(drc); drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);