public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ma, Maurice" <maurice.ma@intel.com>
To: "Dong, Guo" <guo.dong@intel.com>
Cc: "Dong, Eric" <eric.dong@intel.com>,
	"You, Benjamin" <benjamin.you@intel.com>,
	"philipp.deppenwiese@9elements.com"
	<philipp.deppenwiese@9elements.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add memory type information HOB
Date: Tue, 5 Jan 2021 19:51:52 +0000	[thread overview]
Message-ID: <DM6PR11MB27938D6322C2F1B89BA3EA0589D10@DM6PR11MB2793.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20201224205537.20648-1-guo.dong@intel.com>

Reviewed-by:  Maurice Ma <maurice.ma@intel.com>

Regards
Maurice
> -----Original Message-----
> From: Guo Dong <guo.dong@intel.com>
> Sent: Thursday, December 24, 2020 12:56
> To: devel@edk2.groups.io
> Cc: Dong, Eric <eric.dong@intel.com>; Ma, Maurice <maurice.ma@intel.com>;
> You, Benjamin <benjamin.you@intel.com>;
> philipp.deppenwiese@9elements.com
> Subject: [edk2-devel] [PATCH] UefiPayloadPkg: Add memory type information
> HOB
> 
> To avoid DXE drivers to be dispatched to memory above 4GB, this patch build
> memory type information HOB in payload entry module.
> 
> Signed-off-by: Guo Dong <guo.dong@intel.com>
> ---
>  UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c   | 23
> ++++++++++++++++++-----
>  UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h   |  1 +
>  UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf |  5 +++++
>  3 files changed, 24 insertions(+), 5 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> index 805f5448d9..5d8b9d1464 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> @@ -7,6 +7,16 @@
> 
>  #include "UefiPayloadEntry.h"
> 
> +
> +EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {
> +  { EfiACPIReclaimMemory,   FixedPcdGet32
> (PcdMemoryTypeEfiACPIReclaimMemory) },
> +  { EfiACPIMemoryNVS,       FixedPcdGet32
> (PcdMemoryTypeEfiACPIMemoryNVS) },
> +  { EfiReservedMemoryType,  FixedPcdGet32
> +(PcdMemoryTypeEfiReservedMemoryType) },
> +  { EfiRuntimeServicesData, FixedPcdGet32
> +(PcdMemoryTypeEfiRuntimeServicesData) },
> +  { EfiRuntimeServicesCode, FixedPcdGet32
> (PcdMemoryTypeEfiRuntimeServicesCode) },
> +  { EfiMaxMemoryType,       0     }
> +};
> +
>  /**
>     Callback function to build resource descriptor HOB
> 
> @@ -40,11 +50,6 @@ MemInfoCallback (
>               EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
>               EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE;
> 
> -  if (Base >= BASE_4GB ) {
> -    // Remove tested attribute to avoid DXE core to dispatch driver to memory
> above 4GB
> -    Attribue &= ~EFI_RESOURCE_ATTRIBUTE_TESTED;
> -  }
> -
>    BuildResourceDescriptorHob (Type, Attribue, (EFI_PHYSICAL_ADDRESS)Base,
> Size);
>    DEBUG ((DEBUG_INFO , "buildhob: base = 0x%lx, size = 0x%lx, type = 0x%x\n",
> Base, Size, Type));
> 
> @@ -343,6 +348,14 @@ BuildGenericHob (
>    BuildResourceDescriptorHob (EFI_RESOURCE_MEMORY_MAPPED_IO,
> ResourceAttribute, 0xFEC80000, SIZE_512KB);
>    BuildMemoryAllocationHob ( 0xFEC80000, SIZE_512KB,
> EfiMemoryMappedIO);
> 
> +  //
> +  // Create Memory Type Information HOB  //  BuildGuidDataHob (
> +    &gEfiMemoryTypeInformationGuid,
> +    mDefaultMemoryTypeInformation,
> +    sizeof(mDefaultMemoryTypeInformation)
> +  );
>  }
> 
> 
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
> b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
> index 2c84d6ed53..57b03dffe9 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
> @@ -31,6 +31,7 @@
>  #include <Guid/MemoryMapInfoGuid.h>
>  #include <Guid/AcpiBoardInfoGuid.h>
>  #include <Guid/GraphicsInfoHob.h>
> +#include <Guid/MemoryTypeInformation.h>
> 
> 
>  #define LEGACY_8259_MASK_REGISTER_MASTER  0x21 diff --git
> a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
> b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
> index cc59f1903b..444d03b6d4 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
> @@ -84,6 +84,11 @@
> 
>    gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemBase
>    gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemSize
> +  gUefiPayloadPkgTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory
> +  gUefiPayloadPkgTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS
> +  gUefiPayloadPkgTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType
> +  gUefiPayloadPkgTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData
> +  gUefiPayloadPkgTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode
>    gUefiPayloadPkgTokenSpaceGuid.PcdPayloadStackTop
>    gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
> 
> --
> 2.16.2.windows.1


      reply	other threads:[~2021-01-05 19:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-24 20:55 [edk2-devel] [PATCH] UefiPayloadPkg: Add memory type information HOB Guo Dong
2021-01-05 19:51 ` Ma, Maurice [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR11MB27938D6322C2F1B89BA3EA0589D10@DM6PR11MB2793.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox