Re: [edk2] correct way to reserve memory from PrePi?

2016-12-14 Thread Michael Zimmermann
>> Sent: Thursday, December 15, 2016 1:02 PM >> To: Gao, Liming <liming@intel.com> >> Cc: Ard Biesheuvel <ard.biesheu...@linaro.org>; edk2-devel@lists.01.org >> <edk2-de...@ml01.01.org>; Zeng, Star <star.z...@intel.com>; Tian, Feng >> &

Re: [edk2] correct way to reserve memory from PrePi?

2016-12-14 Thread Gao, Liming
ar <star.z...@intel.com>; Tian, Feng > <feng.t...@intel.com> > Subject: Re: [edk2] correct way to reserve memory from PrePi? > > I do not want to allocate the full memory range, just small parts of > it. I have one or two ranges(depending on how the system config > reports

Re: [edk2] correct way to reserve memory from PrePi?

2016-12-14 Thread Gao, Liming
age- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of > Michael Zimmermann > Sent: Thursday, December 15, 2016 1:57 AM > To: Ard Biesheuvel <ard.biesheu...@linaro.org> > Cc: edk2-devel@lists.01.org <edk2-de...@ml01.01.org> > Subject: Re: [ed

Re: [edk2] correct way to reserve memory from PrePi?

2016-12-14 Thread Michael Zimmermann
I've enabled GCD debugging and apparently it doesn't accept the allocation: GCD:AllocateMemorySpace(Base=9000,Length=1000) GcdAllocateType = AtAddress GcdMemoryType = SystemMem Alignment = 0001 ImageHandle = FDE28F90 DeviceHandle= 0

Re: [edk2] correct way to reserve memory from PrePi?

2016-12-14 Thread Michael Zimmermann
As far as I know the proper way is to create resource descriptors using BuildResourceDescriptorHob and then allocate reserved areas using BuildMemoryAllocationHob. This way I don't have any overlapping descriptors - I just allocated some memory very early. I ran many tests and it looks like all

Re: [edk2] correct way to reserve memory from PrePi?

2016-12-14 Thread Ard Biesheuvel
On 14 December 2016 at 10:02, Michael Zimmermann wrote: > I tried both BuildResourceDescriptorHob and BuildMemoryAllocationHob > but apparently they don't have any effect. > When I look at the output of the shell's memmap command there aren't > any reserved/unavailable

[edk2] correct way to reserve memory from PrePi?

2016-12-14 Thread Michael Zimmermann
I tried both BuildResourceDescriptorHob and BuildMemoryAllocationHob but apparently they don't have any effect. When I look at the output of the shell's memmap command there aren't any reserved/unavailable pages. Furthermore, when using AllocatePages with one of the physical addresses which I've