Re: [edk2] Hello Andrew query on BdsSetMemoryTypeInformationVariable

2019-02-08 Thread Kinney, Michael D
You can avoid the reboot on the first boot if the HOB
is initialized with sizes that match the usage on that
specific platform.

If you look at the boot logs, you will see messages that
show the memory type information table.  You can use that
information after a couple of boots to see the memory usage
and adjust the values used to produce the HOB in PEI.

Then rebuild with those new values and the extra reset on
first boot should go away.

The only time a reboot is required is if the memory usage
changes significantly.

Mike

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-
> boun...@lists.01.org] On Behalf Of Andrew Fish via
> edk2-devel
> Sent: Friday, February 8, 2019 9:36 AM
> To: galla rao ; edk2-
> de...@lists.01.org
> Subject: Re: [edk2] Hello Andrew query on
> BdsSetMemoryTypeInformationVariable
> 
> Forwarding to the edk2 list 
> 
> > On Feb 8, 2019, at 8:28 AM, galla rao
>  wrote:
> >
> > Hi Andrew,
> >
> > Am sorry for direct message!
> >
> > There is a function
> BdsSetMemoryTypeInformationVariable which causes a
> reset
> > when i enabled Secureboot related drivers
> >
> > Any clue why this function is added in EDK2?
> >
> 
> Yea it writes a variable that records how many pages of
> each memory type are used. This variable is read in PEI
> and used to pass a HOB into the DXE Core. The DXE Core
> uses these memory buckets to preallocate ranges for
> each memory type. This scheme prevents memory
> fragmentation and makes sure the runtime memory regions
> are in the same location when the system does an S4
> resume from disk.
> 
> 
> > is this a serious error, making the
> PcdResetOnMemoryTypeInformationChange to FALSE will
> resolve and boots to OS
> >
> 
> I think the idea behind that reboot, is the memory map
> could be different on the next boot and if that was an
> S4 the S4 could fail.
> 
> Thanks,
> 
> Andrew Fish
> 
> 
> > shed some knowledge if you are aware of this feature
> >
> > Thanks & Regards
> > Galla
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Hello Andrew query on BdsSetMemoryTypeInformationVariable

2019-02-08 Thread Andrew Fish via edk2-devel
Forwarding to the edk2 list 

> On Feb 8, 2019, at 8:28 AM, galla rao  wrote:
> 
> Hi Andrew,
> 
> Am sorry for direct message!
>  
> There is a function BdsSetMemoryTypeInformationVariable which causes a reset 
> when i enabled Secureboot related drivers
> 
> Any clue why this function is added in EDK2?
> 

Yea it writes a variable that records how many pages of each memory type are 
used. This variable is read in PEI and used to pass a HOB into the DXE Core. 
The DXE Core uses these memory buckets to preallocate ranges for each memory 
type. This scheme prevents memory fragmentation and makes sure the runtime 
memory regions are in the same location when the system does an S4 resume from 
disk. 


> is this a serious error, making the PcdResetOnMemoryTypeInformationChange to 
> FALSE will resolve and boots to OS
> 

I think the idea behind that reboot, is the memory map could be different on 
the next boot and if that was an S4 the S4 could fail. 

Thanks,

Andrew Fish


> shed some knowledge if you are aware of this feature
> 
> Thanks & Regards
> Galla

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel