hw/arm/boot: Don't assume RAM starts at address zero
commite70af24b42190481e19c9adb727b97a0fc794ea8
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 16 May 2019 14:47:30 +0000 (16 15:47 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 17 Jun 2019 14:11:18 +0000 (17 15:11 +0100)
treef35ba34febd81b3172bf6e54f7c28e4207c90fab
parent5d0e5694470d2952b4f257bc985cac8c89b4fd92
hw/arm/boot: Don't assume RAM starts at address zero

In the Arm kernel/initrd loading code, in some places we make the
incorrect assumption that info->ram_size can be treated as the
address of the end of RAM, as for instance when we calculate the
available space for the initrd using "info->ram_size - info->initrd_start".
This is wrong, because many Arm boards (including "virt") specify
a non-zero info->loader_start to indicate that their RAM area
starts at a non-zero physical address.

Correct the places which make this incorrect assumption.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Message-id: 20190516144733.32399-2-peter.maydell@linaro.org
hw/arm/boot.c