mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 03:59:52 +00:00
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>
This commit is contained in:
parent
325ba52a4e
commit
f640afec1a
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user