[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: |
Thu, 4 Aug 2022 23:07:30 +0800 |
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
I didn't examine other targets, e.g. arm64 and sparc64 etc. But if
there are similar issues on those targets too, I'll definitely like to
work on those too:)
Thanks for your reply.
Wei Zhang