Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-22 Thread Baoquan He
On 02/21/15 at 10:49am, Baoquan He wrote: > On 02/20/15 at 03:53pm, Yinghai Lu wrote: > > Then you are not setting the ident mapping correctly. > > > > you should make sure add extra ident mapping for the new [output, > > output+output_len - 1]. > > bootloader only cover old [output, output+outpu

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-21 Thread Yinghai Lu
On Fri, Feb 20, 2015 at 6:49 PM, Baoquan He wrote: > On 02/20/15 at 03:53pm, Yinghai Lu wrote: > At the beginning I did it just as you said, add IDT table and $PF > handler. Get page fault address and built ident mapping around it when > reload kernel above 4G. In this case 3 more pages are enough

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-20 Thread Baoquan He
On 02/20/15 at 03:53pm, Yinghai Lu wrote: > On Fri, Feb 20, 2015 at 1:28 AM, Baoquan He wrote: > > > > Actually kexec is a bootloader which can put kernel at any address. This > > is done in user space program kexec-tools. However kexec-tools make > > kernel jump from 64bit into 64bit directly, an

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-20 Thread Yinghai Lu
On Fri, Feb 20, 2015 at 1:28 AM, Baoquan He wrote: > > Actually kexec is a bootloader which can put kernel at any address. This > is done in user space program kexec-tools. However kexec-tools make > kernel jump from 64bit into 64bit directly, and has built ident mapping > of whole physical memory

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-20 Thread Baoquan He
On 02/19/15 at 07:35pm, Yinghai Lu wrote: > On Thu, Feb 19, 2015 at 6:13 PM, Baoquan He wrote: > > On 02/18/15 at 11:47am, Yinghai Lu wrote: > > > > Kaslr need both virtual and physical address be randomized, otherwise > > it doesn't make sense. Please check what hpa said about this issue: > > > >

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-19 Thread Yinghai Lu
On Thu, Feb 19, 2015 at 6:13 PM, Baoquan He wrote: > On 02/18/15 at 11:47am, Yinghai Lu wrote: > > Kaslr need both virtual and physical address be randomized, otherwise > it doesn't make sense. Please check what hpa said about this issue: > > https://lkml.org/lkml/2014/10/13/350 > If I read corre

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-19 Thread Baoquan He
On 02/18/15 at 11:47am, Yinghai Lu wrote: > On Wed, Feb 18, 2015 at 3:29 AM, Baoquan He wrote: > > On 02/17/15 at 11:22pm, Yinghai Lu wrote: > >> On Tue, Feb 10, 2015 at 10:11 PM, Baoquan He wrote: > > I am sorry I didn't get what you mean. I have tried to set another ident > > mapping for new ra

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-18 Thread Yinghai Lu
On Wed, Feb 18, 2015 at 3:29 AM, Baoquan He wrote: > On 02/17/15 at 11:22pm, Yinghai Lu wrote: >> On Tue, Feb 10, 2015 at 10:11 PM, Baoquan He wrote: > I am sorry I didn't get what you mean. I have tried to set another ident > mapping for new range and it is successful seeing from debug message >

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-18 Thread Baoquan He
On 02/17/15 at 11:22pm, Yinghai Lu wrote: > On Tue, Feb 10, 2015 at 10:11 PM, Baoquan He wrote: > > Hi Yinghai, > > > > Could you please help to have a look at a problem which I encountered? > > > > I am trying to make kaslr randomize on both kernel physical and virtual > > address separately. Now

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-17 Thread Yinghai Lu
On Wed, Feb 4, 2015 at 10:09 PM, Dave Young wrote: > On 02/04/15 at 09:25pm, Yinghai Lu wrote: >> On Wed, Feb 4, 2015 at 7:25 PM, Dave Young wrote: >> >> After this patch, could use patched grub2-x86_64.efi to place >> >> kernel/boot_params/cmd_line/initrd all above 4G and execute the kernel >> >

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-17 Thread Yinghai Lu
On Tue, Feb 10, 2015 at 10:11 PM, Baoquan He wrote: > Hi Yinghai, > > Could you please help to have a look at a problem which I encountered? > > I am trying to make kaslr randomize on both kernel physical and virtual > address separately. Now the separate randomization has been done, > kernel phys

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-12 Thread Matt Fleming
On Wed, 11 Feb, at 11:29:58AM, Peter Jones wrote: > > From grub's point of view I'm not sure why we'd care - the pages kernel > and initramfs land in are both from the Boot Services allocator, so if the > machine doesn't support high addresses, they won't be there. It's not that some implementati

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-11 Thread Peter Jones
On Wed, Feb 11, 2015 at 03:55:24PM +, Matt Fleming wrote: > On Mon, 09 Feb, at 12:23:15PM, Yinghai Lu wrote: > > On Mon, Feb 9, 2015 at 10:27 AM, Matt Fleming > > wrote: > > > On Tue, 03 Feb, at 06:03:20PM, Yinghai Lu wrote: > > > > > > The first thing that comes to mind is the issues we expe

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-11 Thread Matt Fleming
On Mon, 09 Feb, at 12:23:15PM, Yinghai Lu wrote: > On Mon, Feb 9, 2015 at 10:27 AM, Matt Fleming > wrote: > > On Tue, 03 Feb, at 06:03:20PM, Yinghai Lu wrote: > > > > The first thing that comes to mind is the issues we experienced last > > year when adding support for loading initrds above 4GB to

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-10 Thread Baoquan He
Hi Yinghai, Could you please help to have a look at a problem which I encountered? I am trying to make kaslr randomize on both kernel physical and virtual address separately. Now the separate randomization has been done, kernel physical address can be randomized to [16M, 4G], and virtual address

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-09 Thread Yinghai Lu
On Mon, Feb 9, 2015 at 10:27 AM, Matt Fleming wrote: > On Tue, 03 Feb, at 06:03:20PM, Yinghai Lu wrote: > > The first thing that comes to mind is the issues we experienced last > year when adding support for loading initrds above 4GB to the EFI boot > stub, c.f. commit 47226ad4f4cf ("x86/efi: Only

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-09 Thread Matt Fleming
On Tue, 03 Feb, at 06:03:20PM, Yinghai Lu wrote: > Now could use kexec to place kernel/boot_params/cmd_line/initrd > above 4G, but that is with legacy interface with startup_64 directly. > > This patch will allow 64bit EFI kernel to be loaded above 4G > and use EFI HANDOVER PROTOCOL to start the k

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-04 Thread Dave Young
On 02/04/15 at 09:25pm, Yinghai Lu wrote: > On Wed, Feb 4, 2015 at 7:25 PM, Dave Young wrote: > >> After this patch, could use patched grub2-x86_64.efi to place > >> kernel/boot_params/cmd_line/initrd all above 4G and execute the kernel > >> above 4G. > > > > Can you share the grub2 patch for test

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-04 Thread Yinghai Lu
On Wed, Feb 4, 2015 at 7:25 PM, Dave Young wrote: >> After this patch, could use patched grub2-x86_64.efi to place >> kernel/boot_params/cmd_line/initrd all above 4G and execute the kernel >> above 4G. > > Can you share the grub2 patch for testing? Please check attached 5 patches. last one is for

Re: [PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-04 Thread Dave Young
Hi, Thanks, it will be useful for possible efi rebooting to kdump reserved memory. On 02/03/15 at 06:03pm, Yinghai Lu wrote: > Now could use kexec to place kernel/boot_params/cmd_line/initrd > above 4G, but that is with legacy interface with startup_64 directly. > > This patch will allow 64bit E

[PATCH] x86, boot: Allow 64bit EFI kernel to be loaded above 4G

2015-02-03 Thread Yinghai Lu
Now could use kexec to place kernel/boot_params/cmd_line/initrd above 4G, but that is with legacy interface with startup_64 directly. This patch will allow 64bit EFI kernel to be loaded above 4G and use EFI HANDOVER PROTOCOL to start the kernel. Current code32_start is used for passing around loa