mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-01-03 13:10:32 -07: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
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue