From nobody Sun Apr 28 04:56:52 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522939028756367.63705025236015; Thu, 5 Apr 2018 07:37:08 -0700 (PDT) Received: from localhost ([::1]:33888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f460d-0008A6-IY for importer@patchew.org; Thu, 05 Apr 2018 10:37:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f45zF-0007RK-IW for qemu-devel@nongnu.org; Thu, 05 Apr 2018 10:35:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f45zB-0001Ql-Ko for qemu-devel@nongnu.org; Thu, 05 Apr 2018 10:35:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35742 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 1f45zB-0001QP-Fe; Thu, 05 Apr 2018 10:35:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 895FE40201A4; Thu, 5 Apr 2018 14:35:28 +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 7D6B11208F8B; Thu, 5 Apr 2018 14:35:28 +0000 (UTC) From: Serhii Popovych To: qemu-ppc@nongnu.org Date: Thu, 5 Apr 2018 10:35:22 -0400 Message-Id: <1522938923-96058-2-git-send-email-spopovyc@redhat.com> In-Reply-To: <1522938923-96058-1-git-send-email-spopovyc@redhat.com> References: <1522938923-96058-1-git-send-email-spopovyc@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 05 Apr 2018 14:35:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 05 Apr 2018 14:35:28 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 1/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. 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 2c0be8c..3ad4545 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3477,28 +3477,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 From nobody Sun Apr 28 04:56:52 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 Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522939029609158.89684804553315; Thu, 5 Apr 2018 07:37:09 -0700 (PDT) Received: from localhost ([::1]:33890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f460d-0008AQ-6k for importer@patchew.org; Thu, 05 Apr 2018 10:37:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f45zF-0007RJ-ID for qemu-devel@nongnu.org; Thu, 05 Apr 2018 10:35:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f45zB-0001Qg-KU for qemu-devel@nongnu.org; Thu, 05 Apr 2018 10:35:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40696 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 1f45zB-0001QR-Fb; Thu, 05 Apr 2018 10:35:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 922C1407247A; Thu, 5 Apr 2018 14:35:28 +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 86A5110B00AA; Thu, 5 Apr 2018 14:35:28 +0000 (UTC) From: Serhii Popovych To: qemu-ppc@nongnu.org Date: Thu, 5 Apr 2018 10:35:23 -0400 Message-Id: <1522938923-96058-3-git-send-email-spopovyc@redhat.com> In-Reply-To: <1522938923-96058-1-git-send-email-spopovyc@redhat.com> References: <1522938923-96058-1-git-send-email-spopovyc@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 05 Apr 2018 14:35:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 05 Apr 2018 14:35:28 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 2/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 3ad4545..e02fc94 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(max_cpus - 1), + }; =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