Received: from eggs.gnu.org ([2001:4830:134:3::10]:43503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLO5l-0004Gs-KZ for qemu-devel@nongnu.org; Mon, 18 Jan 2016 23:40:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLO5g-0004x9-Ka for qemu-devel@nongnu.org; Mon, 18 Jan 2016 23:40:29 -0500 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:42634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLO5g-0004x0-1j for qemu-devel@nongnu.org; Mon, 18 Jan 2016 23:40:24 -0500 Received: from localhost by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 Jan 2016 14:40:20 +1000 From: Bharata B Rao Date: Tue, 19 Jan 2016 10:09:21 +0530 Message-Id: <1453178361-24244-1-git-send-email-bharata@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH] spapr: Don't create ibm, dynamic-reconfiguration-memory w/o DR LMBs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Bharata B Rao , qemu-ppc@nongnu.org, david@gibson.dropbear.id.au If guest doesn't have any dynamically reconfigurable (DR) logical memory blocks (LMB), then we shouldn't create ibm,dynamic-reconfiguration-memory device tree node. Signed-off-by: Bharata B Rao --- This applies against ppc-for-2.6 branch of David Gibson's tree. hw/ppc/spapr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 50e5a26..86e5023 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -763,6 +763,13 @@ static int spapr_populate_drconf_memory(sPAPRMachineState *spapr, void *fdt) int nr_nodes = nb_numa_nodes ? nb_numa_nodes : 1; /* + * Don't create the node if there are no DR LMBs. + */ + if (!nr_lmbs) { + return 0; + } + + /* * Allocate enough buffer size to fit in ibm,dynamic-memory * or ibm,associativity-lookup-arrays */ @@ -868,7 +875,7 @@ int spapr_h_cas_compose_response(sPAPRMachineState *spapr, _FDT((spapr_fixup_cpu_dt(fdt, spapr))); } - /* Generate memory nodes or ibm,dynamic-reconfiguration-memory node */ + /* Generate ibm,dynamic-reconfiguration-memory node if required */ if (memory_update && smc->dr_lmb_enabled) { _FDT((spapr_populate_drconf_memory(spapr, fdt))); } -- 2.1.0