grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH V2] i386: Using 64-bit boot protocol for 64-bit linux kernel


From: Wei Zhang
Subject: Re: [PATCH V2] i386: Using 64-bit boot protocol for 64-bit linux kernel
Date: Fri, 12 Aug 2022 13:39:42 +0800

On Fri, Aug 12, 2022 at 1:18 AM Daniel Kiper <dkiper@net-space.pl> wrote:
>
> On Thu, Aug 04, 2022 at 11:07:30PM +0800, Wei Zhang wrote:
> > On Wed, Aug 3, 2022 at 11:33 PM Daniel Kiper <dkiper@net-space.pl> wrote:
> > >
> > > On Sat, Jul 23, 2022 at 07:20:43PM +0800, Wei Zhang wrote:
> > > > From: Wei Zhang <zhangweilst@gmail.com>
> > > >
> > > > Currently GRUB boots linux with 32-bit protocol for 64 bit kernel.
> > > > Thus if both GRUB and linux kernel are in 64-bit, we'll have to go
> > > > through 64-bit grub -> 32-bit boot protocol -> 64-bit kernel
> > > > transitions, and extra instructions have to be executed in the kernel.
> > > >
> > > > Since linux has long ago supported 64-bit boot protocol, we can take
> > > > advantage of that to directly boot to 64-bit kernel.
> > > >
> > > > To do this, first we determine whether the kernel is 64-bit by
> > > > xloadflags (since linux boot protocol 2.12), then we build the
> > > > identity-mapped page table required by the 64-bit kernel, and that's
> > > > it. The memory needed by the page table is allocated after the
> > > > protected kernel image proper.
> > > >
> > > > So if we're in 32-bit GRUB to boot a 64-bit kernel, the transition
> > > > will happen before handing over to the kernel, and if we're in 64-bit
> > > > GRUB, we don't have to go down to 32-bit and back to 64-bit. The
> > > > 32-bit kernel boot process will not be affected.
> > > >
> > > > Tested on my 64-bit machine and QEMU.
> > >
> > > Could you tell us what target and platform you configure for the GRUB?
> > > Or send us full GRUB configure command you use?
> >
> > Sure, I mainly focused on x86, and my configure command is:
> > ./configure --target=x86_64 --with-platform=efi
>
> This is what I expected. I appreciate your work. Sadly this is not
> a direction which we are heading. So, I have to NAK your patch.

That's OK. This is just a random thought I had when I was going
through the kernel boot code, and I'm happy that you took a look.

> However,
> if you want to improve the EFI boot protocol in the GRUB please take
> a look at [1] and my comments starting at [2]. I would really want to
> see the patch set at [1] updated and at some point merged into the GRUB
> upstream.

I haven't looked into it, but I'll take it if it's not too far beyond my scope:)

>
> If you have any questions please drop us a line.
>
> Daniel
>
> [1] https://lists.gnu.org/archive/html/grub-devel/2021-10/msg00209.html
> [2] https://lists.gnu.org/archive/html/grub-devel/2021-11/msg00084.html

Wei Zhang



reply via email to

[Prev in Thread] Current Thread [Next in Thread]