[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 18/79] arm/kzm: drop RAM size fixup
From: |
Igor Mammedov |
Subject: |
[PATCH v6 18/79] arm/kzm: drop RAM size fixup |
Date: |
Wed, 19 Feb 2020 11:08:52 -0500 |
If the user provided too large a RAM size, the code used to
complain and trim it to the max size. Now that RAM is allocated by
generic code, that's no longer possible, so generate an error and
exit instead.
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Peter Chubb <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
---
v3:
* rephrase commit message in nicer way
("Chubb, Peter (Data61, Kensington NSW)" <address@hidden>)
* reword error message and use size_to_str() to pretty print suggested size
("Chubb, Peter (Data61, Kensington NSW)" <address@hidden>)
---
hw/arm/kzm.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c
index 1d5ef289d5..94cbac11de 100644
--- a/hw/arm/kzm.c
+++ b/hw/arm/kzm.c
@@ -25,6 +25,7 @@
#include "hw/char/serial.h"
#include "sysemu/qtest.h"
#include "sysemu/sysemu.h"
+#include "qemu/cutils.h"
/* Memory map for Kzm Emulation Baseboard:
* 0x00000000-0x7fffffff See i.MX31 SOC for support
@@ -78,10 +79,10 @@ static void kzm_init(MachineState *machine)
/* Check the amount of memory is compatible with the SOC */
if (machine->ram_size > (FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE)) {
- warn_report("RAM size " RAM_ADDR_FMT " above max supported, "
- "reduced to %x", machine->ram_size,
- FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE);
- machine->ram_size = FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE;
+ char *sz = size_to_str(FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE);
+ error_report("RAM size more than %s is not supported", sz);
+ g_free(sz);
+ exit(EXIT_FAILURE);
}
memory_region_allocate_system_memory(&s->ram, NULL, "kzm.ram",
--
2.18.1
- [PATCH v6 04/79] machine: introduce convenience MachineState::ram, (continued)
- [PATCH v6 04/79] machine: introduce convenience MachineState::ram, Igor Mammedov, 2020/02/19
- [PATCH v6 10/79] arm/aspeed: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 07/79] vl.c: ensure that ram_size matches size of machine.memory-backend, Igor Mammedov, 2020/02/19
- [PATCH v6 09/79] arm/aspeed: actually check RAM size, Igor Mammedov, 2020/02/19
- [PATCH v6 12/79] arm/cubieboard: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 13/79] arm/digic_boards: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 14/79] arm/highbank: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 16/79] arm/imx25_pdk: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 19/79] arm/kzm: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 17/79] arm/integratorcp: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 18/79] arm/kzm: drop RAM size fixup,
Igor Mammedov <=
- [PATCH v6 15/79] arm/imx25_pdk: drop RAM size fixup, Igor Mammedov, 2020/02/19
- [PATCH v6 21/79] arm/mcimx7d-sabre: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 22/79] arm/mps2-tz: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 20/79] arm/mcimx6ul-evk: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 24/79] arm/musicpal: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 23/79] arm/mps2: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 25/79] arm/nseries: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 26/79] arm/omap_sx1: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 28/79] arm/sabrelite: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 29/79] arm/raspi: use memdev for RAM, Igor Mammedov, 2020/02/19