From nobody Fri May 3 12:12:21 2024 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; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523384065613944.680002094978; Tue, 10 Apr 2018 11:14:25 -0700 (PDT) Received: from localhost ([::1]:34193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5xmi-0000Hd-Ey for importer@patchew.org; Tue, 10 Apr 2018 14:14:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5xl2-0007mS-By for qemu-devel@nongnu.org; Tue, 10 Apr 2018 14:12:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5xkz-0000t2-7z for qemu-devel@nongnu.org; Tue, 10 Apr 2018 14:12:40 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34588 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f5xkz-0000sH-3Y; Tue, 10 Apr 2018 14:12:37 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 40F1E406E8BD; Tue, 10 Apr 2018 18:12:31 +0000 (UTC) Received: from tuxracer.localdomain (ibm-p8-virt-03.lab.eng.rdu.redhat.com [10.12.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 35F9E215CDC8; Tue, 10 Apr 2018 18:12:31 +0000 (UTC) From: Serhii Popovych To: qemu-ppc@nongnu.org Date: Tue, 10 Apr 2018 14:12:25 -0400 Message-Id: <1523383946-37373-2-git-send-email-spopovyc@redhat.com> In-Reply-To: <1523383946-37373-1-git-send-email-spopovyc@redhat.com> References: <1523383946-37373-1-git-send-email-spopovyc@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 10 Apr 2018 18:12:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 10 Apr 2018 18:12:31 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'spopovyc@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH for 2.13 v2 1/2] spapr: Add ibm, max-associativity-domains property 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: david@gibson.dropbear.id.au, qemu-devel@nongnu.org, bharata@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Now recent kernels (i.e. since linux-stable commit a346137e9142 ("powerpc/numa: Use ibm,max-associativity-domains to discover possible node= s") support this property to mark initially memory-less NUMA nodes as "possible" to allow further memory hot-add to them. Advertise this property for pSeries machines to let guest kernels detect maximum supported node configuration and benefit from kernel side change when hot-add memory to specific, possibly empty before, NUMA node. Signed-off-by: Serhii Popovych --- hw/ppc/spapr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 2c0be8c..3f61785 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -909,6 +909,14 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, vo= id *fdt) 0, cpu_to_be32(SPAPR_MEMORY_BLOCK_SIZE), cpu_to_be32(max_cpus / smp_threads), }; + uint32_t maxdomains[] =3D { + cpu_to_be32(5), + cpu_to_be32(0), + cpu_to_be32(0), + cpu_to_be32(0), + cpu_to_be32(nb_numa_nodes - 1), + cpu_to_be32(0), + }; =20 _FDT(rtas =3D fdt_add_subnode(fdt, 0, "rtas")); =20 @@ -945,6 +953,9 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, voi= d *fdt) _FDT(fdt_setprop(fdt, rtas, "ibm,associativity-reference-points", refpoints, sizeof(refpoints))); =20 + _FDT(fdt_setprop(fdt, rtas, "ibm,max-associativity-domains", + maxdomains, sizeof(maxdomains))); + _FDT(fdt_setprop_cell(fdt, rtas, "rtas-error-log-max", RTAS_ERROR_LOG_MAX)); _FDT(fdt_setprop_cell(fdt, rtas, "rtas-event-scan-rate", --=20 1.8.3.1 From nobody Fri May 3 12:12:21 2024 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; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523384232204839.805247762019; Tue, 10 Apr 2018 11:17:12 -0700 (PDT) Received: from localhost ([::1]:34244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5xpM-0002Fo-6U for importer@patchew.org; Tue, 10 Apr 2018 14:17:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5xl2-0007mT-CJ for qemu-devel@nongnu.org; Tue, 10 Apr 2018 14:12:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5xkz-0000ss-6s for qemu-devel@nongnu.org; Tue, 10 Apr 2018 14:12:40 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:47196 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f5xkz-0000sF-3c; Tue, 10 Apr 2018 14:12:37 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 490AF4068045; Tue, 10 Apr 2018 18:12:31 +0000 (UTC) Received: from tuxracer.localdomain (ibm-p8-virt-03.lab.eng.rdu.redhat.com [10.12.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3E6A1215CDC6; Tue, 10 Apr 2018 18:12:31 +0000 (UTC) From: Serhii Popovych To: qemu-ppc@nongnu.org Date: Tue, 10 Apr 2018 14:12:26 -0400 Message-Id: <1523383946-37373-3-git-send-email-spopovyc@redhat.com> In-Reply-To: <1523383946-37373-1-git-send-email-spopovyc@redhat.com> References: <1523383946-37373-1-git-send-email-spopovyc@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 10 Apr 2018 18:12:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 10 Apr 2018 18:12:31 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'spopovyc@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH for 2.13 v2 2/2] 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: david@gibson.dropbear.id.au, qemu-devel@nongnu.org, bharata@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 --- hw/ppc/spapr.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 3f61785..cd7a347 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3488,28 +3488,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 1.8.3.1