From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ve14w-00079b-2X for qemu-devel@nongnu.org; Wed, 06 Nov 2013 06:15:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ve14o-00042Y-N5 for qemu-devel@nongnu.org; Wed, 06 Nov 2013 06:15:17 -0500 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:54226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ve14n-00041K-RR for qemu-devel@nongnu.org; Wed, 06 Nov 2013 06:15:10 -0500 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Nov 2013 11:15:06 -0000 Date: Wed, 6 Nov 2013 12:13:46 +0100 From: Thomas Huth Message-ID: <20131106121346.1c9ca532@oc7435384737.ibm.com> In-Reply-To: <1383724451-12731-1-git-send-email-aik@ozlabs.ru> References: <1383724451-12731-1-git-send-email-aik@ozlabs.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] spapr: make sure RMA is in first mode of first memory node List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Alexander Graf On Wed, 6 Nov 2013 18:54:11 +1100 Alexey Kardashevskiy wrote: > The SPAPR specification says that the RMA starts at the LPAR's logical > address 0 and is the first logical memory block reported in > the LPAR=E2=80=99s device tree. >=20 > So SLOF only maps the first block and that block needs to span > the full RMA. >=20 > This makes sure that the RMA area is where SLOF expects it. >=20 > Cc: Benjamin Herrenschmidt > Signed-off-by: Alexey Kardashevskiy > --- >=20 > I came up with v1 of the patch but the actual code came from > Alexander Graf. Who should I put as author of this? >=20 > --- > hw/ppc/spapr.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) >=20 > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 57b38cf..57473df 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -1114,6 +1114,7 @@ static void ppc_spapr_init(QEMUMachineInitArgs *arg= s) > MemoryRegion *sysmem =3D get_system_memory(); > MemoryRegion *ram =3D g_new(MemoryRegion, 1); > hwaddr rma_alloc_size; > + hwaddr node0_size =3D (nb_numa_nodes > 1) ? node_mem[0] : ram_size; > uint32_t initrd_base =3D 0; > long kernel_size =3D 0, initrd_size =3D 0; > long load_limit, rtas_limit, fw_size; > @@ -1138,7 +1139,7 @@ static void ppc_spapr_init(QEMUMachineInitArgs *arg= s) > if (rma_alloc_size && (rma_alloc_size < ram_size)) { > spapr->rma_size =3D rma_alloc_size; > } else { > - spapr->rma_size =3D ram_size; > + spapr->rma_size =3D node0_size; >=20 > /* With KVM, we don't actually know whether KVM supports an > * unbounded RMA (PR KVM) or is limited by the hash table size > @@ -1155,6 +1156,12 @@ static void ppc_spapr_init(QEMUMachineInitArgs *ar= gs) > } > } >=20 > + if (spapr->rma_size > node0_size) { > + fprintf(stderr, "Error: Numa node 0 has to span the RMA (%#08"HW= ADDR_PRIx")\n", > + spapr->rma_size); > + exit(1); > + } > + What about the "if (spapr->rma_size > node0_size)" at the beginning of spapr_populate_memory()? Could/should that go away now? Thomas