From: Thomas Huth <huth@tuxfamily.org>
To: Gonzo FWS <fwsgonzo@hotmail.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>,
Eduardo Habkost <ehabkost@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Subject: Re: [Qemu-devel] i386: don't require elf64 for multiboot kernel
Date: Wed, 5 Dec 2018 06:35:32 +0100 [thread overview]
Message-ID: <a3fe5633-d031-6a58-40c2-aee43b2bec45@tuxfamily.org> (raw)
In-Reply-To: <HE1P190MB00739AD5A654DAA3FE9B4662DEAF0@HE1P190MB0073.EURP190.PROD.OUTLOOK.COM>
On 2018-12-04 17:55, Gonzo FWS wrote:
> Right now IncludeOS on x86_64 must use a chainloader for multiboot support. The chainloader is an ELF32 kernel that loads the real ELF64 kernel and jumps to it. As long as the ELF has the .multiboot section and conforms to the spec, meaning _start is be a 32-bit entry, it should be fine.
>
> By removing the extra check in multiboot.c, we can also boot ELF64 files. As can be seen here:
> https://cloud.fwsnet.net/index.php/s/XrkBkC8zy7MLa9p
>
> Signed-off-by: Alf-André Walla <fwsgonzo@hotmail.com>
> ---
> hw/i386/multiboot.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
> index 1a4344f5fc..d07ebf3361 100644
> --- a/hw/i386/multiboot.c
> +++ b/hw/i386/multiboot.c
> @@ -194,11 +194,6 @@ int load_multiboot(FWCfgState *fw_cfg,
> int kernel_size;
> fclose(f);
>
> - if (((struct elf64_hdr*)header)->e_machine == EM_X86_64) {
> - error_report("Cannot load x86-64 image, give a 32bit one.");
> - exit(1);
> - }
> -
Looks like the check has once been introduced explicitly:
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=9696846600cac4bd0dfd6835
Maybe we should at least print out a warn_report() instead, so that
people who try to boot 64-bit kernel without 32-bit entry point still
get an idea why it is not working in that case?
Thomas
PS: Please make sure to CC: the i386 maintainers when sending patches
that touch files in the hw/i386/ directory, thanks!
next prev parent reply other threads:[~2018-12-05 5:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-04 16:55 [Qemu-devel] i386: don't require elf64 for multiboot kernel Gonzo FWS
2018-12-05 5:35 ` Thomas Huth [this message]
2018-12-05 12:20 ` Paolo Bonzini
2018-12-05 13:03 ` Gonzo FWS
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=a3fe5633-d031-6a58-40c2-aee43b2bec45@tuxfamily.org \
--to=huth@tuxfamily.org \
--cc=ehabkost@redhat.com \
--cc=fwsgonzo@hotmail.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).