public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
To: kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org
Cc: hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org,
	ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
Subject: [PATCH] qemu: ppc: if not a uImage, try to load kernel as ELF
Date: Tue, 28 Oct 2008 10:08:23 +0100	[thread overview]
Message-ID: <1225184903-25791-1-git-send-email-ehrhardt@linux.vnet.ibm.com> (raw)

From: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

This allows qemu to load "bare metal" ELF kernels, useful for standalone
benchmarks and testcases.

We could/should also load the specified file as a flat binary, if both uImage
and ELF loaders fail. (See hw/arm_boot.c.)

Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---

[diffstat]
 ppc440_bamboo.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

[diff]
diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c
--- a/qemu/hw/ppc440_bamboo.c
+++ b/qemu/hw/ppc440_bamboo.c
@@ -35,8 +35,8 @@ void bamboo_init(ram_addr_t ram_size, in
 	qemu_irq *pic;
 	ppc4xx_pci_t *pci;
 	CPUState *env;
-	target_ulong ep=0;
-	target_ulong la=0;
+	uint64_t ep=0;
+	uint64_t la=0;
 	int is_linux=1; /* Will assume allways is Linux for now */
 	target_long kernel_size=0;
 	target_ulong initrd_base=0;
@@ -98,6 +98,9 @@ void bamboo_init(ram_addr_t ram_size, in
 	/* load kernel with uboot loader */
 	printf("%s: load kernel\n", __func__);
 	ret = load_uimage(kernel_filename, &ep, &la, &kernel_size, &is_linux);
+	if (ret < 0)
+		ret = load_elf(kernel_filename, 0, &ep, &la, NULL);
+
 	if (ret < 0) {
 		fprintf(stderr, "qemu: could not load kernel '%s'\n",
 			kernel_filename);

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

                 reply	other threads:[~2008-10-28  9:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1225184903-25791-1-git-send-email-ehrhardt@linux.vnet.ibm.com \
    --to=ehrhardt-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    --cc=kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.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