From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byT1m-0007mO-9e for qemu-devel@nongnu.org; Sun, 23 Oct 2016 20:22:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byT1i-0005EG-QU for qemu-devel@nongnu.org; Sun, 23 Oct 2016 20:22:10 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45562 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1byT1i-0005Dh-LD for qemu-devel@nongnu.org; Sun, 23 Oct 2016 20:22:06 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9O0IdjJ049365 for ; Sun, 23 Oct 2016 20:22:06 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 2692a9s441-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 23 Oct 2016 20:22:06 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 23 Oct 2016 18:22:05 -0600 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Roth In-Reply-To: <1477018600-6881-5-git-send-email-david@gibson.dropbear.id.au> References: <1477018600-6881-1-git-send-email-david@gibson.dropbear.id.au> <1477018600-6881-5-git-send-email-david@gibson.dropbear.id.au> Date: Sun, 23 Oct 2016 18:25:37 -0500 Message-Id: <20161023232537.17113.2813@loki> Subject: Re: [Qemu-devel] [PATCHv2 04/12] pseries: Move adding of fdt reserve map entries List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , aik@ozlabs.ru, groug@kaod.org Cc: agraf@suse.de, lvivier@redhat.com, thuth@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org Quoting David Gibson (2016-10-20 21:56:32) > The flattened device tree passed to pseries guests contains a list of > reserved memory areas. Currently we construct this list early in > spapr_create_fdt_skel() as we sequentially write the fdt. > = > This will be inconvenient for upcoming cleanups, so this patch moves > the reserve map changes to the end of fdt construction. This changes > fdt_add_reservemap_entry() calls - which work when writing the fdt > sequentially to fdt_add_mem_rsv() calls used when altering the fdt in > random access mode. > = > Signed-off-by: David Gibson > Reviewed-by: Thomas Huth Reviewed-by: Michael Roth > --- > hw/ppc/spapr.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > = > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index b4c4353..1eddd1b 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -301,14 +301,6 @@ static void *spapr_create_fdt_skel(sPAPRMachineState= *spapr) > fdt =3D g_malloc0(FDT_MAX_SIZE); > _FDT((fdt_create(fdt, FDT_MAX_SIZE))); > = > - if (spapr->kernel_size) { > - _FDT((fdt_add_reservemap_entry(fdt, KERNEL_LOAD_ADDR, > - spapr->kernel_size))); > - } > - if (spapr->initrd_size) { > - _FDT((fdt_add_reservemap_entry(fdt, spapr->initrd_base, > - spapr->initrd_size))); > - } > _FDT((fdt_finish_reservemap(fdt))); > = > /* Root node */ > @@ -997,6 +989,15 @@ static void *spapr_build_fdt(sPAPRMachineState *spap= r, > } > = > g_free(bootlist); > + > + /* Build memory reserve map */ > + if (spapr->kernel_size) { > + _FDT((fdt_add_mem_rsv(fdt, KERNEL_LOAD_ADDR, spapr->kernel_size)= )); > + } > + if (spapr->initrd_size) { > + _FDT((fdt_add_mem_rsv(fdt, spapr->initrd_base, spapr->initrd_siz= e))); > + } > + > return fdt; > } > = > -- = > 2.7.4 >=20