Andrew:
  Yes. Those PCD can support Dynamic and DynamicEx. DxeIpl can use them instead 
of EFI variable. But, Platform DSC should configure those PCDs as DynamicHii. 
This is an impact for the existing platform. To minimize the impact, I suggest 
to define those PCDs with all PCD types, and keep DxeIpl, Bds without change. 
Platform can decide to configure PCD type, and configure PCD as DynamicHii with 
MemoryTypeInfo variable. If so, the platform PEI can be simplified to only 
consume PCDs to build HOB, not require to access variable again.

Thanks
Liming
From: Andrew Fish [mailto:af...@apple.com]
Sent: Thursday, May 07, 2015 12:20 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] MdeModulePkg: Should have a library to produce the 
gEfiMemoryTypeInformationGuid HOB driven by PCDs.


On May 6, 2015, at 8:30 AM, Olivier Martin 
<olivier.mar...@arm.com<mailto:olivier.mar...@arm.com>> wrote:

As I said before I would be happy to see these PCDs moved into MdeModulePkg 
(instead of being defined by EmbeddedPkg).

On 06/05/15 15:58, Gao, Liming wrote:
Olivier:
  I think it will be good to share those PCDs in the different platforms. My 
comments is to define those PCDs to support FixedAtBuild and PatchableInModule 
both. PCD Name may be changed to PcdEfiACPIReclaimMemorySizeInMemoryTypeInfo.


We might want to think about adding Dynamic? There is currently a variable set 
by BDS that is read by the DXE IPL to override the HOB. It my be possible to 
not require this variable if Dynamic PCDs are used?

https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c

    DataSize = sizeof (MemoryData);

    Status = Variable->GetVariable (

                         Variable,

                         EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,

                         &gEfiMemoryTypeInformationGuid,

                         NULL,

                         &DataSize,

                         &MemoryData

                         );

    if (!EFI_ERROR (Status) && ValidateMemoryTypeInfoVariable(MemoryData, 
DataSize)) {

      //

      // Build the GUID'd HOB for DXE

      //

      BuildGuidDataHob (

        &gEfiMemoryTypeInformationGuid,

        MemoryData,

        DataSize

        );

    }

Thanks,

Andrew Fish


Thanks
Liming
From: Olivier Martin [mailto:olivier.mar...@arm.com]
Sent: Friday, May 1, 2015 7:11 PM
To: edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
Subject: Re: [edk2] MdeModulePkg: Should have a library to produce the 
gEfiMemoryTypeInformationGuid HOB driven by PCDs.

I wrote a section in the wikipage to tune UEFI to avoid memory fragmentation 
(mainly to avoid Runtime memory fragmentation): 
http://tianocore.sourceforge.net/wiki/ArmPkg/Runtime#Tuning
The tuning is based on these PCDs.
I would also be happy to see these PCDs moved to MdeModulePkg.


From: Andrew Fish [mailto:af...@apple.com]
Sent: 29 April 2015 04:10
To: edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
Subject: [edk2] MdeModulePkg: Should have a library to produce the 
gEfiMemoryTypeInformationGuid HOB driven by PCDs.

I noticed the EmbeddedPkg has PCDs to set the gEfiMemoryTypeInformationGuid HOB 
(EFI_MEMORY_TYPE_INFORMATION array) default values. Given this is something 
that needs to get tuned per platform it seems like we should have PCD values. I 
noticed some ARM platforms use PCD values, but a lot of platforms just have a 
global.

Seems like the MdeModulePkg should have these PCDs, and it could also contain a 
library to produce the HOB based on the PCDs

For those not familiar with the gEfiMemoryTypeInformationGuid HOB it has 2 
functions:
1) Keep the runtime memory allocations constant across S4 reboots. You do this 
by having PcdMemoryTypeEfiACPIReclaimMemory, PcdMemoryTypeEfiACPIMemoryNVS, 
PcdMemoryTypeEfiReservedMemoryType, PcdMemoryTypeEfiRuntimeServicesData, and  
PcdMemoryTypeEfiRuntimeServicesCode first in the list and make sure you 
allocate a few more pages than needed for each type.
2) Defragment the EFI memory map. The boot service memory types all get freed 
back to the OS, but having the “buckets” for them reduces the number of EFI 
memory map entires.

~/work/src/edk2(master)>git grep PcdMemoryTypeEfiACPIReclaimMemory -- *.dec
EmbeddedPkg/EmbeddedPkg.dec:107:  
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0|UINT32|0x00000012

https://svn.code.sf.net/p/edk2/code/trunk/edk2/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c

VOID

BuildMemoryTypeInformationHob (

  VOID

  )

{

  EFI_MEMORY_TYPE_INFORMATION   Info[10];



  Info[0].Type          = EfiACPIReclaimMemory;

  Info[0].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiACPIReclaimMemory);

  Info[1].Type          = EfiACPIMemoryNVS;

  Info[1].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiACPIMemoryNVS);

  Info[2].Type          = EfiReservedMemoryType;

  Info[2].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiReservedMemoryType);

  Info[3].Type          = EfiRuntimeServicesData;

  Info[3].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiRuntimeServicesData);

  Info[4].Type          = EfiRuntimeServicesCode;

  Info[4].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiRuntimeServicesCode);

  Info[5].Type          = EfiBootServicesCode;

  Info[5].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiBootServicesCode);

  Info[6].Type          = EfiBootServicesData;

  Info[6].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiBootServicesData);

  Info[7].Type          = EfiLoaderCode;

  Info[7].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiLoaderCode);

  Info[8].Type          = EfiLoaderData;

  Info[8].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiLoaderData);



  // Terminator for the list

  Info[9].Type          = EfiMaxMemoryType;

  Info[9].NumberOfPages = 0;



  BuildGuidDataHob (&gEfiMemoryTypeInformationGuid, &Info, sizeof (Info));

}

vs.

https://svn.code.sf.net/p/edk2/code/trunk/edk2/Vlv2TbltDevicePkg/PlatformInitPei/MemoryPeim.c

EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {

  { EfiACPIReclaimMemory,       0x40  },    // 0x40 pages = 256k for ASL

  { EfiACPIMemoryNVS,           0x100 },    // 0x100 pages = 1 MB for S3, SMM, 
HII, etc

  { EfiReservedMemoryType,      0x600 },    // 48k for BIOS Reserved

  { EfiMemoryMappedIO,          0     },

  { EfiMemoryMappedIOPortSpace, 0     },

  { EfiPalCode,                 0     },

  { EfiRuntimeServicesCode,     0x200 },

  { EfiRuntimeServicesData,     0x100 },

  { EfiLoaderCode,              0x100 },

  { EfiLoaderData,              0x100 },

  { EfiBootServicesCode,        0x800 },

  { EfiBootServicesData,        0x2500},

  { EfiConventionalMemory,      0     },

  { EfiUnusableMemory,          0     },

  { EfiMaxMemoryType,           0     }

};


Thanks,

Andrew Fish

-- IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered 
in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, 
Registered in England & Wales, Company No: 2548782


-- IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered 
in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, 
Registered in England & Wales, Company No: 2548782
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to