[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 31/32] spapr: make sure RMA is in first mode of first
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PULL 31/32] spapr: make sure RMA is in first mode of first memory node |
Date: |
Fri, 20 Dec 2013 02:00:53 +0100 |
From: Alexey Kardashevskiy <address@hidden>
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’s device tree.
So SLOF only maps the first block and that block needs to span
the full RMA.
This makes sure that the RMA area is where SLOF expects it.
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ppc/spapr.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 38b43c9..6a79b1f 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -532,9 +532,6 @@ static int spapr_populate_memory(sPAPREnvironment *spapr,
void *fdt)
/* memory node(s) */
node0_size = (nb_numa_nodes > 1) ? node_mem[0] : ram_size;
- if (spapr->rma_size > node0_size) {
- spapr->rma_size = node0_size;
- }
/* RMA */
mem_reg_property[0] = 0;
@@ -688,7 +685,8 @@ static void spapr_reset_htab(sPAPREnvironment *spapr)
/* Update the RMA size if necessary */
if (spapr->vrma_adjust) {
- spapr->rma_size = kvmppc_rma_size(ram_size, spapr->htab_shift);
+ hwaddr node0_size = (nb_numa_nodes > 1) ? node_mem[0] : ram_size;
+ spapr->rma_size = kvmppc_rma_size(node0_size, spapr->htab_shift);
}
}
@@ -1105,6 +1103,7 @@ static void ppc_spapr_init(QEMUMachineInitArgs *args)
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *ram = g_new(MemoryRegion, 1);
hwaddr rma_alloc_size;
+ hwaddr node0_size = (nb_numa_nodes > 1) ? node_mem[0] : ram_size;
uint32_t initrd_base = 0;
long kernel_size = 0, initrd_size = 0;
long load_limit, rtas_limit, fw_size;
@@ -1126,10 +1125,10 @@ static void ppc_spapr_init(QEMUMachineInitArgs *args)
exit(1);
}
- if (rma_alloc_size && (rma_alloc_size < ram_size)) {
+ if (rma_alloc_size && (rma_alloc_size < node0_size)) {
spapr->rma_size = rma_alloc_size;
} else {
- spapr->rma_size = ram_size;
+ spapr->rma_size = node0_size;
/* With KVM, we don't actually know whether KVM supports an
* unbounded RMA (PR KVM) or is limited by the hash table size
@@ -1146,6 +1145,12 @@ static void ppc_spapr_init(QEMUMachineInitArgs *args)
}
}
+ if (spapr->rma_size > node0_size) {
+ fprintf(stderr, "Error: Numa node 0 has to span the RMA
(%#08"HWADDR_PRIx")\n",
+ spapr->rma_size);
+ exit(1);
+ }
+
/* 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
* processed with 32-bit real mode code if necessary */
--
1.8.1.4
- [Qemu-devel] [PULL 24/32] Add xxmrgh/xxmrgl, (continued)
- [Qemu-devel] [PULL 24/32] Add xxmrgh/xxmrgl, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 10/32] Add lxsdx, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 09/32] Add xxpermdi, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 12/32] Add lxvw4x, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 13/32] Add stxsdx, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 15/32] target-ppc: move POWER7+ to a separate family, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 23/32] Add Power7 VSX Logical Instructions, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 19/32] spapr: tie spapr-nvram to -pflash, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 17/32] spapr-rtas: add ibm, (get|set)-system-parameter, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 18/32] PPC: Use default pci bus name for grackle and heathrow, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 31/32] spapr: make sure RMA is in first mode of first memory node,
Alexander Graf <=
- [Qemu-devel] [PULL 28/32] PPC: Add VSX to hflags, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 27/32] Add xxsldwi, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 22/32] Add VSX Vector Move Instructions, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 26/32] Add xxspltw, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 16/32] spapr-rtas: replace return code constants with macros, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 29/32] device_tree: s/qemu_devtree/qemu_fdt globally, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 25/32] Add xxsel, Alexander Graf, 2013/12/19
- [Qemu-devel] [PULL 32/32] spapr: limit numa memory regions by ram size, Alexander Graf, 2013/12/19