On Sat, Jul 23, 2022 at 07:20:43PM +0800, Wei Zhang wrote: > From: Wei Zhang <zhangwei...@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? Daniel _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel