From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Peter Crosthwaite <peter.crosthwaite@petalogix.com>, patches@linaro.org
Subject: [Qemu-devel] [PATCH v2 3/6] hw/arm_boot.c: Check for RAM sizes exceeding ATAGS capacity
Date: Mon, 16 Jul 2012 14:24:13 +0100 [thread overview]
Message-ID: <1342445056-9129-4-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1342445056-9129-1-git-send-email-peter.maydell@linaro.org>
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.maydell@linaro.org>
---
hw/arm_boot.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/hw/arm_boot.c b/hw/arm_boot.c
index 29ae324..af71ed6 100644
--- a/hw/arm_boot.c
+++ b/hw/arm_boot.c
@@ -399,6 +399,12 @@ 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 using ATAGS (try passing a device tree"
+ " using -dtb)\n");
+ exit(1);
+ }
}
bootloader[6] = entry;
for (n = 0; n < sizeof(bootloader) / 4; n++) {
--
1.7.5.4
next prev parent reply other threads:[~2012-07-16 13:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-16 13:24 [Qemu-devel] [PATCH v2 0/6] arm_boot/vexpress-a15: Support >4GB of RAM Peter Maydell
2012-07-16 13:24 ` [Qemu-devel] [PATCH v2 1/6] hw/arm_boot.c: Make ram_size a uint64_t Peter Maydell
2012-07-18 12:25 ` Peter Crosthwaite
2012-07-16 13:24 ` [Qemu-devel] [PATCH v2 2/6] hw/arm_boot.c: Consistently use ram_size from arm_boot_info struct Peter Maydell
2012-07-16 13:24 ` Peter Maydell [this message]
2012-07-18 12:28 ` [Qemu-devel] [PATCH v2 3/6] hw/arm_boot.c: Check for RAM sizes exceeding ATAGS capacity Peter Crosthwaite
2012-07-16 13:24 ` [Qemu-devel] [PATCH v2 4/6] device_tree: Add support for reading device tree properties Peter Maydell
2012-07-18 12:30 ` Peter Crosthwaite
2012-07-16 13:24 ` [Qemu-devel] [PATCH v2 5/6] hw/arm_boot.c: Support DTBs which use 64 bit addresses Peter Maydell
2012-07-16 13:24 ` [Qemu-devel] [PATCH v2 6/6] hw/vexpress.c: Allow >4GB of RAM for Cortex-A15 daughterboard Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1342445056-9129-4-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=patches@linaro.org \
--cc=peter.crosthwaite@petalogix.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).