From patchwork Thu Sep 3 04:28:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 513805 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 020A2140285 for ; Thu, 3 Sep 2015 14:31:42 +1000 (AEST) Received: from localhost ([::1]:44303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXMBX-0000vz-Fc for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2015 00:31:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXM88-0003VJ-M7 for qemu-devel@nongnu.org; Thu, 03 Sep 2015 00:28:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXM86-0002ah-Pq for qemu-devel@nongnu.org; Thu, 03 Sep 2015 00:28:08 -0400 Received: from ozlabs.org ([103.22.144.67]:59070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXM86-0002Y8-4B; Thu, 03 Sep 2015 00:28:06 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 817E31402C6; Thu, 3 Sep 2015 14:28:00 +1000 (AEST) From: David Gibson To: peter.maydell@linaro.org Date: Thu, 3 Sep 2015 14:28:09 +1000 Message-Id: <1441254496-16174-19-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1441254496-16174-1-git-send-email-david@gibson.dropbear.id.au> References: <1441254496-16174-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 Cc: mdroth@linux.vnet.ibm.com, aik@ozlabs.ru, qemu-devel@nongnu.org, agraf@suse.de, qemu-ppc@nongnu.org, Bharata B Rao , David Gibson Subject: [Qemu-devel] [PATCH 18/25] spapr: Populate ibm, associativity-lookup-arrays correctly for non-NUMA X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Bharata B Rao When NUMA isn't configured explicitly, assume node 0 is present for the purpose of creating ibm,associativity-lookup-arrays property under ibm,dynamic-reconfiguration-memory DT node. This ensures that the associativity index property is correctly updated in ibm,dynamic-memory for the LMB that is hotplugged. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson Signed-off-by: David Gibson --- hw/ppc/spapr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 90caabe..a762d21 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -726,6 +726,7 @@ static int spapr_populate_drconf_memory(sPAPRMachineState *spapr, void *fdt) uint32_t nr_lmbs = machine->maxram_size/lmb_size - nr_rma_lmbs; uint32_t nr_assigned_lmbs = machine->ram_size/lmb_size - nr_rma_lmbs; uint32_t *int_buf, *cur_index, buf_len; + int nr_nodes = nb_numa_nodes ? nb_numa_nodes : 1; /* Allocate enough buffer size to fit in ibm,dynamic-memory */ buf_len = nr_lmbs * SPAPR_DR_LMB_LIST_ENTRY_SIZE * sizeof(uint32_t) + @@ -791,10 +792,10 @@ static int spapr_populate_drconf_memory(sPAPRMachineState *spapr, void *fdt) /* ibm,associativity-lookup-arrays */ cur_index = int_buf; - int_buf[0] = cpu_to_be32(nb_numa_nodes); + int_buf[0] = cpu_to_be32(nr_nodes); int_buf[1] = cpu_to_be32(4); /* Number of entries per associativity list */ cur_index += 2; - for (i = 0; i < nb_numa_nodes; i++) { + for (i = 0; i < nr_nodes; i++) { uint32_t associativity[] = { cpu_to_be32(0x0), cpu_to_be32(0x0),