aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2021-09-02 15:09:10 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2021-09-29 19:37:39 +1000
commitf640afec1a14e99d561f7da93e3fc8a5e1206384 (patch)
tree0fa018f452a7d05dd8e0e6ffffcc42e311e1d5b7 /hw
parent325ba52a4e53fac6db65fcb3bd995e8e56a89eb0 (diff)
ppc/pnv: Add an assert when calculating the RAM distribution on chips
Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20210902130928.528803-3-clg@kaod.org> Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw')
-rw-r--r--hw/ppc/pnv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 03c86508d2..71e45515f1 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -723,6 +723,8 @@ static uint64_t pnv_chip_get_ram_size(PnvMachineState *pnv, int chip_id)
return QEMU_ALIGN_DOWN(ram_per_chip, 1 * MiB);
}
+ assert(pnv->num_chips > 1);
+
ram_per_chip = (machine->ram_size - 1 * GiB) / (pnv->num_chips - 1);
return chip_id == 0 ? 1 * GiB : QEMU_ALIGN_DOWN(ram_per_chip, 1 * MiB);
}