On Fri, Jul 6, 2012 at 3:00 AM, Peter Maydell <peter.mayd...@linaro.org> wrote:
> The legacy ATAGS format for passing information to the kernel only
> allows RAM sizes which fit in 32 bits; enforce this restriction
> rather than silently doing something weird.
>
> Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
> ---
>  hw/arm_boot.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/hw/arm_boot.c b/hw/arm_boot.c
> index 29ae324..7366427 100644
> --- a/hw/arm_boot.c
> +++ b/hw/arm_boot.c
> @@ -399,6 +399,11 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info 
> *info)
>              bootloader[5] = dtb_start;
>          } else {
>              bootloader[5] = info->loader_start + KERNEL_ARGS_ADDR;
> +            if (info->ram_size >= (1ULL << 32)) {
> +                fprintf(stderr, "qemu: RAM size must be less than 4GB to 
> boot"
> +                        " Linux kernel without device tree\n");

Error message is a bit weird. Shouldnt it be "RAM size must be less
than 4GB to boot Linux kernel with ATAG command line". DTB shouldnt be
the only way to boot with >4GB.

Regards,
Peter

> +                exit(1);
> +            }
>          }
>          bootloader[6] = entry;
>          for (n = 0; n < sizeof(bootloader) / 4; n++) {
> --
> 1.7.1
>

Reply via email to