From patchwork Tue Jan 19 04:39:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharata B Rao X-Patchwork-Id: 8058131 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7BF839F859 for ; Tue, 19 Jan 2016 04:40:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E3FCF20357 for ; Tue, 19 Jan 2016 04:40:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 203AF2034A for ; Tue, 19 Jan 2016 04:40:39 +0000 (UTC) Received: from localhost ([::1]:34972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLO5u-0004Hx-BA for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Jan 2016 23:40:38 -0500 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 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 19 Jan 2016 14:40:17 +1000 X-IBM-Helo: d23dlp03.au.ibm.com X-IBM-MailFrom: bharata@linux.vnet.ibm.com X-IBM-RcptTo: qemu-devel@nongnu.org;qemu-ppc@nongnu.org Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 490B23578054; Tue, 19 Jan 2016 15:40:17 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0J4e9L846006320; Tue, 19 Jan 2016 15:40:17 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0J4dils024890; Tue, 19 Jan 2016 15:39:44 +1100 Received: from bharata.in.ibm.com ([9.124.35.146]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u0J4dhF9024453; Tue, 19 Jan 2016 15:39:43 +1100 From: Bharata B Rao To: qemu-devel@nongnu.org Date: Tue, 19 Jan 2016 10:09:21 +0530 Message-Id: <1453178361-24244-1-git-send-email-bharata@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16011904-0009-0000-0000-000002CB41C2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 202.81.31.145 Cc: Bharata B Rao , qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Subject: [Qemu-devel] [PATCH] spapr: Don't create ibm, dynamic-reconfiguration-memory w/o DR LMBs 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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))); }