From: Colin Watson <cjwatson@ubuntu.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: tbberry@us.ibm.com
Subject: Re: [PATCH] Adding Bi-Endian 32-bit and 64-bit Support to the Grub ELF Parser
Date: Mon, 13 Jan 2014 12:52:07 +0000 [thread overview]
Message-ID: <20140113125207.GA9599@riva.ucam.org> (raw)
In-Reply-To: <20140110235252.2e009052@opensuse.site>
On Fri, Jan 10, 2014 at 11:52:52PM +0400, Andrey Borzenkov wrote:
> В Fri, 10 Jan 2014 11:58:58 -0600
> Tomohiro B Berry <tbberry@us.ibm.com> пишет:
> > This patch adds bi-endian support for both 32-bit and 64-bit elf files.
> >
> > It compares the native endianness to the endianness of the elf file, and
> > swaps the header bytes if necessary. This will allow, for example, 32-bit
> > Big Endian grub to load a 64-bit Little Endian kernel.
>
> I wonder - when big endian grub will pass boot parameters to little
> endian kernel - won't there be endianness mismatch?
I think this is probably not a problem for the case at hand (powerpc),
because command-line arguments are passed by way of an IEEE1275 property
rather than using a pointer in a structure as we do on x86. And the
kernel expects to enter the PROM in 32-bit BE mode, so passing its
address that way round should be fine.
However, Tomohiro, I wonder if you have tested this with an initrd? I
don't see code in the kernel to cope with a byteswapped initrd address
and size (though I certainly could be missing something).
If that side of things is confirmed to work, then this looks mostly fine
to me.
I wonder if perhaps we ought to only do this on architectures where we
know that the kernel can cope with being entered in the wrong
endianness? I don't know - maybe we don't need to worry as on other
architectures the chances of running across a wrong-endian kernel are
pretty infinitesimal anyway.
--
Colin Watson [cjwatson@ubuntu.com]
next prev parent reply other threads:[~2014-01-13 12:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-10 17:58 [PATCH] Adding Bi-Endian 32-bit and 64-bit Support to the Grub ELF Parser Tomohiro B Berry
2014-01-10 19:52 ` Andrey Borzenkov
2014-01-13 12:52 ` Colin Watson [this message]
2014-01-13 21:29 ` Tomohiro B Berry
2014-01-14 5:36 ` Andrey Borzenkov
2014-01-15 19:49 ` Tomohiro B Berry
2014-02-18 21:37 ` Tomohiro B Berry
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=20140113125207.GA9599@riva.ucam.org \
--to=cjwatson@ubuntu.com \
--cc=grub-devel@gnu.org \
--cc=tbberry@us.ibm.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.