From nobody Wed Oct 29 17:31:57 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524823398945256.71603091472264; Fri, 27 Apr 2018 03:03:18 -0700 (PDT) Received: from localhost ([::1]:46926 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC0Df-0005lH-K5 for importer@patchew.org; Fri, 27 Apr 2018 06:03:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBzac-0002F1-IW for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:22:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBzab-0002Lh-PQ for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:22:50 -0400 Received: from ozlabs.org ([203.11.71.1]:45353) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fBzab-0002Kf-DA; Fri, 27 Apr 2018 05:22:49 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 40XT2q73mtz9s5K; Fri, 27 Apr 2018 19:21:36 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1524820899; bh=WoGSlt0kJwPMX2GMF4ICcBFbvub12gf+5EnbaBpMqCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QATxAWvUXYXGYNO0mjElBtwzEHqqh7SAx4VnHBBQkftirjbCOq2Rw/BXOof3yldO1 D2WWzaG23AaEDfSFwi0vYfhUNTyJT1YTybfgD49NxQY998UROPG6qF5JsILBfJJgVh PsH2D8xSvxTd3OgmFRaNZO5ywPZhU54dLGk6XF08= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 27 Apr 2018 19:21:06 +1000 Message-Id: <20180427092126.24812-30-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180427092126.24812-1-david@gibson.dropbear.id.au> References: <20180427092126.24812-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 29/49] Revert "spapr: Don't allow memory hotplug to memory less nodes" 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: Serhii Popovych , qemu-ppc@nongnu.org, groug@kaod.org, David Gibson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Serhii Popovych This reverts commit b556854bd8524c26b8be98ab1bfdf0826831e793. Leave change @node type from uint32_t to to int from reverted commit because node < 0 is always false. Note that implementing capability or some trick to detect if guest kernel does not support hot-add to memory: this returns previous behavour where memory added to first non-empty node. Signed-off-by: Serhii Popovych Signed-off-by: David Gibson --- hw/ppc/spapr.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 5a1c1e25e1..fc86ba6934 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3478,28 +3478,6 @@ static void spapr_machine_device_plug(HotplugHandler= *hotplug_dev, return; } =20 - /* - * Currently PowerPC kernel doesn't allow hot-adding memory to - * memory-less node, but instead will silently add the memory - * to the first node that has some memory. This causes two - * unexpected behaviours for the user. - * - * - Memory gets hotplugged to a different node than what the user - * specified. - * - Since pc-dimm subsystem in QEMU still thinks that memory belo= ngs - * to memory-less node, a reboot will set things accordingly - * and the previously hotplugged memory now ends in the right no= de. - * This appears as if some memory moved from one node to another. - * - * So until kernel starts supporting memory hotplug to memory-less - * nodes, just prevent such attempts upfront in QEMU. - */ - if (nb_numa_nodes && !numa_info[node].node_mem) { - error_setg(errp, "Can't hotplug memory to memory-less node %d", - node); - return; - } - spapr_memory_plug(hotplug_dev, dev, node, errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_CPU_CORE)) { spapr_core_plug(hotplug_dev, dev, errp); --=20 2.14.3