Re: [PATCH v2] arm64/efi: prefer AllocatePages() over efi_low_alloc() for vmlinux

2015-10-27 Thread Timur Tabi
On Fri, Jul 24, 2015 at 6:38 AM, Ard Biesheuvel wrote: > > + /* > +* First, try a straight allocation at the preferred offset. > +* This will work around the issue where, if dram_base == 0x0, > +* efi_low_alloc() refuses to allocate at

Re: [PATCH v2] arm64/efi: prefer AllocatePages() over efi_low_alloc() for vmlinux

2015-07-29 Thread Will Deacon
On Tue, Jul 28, 2015 at 10:24:23PM +0100, Ard Biesheuvel wrote: > On 28 July 2015 at 23:17, Matt Fleming wrote: > > On Fri, 24 Jul, at 01:38:27PM, Ard Biesheuvel wrote: > >> When allocating memory for the kernel image, try the AllocatePages() > >> boot service to obtain memory at the preferred off

Re: [PATCH v2] arm64/efi: prefer AllocatePages() over efi_low_alloc() for vmlinux

2015-07-28 Thread Matt Fleming
On Tue, 28 Jul, at 11:24:23PM, Ard Biesheuvel wrote: > > This workaround fixes another issue as well: the arm64 kernel needs to > be loaded 512 KB above a 2MB aligned boundary, and using > efi_low_alloc() as we do loses (2 MB - 512 KB) at the bottom if part > of that 512 KB is occupied, since efi_

Re: [PATCH v2] arm64/efi: prefer AllocatePages() over efi_low_alloc() for vmlinux

2015-07-28 Thread Ard Biesheuvel
On 28 July 2015 at 23:17, Matt Fleming wrote: > On Fri, 24 Jul, at 01:38:27PM, Ard Biesheuvel wrote: >> When allocating memory for the kernel image, try the AllocatePages() >> boot service to obtain memory at the preferred offset of >> 'dram_base + TEXT_OFFSET', and only revert to efi_low_alloc()

Re: [PATCH v2] arm64/efi: prefer AllocatePages() over efi_low_alloc() for vmlinux

2015-07-28 Thread Matt Fleming
On Fri, 24 Jul, at 01:38:27PM, Ard Biesheuvel wrote: > When allocating memory for the kernel image, try the AllocatePages() > boot service to obtain memory at the preferred offset of > 'dram_base + TEXT_OFFSET', and only revert to efi_low_alloc() if that > fails. This is the only way to allocate at

Re: [PATCH v2] arm64/efi: prefer AllocatePages() over efi_low_alloc() for vmlinux

2015-07-24 Thread Mark Rutland
On Fri, Jul 24, 2015 at 12:38:27PM +0100, Ard Biesheuvel wrote: > When allocating memory for the kernel image, try the AllocatePages() > boot service to obtain memory at the preferred offset of > 'dram_base + TEXT_OFFSET', and only revert to efi_low_alloc() if that > fails. This is the only way to

[PATCH v2] arm64/efi: prefer AllocatePages() over efi_low_alloc() for vmlinux

2015-07-24 Thread Ard Biesheuvel
When allocating memory for the kernel image, try the AllocatePages() boot service to obtain memory at the preferred offset of 'dram_base + TEXT_OFFSET', and only revert to efi_low_alloc() if that fails. This is the only way to allocate at the base of DRAM if DRAM starts at 0x0, since efi_low_alloc(

[PATCH v2] arm64/efi: prefer AllocatePages() over efi_low_alloc() for vmlinux

2015-07-23 Thread Ard Biesheuvel
Hello Haojian, Could you please try this version instead? -- Ard. ---8<- When allocating memory for the kernel image, try the AllocatePages() boot service to obtain memory at the preferred offset of 'dram_base + TEXT_OFFSET', and only revert to efi_low_alloc() if that fails. This i