From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcC11-0000Nk-LJ for qemu-devel@nongnu.org; Fri, 01 Nov 2013 06:31:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VcC0u-0001wL-4p for qemu-devel@nongnu.org; Fri, 01 Nov 2013 06:31:43 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:56690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcC0t-0001wG-En for qemu-devel@nongnu.org; Fri, 01 Nov 2013 06:31:36 -0400 Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 1 Nov 2013 20:21:32 +1000 From: Alexey Kardashevskiy Date: Fri, 1 Nov 2013 21:21:16 +1100 Message-Id: <1383301276-29566-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH] 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: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Alexander Graf , Nikunj A Dadhania SLOF gets really confused if RTAS/device-tree and everything else what SLOF can use is not in the very first block of the very first memory node. This makes sure that the RMA area is where SLOF expects it to be. Cc: Benjamin Herrenschmidt Cc: Nikunj A Dadhania Signed-off-by: Alexey Kardashevskiy --- hw/ppc/spapr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 09dc635..09a5d94 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1113,7 +1113,7 @@ static void ppc_spapr_init(QEMUMachineInitArgs *args) int i; MemoryRegion *sysmem = get_system_memory(); MemoryRegion *ram = g_new(MemoryRegion, 1); - hwaddr rma_alloc_size; + hwaddr rma_alloc_size, node0_size; uint32_t initrd_base = 0; long kernel_size = 0, initrd_size = 0; long load_limit, rtas_limit, fw_size; @@ -1154,6 +1154,12 @@ static void ppc_spapr_init(QEMUMachineInitArgs *args) spapr->rma_size = MIN(spapr->rma_size, 0x10000000); } } + /* + * SLOF gets confused if RMA resides not in the first block + * of the first memory node so let's fix it. + */ + node0_size = (nb_numa_nodes > 1) ? node_mem[0] : ram_size; + spapr->rma_size = MIN(spapr->rma_size, node0_size); /* We place the device tree and RTAS just below either the top of the RMA, * or just below 2GB, whichever is lowere, so that it can be -- 1.8.4.rc4