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

2022-08-20 Thread Wei Zhang
Daniel Kiper 于2022年8月20日 周六19:01写道: > On Fri, Aug 12, 2022 at 01:39:42PM +0800, Wei Zhang wrote: > > On Fri, Aug 12, 2022 at 1:18 AM Daniel Kiper > wrote: > > > On Thu, Aug 04, 2022 at 11:07:30PM +0800, Wei Zhang wrote: > > > > On Wed, Aug 3, 2022

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

2022-08-11 Thread Wei Zhang
On Fri, Aug 12, 2022 at 1:18 AM Daniel Kiper 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 wrote: > > > > > > On Sat, Jul 23, 2022 at 07:20:43PM +0800, Wei Zhang wrote: > > > >

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

2022-08-04 Thread Wei Zhang
On Wed, Aug 3, 2022 at 11:33 PM Daniel Kiper wrote: > > On Sat, Jul 23, 2022 at 07:20:43PM +0800, Wei Zhang wrote: > > From: Wei Zhang > > > > Currently GRUB boots linux with 32-bit protocol for 64 bit kernel. > > Thus if both GRUB and linux kernel are in 64-bit, w

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

2022-07-23 Thread Wei Zhang
From: Wei Zhang 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.

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

2022-07-23 Thread Wei Zhang
32-bit kernel boot process will not be affected. Tested on my 64-bit machine and QEMU. Signed-off-by: Wei Zhang --- grub-core/loader/i386/linux.c | 91 --- include/grub/i386/linux.h | 2 +- 2 files changed, 84 insertions(+), 9 deletions(-) diff --git a/gru

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

2022-07-23 Thread Wei Zhang
32-bit kernel boot process will not be affected. Tested on my 64-bit machine and QEMU. Signed-off-by: Wei Zhang --- grub-core/loader/i386/linux.c | 91 --- include/grub/i386/linux.h | 2 +- 2 files changed, 84 insertions(+), 9 deletions(-) diff --git a/gru

Re: [RFC] 64-bit boot protocol for Linux x86

2022-05-24 Thread Wei Zhang
concern here may be that the page table will take up 6 pages, 24KB, and I allocated the space right after the protected kernel. On most systems 24KB is not an issue, but I'm not one hundred percent sure. Wei Zhang On Sun, May 22, 2022 at 11:56 AM Wei Zhang wrote: > > Hi guys, > If I u

Re: [RFC] 64-bit boot protocol for Linux x86

2022-05-21 Thread Wei Zhang
Sorry about having sent the message twice, please ignore the previous one. Wei Zhang On Sun, May 22, 2022 at 11:56 AM Wei Zhang wrote: > > Hi guys, > If I understand the Linux boot correctly, GRUB 2 will drop Linux in a 32-bit > protected mode, > using the Linux 32-bit boot pr

[RFC] 64-bit boot protocol for Linux x86

2022-05-21 Thread Wei Zhang
Hi guys, If I understand the Linux boot correctly, GRUB 2 will drop Linux in a 32-bit protected mode, using the Linux 32-bit boot protocol. Since Linux has a 64-bit boot protocol, I'm thinking that we can make use of that. On x86_64 target, if we can make use of 64-bit boot protocol, we'll drop

[RFC] 64-bit boot protocol for Linux x86

2022-05-21 Thread wei zhang
in long mode directly, thus less code executed in the GRUB side, and less code in Linux side. Obviously it's cleaner to just use 32-bit protocol to boot both i386 and x86_64 kernel, but this will not add much complexity. Just new to this mailing list, am I missing anything? Wei Zhang