[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/44] ppc/pnv: Add an assert when calculating the RAM distributio
From: |
David Gibson |
Subject: |
[PULL 12/44] ppc/pnv: Add an assert when calculating the RAM distribution on chips |
Date: |
Thu, 30 Sep 2021 15:43:54 +1000 |
From: Cédric Le Goater <clg@kaod.org>
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>
---
hw/ppc/pnv.c | 2 ++
1 file changed, 2 insertions(+)
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);
}
--
2.31.1
- [PULL 00/44] ppc-for-6.2 queue 20210930, David Gibson, 2021/09/30
- [PULL 02/44] host-utils: fix missing zero-extension in divs128, David Gibson, 2021/09/30
- [PULL 01/44] host-utils: Fix overflow detection in divu128(), David Gibson, 2021/09/30
- [PULL 07/44] ppc/pnv: Remove useless variable, David Gibson, 2021/09/30
- [PULL 04/44] i386/kvm: Replace abs64() with uabs64() from host-utils, David Gibson, 2021/09/30
- [PULL 05/44] ppc/spapr: Add a POWER10 DD2 CPU, David Gibson, 2021/09/30
- [PULL 06/44] ppc/pnv: Add a comment on the "primary-topology-index" property, David Gibson, 2021/09/30
- [PULL 10/44] ppc/pnv: Rename "id" to "quad-id" in PnvQuad, David Gibson, 2021/09/30
- [PULL 12/44] ppc/pnv: Add an assert when calculating the RAM distribution on chips,
David Gibson <=
- [PULL 15/44] spapr.c: handle dev->id in spapr_memory_unplug_rollback(), David Gibson, 2021/09/30
- [PULL 11/44] docs/system: ppc: Update the URL for OpenPOWER firmware images, David Gibson, 2021/09/30
- [PULL 13/44] target/ppc: fix setting of CR flags in bcdcfsq, David Gibson, 2021/09/30
- [PULL 03/44] host-utils: introduce uabs64(), David Gibson, 2021/09/30
- [PULL 14/44] memory_hotplug.c: handle dev->id = NULL in acpi_memory_hotplug_write(), David Gibson, 2021/09/30
- [PULL 16/44] spapr_drc.c: do not error_report() when drc->dev->id == NULL, David Gibson, 2021/09/30
- [PULL 09/44] ppc/xive: Export xive_tctx_word2() helper, David Gibson, 2021/09/30
- [PULL 19/44] spapr: use DEVICE_UNPLUG_GUEST_ERROR to report unplug errors, David Gibson, 2021/09/30
- [PULL 18/44] qapi/qdev.json: add DEVICE_UNPLUG_GUEST_ERROR QAPI event, David Gibson, 2021/09/30
- [PULL 20/44] memory_hotplug.c: send DEVICE_UNPLUG_GUEST_ERROR in acpi_memory_hotplug_write(), David Gibson, 2021/09/30