Philippe Mathieu-Daudé
ca05a240d4
hw/misc/aspeed_sdmc: Fix incorrect memory size
...
The SDRAM Memory Controller has a 32-bit address bus, thus
supports up to 4 GiB of DRAM. There is a signed to unsigned
conversion error with the AST2600 maximum memory size:
(uint64_t)(2048 << 20) = (uint64_t)(-2147483648)
= 0xffffffff40000000
= 16 EiB - 2 GiB
Fix by using the IEC suffixes which are usually safer, and add
an assertion check to verify the memory is valid. This would have
caught this bug:
$ qemu-system-arm -M ast2600-evb
qemu-system-arm: hw/misc/aspeed_sdmc.c:258: aspeed_sdmc_realize: Assertion `asc->max_ram_size < 4 * GiB' failed.
Aborted (core dumped)
Fixes: 1550d72679 ("aspeed/sdmc: Add AST2600 support")
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-07-27 16:12:10 +01:00
..
2020-07-10 15:18:08 +02:00
2020-01-24 20:59:15 +01:00
2020-03-12 16:27:33 +00:00
2020-03-12 16:27:33 +00:00
2020-03-30 13:18:58 +01:00
2020-03-12 16:27:33 +00:00
2020-03-12 16:27:33 +00:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2019-08-16 13:31:52 +02:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2019-08-16 13:31:53 +02:00
2020-05-11 11:00:26 +01:00
2020-07-27 16:12:10 +01:00
2019-08-16 13:31:52 +02:00
2020-06-15 22:05:28 +02:00
2020-07-11 11:02:05 +02:00
2020-07-10 15:18:08 +02:00
2020-06-05 17:23:09 +01:00
2020-07-10 15:18:08 +02:00
2019-08-16 13:31:52 +02:00
2019-10-25 13:09:27 +01:00
2019-08-16 13:37:36 +02:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2020-05-15 07:07:58 +02:00
2020-06-15 22:05:28 +02:00
2019-08-16 13:31:52 +02:00
2019-08-16 13:37:36 +02:00
2019-08-16 13:31:52 +02:00
2020-06-09 09:21:10 +02:00
2019-08-16 13:31:52 +02:00
2019-08-21 13:24:01 +02:00
2020-06-16 10:32:28 +01:00
2019-08-16 13:31:52 +02:00
2019-08-16 13:31:53 +02:00
2019-08-16 13:37:36 +02:00
2019-08-16 13:31:52 +02:00
2019-08-16 13:31:52 +02:00
2019-06-12 13:18:33 +02:00
2020-01-17 14:27:16 +00:00
2020-02-21 16:07:00 +00:00
2020-07-10 15:18:08 +02:00
2020-01-24 20:59:15 +01:00
2020-07-21 16:23:43 +02:00
2020-07-11 11:02:05 +02:00
2020-06-26 10:13:52 +01:00
2020-07-11 11:02:05 +02:00
2020-07-03 16:59:45 +01:00
2019-08-16 13:31:52 +02:00
2019-08-16 13:31:52 +02:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2019-08-16 13:31:52 +02:00
2020-01-24 20:59:15 +01:00
2019-08-16 13:31:52 +02:00
2019-08-16 13:31:52 +02:00
2020-03-16 22:07:42 +01:00
2019-08-16 13:31:52 +02:00
2018-01-22 09:46:18 +01:00
2020-02-20 14:47:08 +01:00
2020-07-10 15:18:08 +02:00
2020-01-24 20:59:15 +01:00
2020-06-09 19:01:56 +02:00
2020-01-24 20:59:15 +01:00
2019-08-16 13:31:53 +02:00
2019-08-16 13:37:36 +02:00
2019-06-12 13:18:33 +02:00
2020-01-17 14:09:29 +00:00
2020-01-23 15:34:04 +00:00
2020-07-10 15:18:08 +02:00
2013-04-08 18:13:16 +02:00
2020-07-10 15:18:08 +02:00
2020-07-11 11:02:05 +02:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2019-10-15 18:18:08 -03:00
2020-04-30 15:35:41 +01:00
2019-08-16 13:31:53 +02:00