From: Avi Kivity <avi@redhat.com>
To: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] multiboot: Prevent loading of x86_64 images
Date: Thu, 19 Aug 2010 16:02:23 +0300 [thread overview]
Message-ID: <4C6D2B5F.40805@redhat.com> (raw)
In-Reply-To: <20100819112414.GH22245@os.inf.tu-dresden.de>
On 08/19/2010 02:24 PM, Adam Lackorzynski wrote:
> A via -kernel supplied x86_64 ELF image is being started in 32bit mode.
> Detect and exit if a 64bit image has been supplied.
>
>
>
> diff --git a/hw/multiboot.c b/hw/multiboot.c
> index dc980e6..e9dcbc9 100644
> --- a/hw/multiboot.c
> +++ b/hw/multiboot.c
> @@ -171,6 +171,12 @@ int load_multiboot(void *fw_cfg,
> uint64_t elf_low, elf_high;
> int kernel_size;
> fclose(f);
> +
> + if (((struct elf64_hdr*)header)->e_machine == EM_X86_64) {
> + fprintf(stderr, "Cannot load x86-64 image, give a 32bit one.\n");
> + exit(1);
> + }
> +
> kernel_size = load_elf(kernel_filename, NULL, NULL,&elf_entry,
> &elf_low,&elf_high, 0, ELF_MACHINE, 0);
> if (kernel_size< 0) {
We rely on the existing behaviour in kvm-unit-tests.git. Tests (.flat
files) are 64-bit elf binaries that are loaded in 32-bit more and switch
immediately to 64-bit.
We can easily wrap them in a 32-bit elf, but that's a needless complication.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2010-08-19 13:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-19 11:24 [Qemu-devel] [PATCH] multiboot: Prevent loading of x86_64 images Adam Lackorzynski
2010-08-19 11:27 ` Alexander Graf
2010-08-19 11:36 ` Adam Lackorzynski
2010-08-19 11:40 ` Alexander Graf
2010-08-19 12:32 ` Adam Lackorzynski
2010-08-19 12:34 ` Alexander Graf
2010-08-19 12:49 ` Adam Lackorzynski
2010-08-19 13:01 ` Alexander Graf
2010-08-20 18:47 ` Rene Rebe
2010-08-19 13:02 ` Avi Kivity [this message]
2010-08-19 13:57 ` Alexander Graf
2010-08-19 14:05 ` Avi Kivity
2010-08-19 14:10 ` Alexander Graf
2010-08-19 14:12 ` Avi Kivity
-- strict thread matches above, loose matches on Subject: below --
2010-09-02 20:28 Adam Lackorzynski
2010-09-25 8:51 Adam Lackorzynski
2010-11-04 22:22 Adam Lackorzynski
2010-11-16 20:09 ` Anthony Liguori
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=4C6D2B5F.40805@redhat.com \
--to=avi@redhat.com \
--cc=adam@os.inf.tu-dresden.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.