All of lore.kernel.org
 help / color / mirror / Atom feed
From: Goswin von Brederlow <goswin-v-b@web.de>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org, Goswin von Brederlow <goswin-v-b@web.de>
Subject: Re: [Qemu-devel] Support for multiboot images in elf64 (EM_X86_64) format
Date: Wed, 08 Feb 2012 10:53:12 +0100	[thread overview]
Message-ID: <87y5sdejnb.fsf@frosties.localnet> (raw)
In-Reply-To: <CAJSP0QUwVhAoV7RE_tUONB7ZwY2Bk-s+D=obAr_ed2JrZOvpfw@mail.gmail.com> (Stefan Hajnoczi's message of "Mon, 6 Feb 2012 12:38:14 +0000")

Stefan Hajnoczi <stefanha@gmail.com> writes:

> On Sat, Feb 4, 2012 at 5:38 PM, Goswin von Brederlow <goswin-v-b@web.de> wrote:
>> Description: Allow 64bit elf binaries in multiboot format
>>  This patch allows 64bit elf files with multiboot header to be loaded.
>>  The entry point will still be called in 32bit mode and the kernel
>>  must switch to 64bit mode on its own. The image and all modules must
>>  also be located in the lower 2GB of ram. All the restrictions of a
>>  32bit image still apply.
>> Author: Goswin von Brederlow <goswin-v-b@web.de>
>> Last-Updated: 2011-04-08
>> ---
>
> The multiboot specification is 32-bit only.  This patch enables a
> non-standard 64-bit version of multiboot.  Have you checked whether
> GRUB or other multiboot loaders have equivalent functionality?  Have
> you contacted the multiboot specification authors?

Not really. The multiboot specification allow for different executable
formats as long as the multiboot header is correct. For example you can
have an a.out multiboot image. The entry vector specified in the
multiboot header is still called in 32bit mode, as per specs. All that
changes is that the kvm allows another executable format for loading the
image.

Actually per mutliboot specs the elf64 image should already be loaded as
plain image (which means not neccessarily reloacted to the right
address) just like a.out would but kvm doesn't support that.

I don't think other loaders support elf64 (yet) unless they support
plain images. Frankly I never tried booting a toy kernel on real
hardware so there never was the need.

>> --- qemu-kvm-0.14.0+dfsg.orig/hw/multiboot.c
>> +++ qemu-kvm-0.14.0+dfsg/hw/multiboot.c
>> @@ -173,8 +173,7 @@ int load_multiboot(void *fw_cfg,
>>         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);
>> +           mb_debug("qemu: 64bit elf, I hope you know what you are doing\n");
>
> This is silent by default, but given the nature of 64-bit multiboot
> support I think this warning should be on by default.  Anyone using
> this really needs to know what they are doing and QEMU should not
> silently do weird things.
>
> Stefan

Fine by me to make this more verbose. I only care about removing the
exit(1).

MfG
        Goswin

  reply	other threads:[~2012-02-08  9:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-04 17:38 [Qemu-devel] Support for multiboot images in elf64 (EM_X86_64) format Goswin von Brederlow
2012-02-06 12:38 ` Stefan Hajnoczi
2012-02-08  9:53   ` Goswin von Brederlow [this message]
2012-02-08 11:30     ` Kevin Wolf
2012-02-08 12:06     ` Stefan Hajnoczi
2012-02-09  0:35       ` Paul Brook
2012-02-09 13:07         ` Goswin von Brederlow
2012-02-09 13:36           ` Paul Brook
2012-02-09 15:38             ` Goswin von Brederlow
2012-02-09 16:01               ` Paul Brook

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=87y5sdejnb.fsf@frosties.localnet \
    --to=goswin-v-b@web.de \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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.