public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Zhichao" <zhichao.gao@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Xu, Min M" <min.m.xu@intel.com>
Cc: "Ni, Ray" <ray.ni@intel.com>,
	"Aktas, Erdem" <erdemaktas@google.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	James Bottomley <jejb@linux.ibm.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [edk2-devel] [PATCH V3 06/12] ShellPkg: Update shell command memmap to show unaccepted memory
Date: Mon, 5 Sep 2022 09:19:45 +0000	[thread overview]
Message-ID: <PH7PR11MB6377B83F26A42D0560D3EE88F67F9@PH7PR11MB6377.namprd11.prod.outlook.com> (raw)
In-Reply-To: <9c907dfec78032252b748cd213d4af76ad5ef524.1662365866.git.min.m.xu@intel.com>

Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>

Thanks,
Zhichao

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Min Xu
> Sent: Monday, September 5, 2022 4:35 PM
> To: devel@edk2.groups.io
> Cc: Xu, Min M <min.m.xu@intel.com>; Ni, Ray <ray.ni@intel.com>; Gao,
> Zhichao <zhichao.gao@intel.com>; Aktas, Erdem
> <erdemaktas@google.com>; Gerd Hoffmann <kraxel@redhat.com>; James
> Bottomley <jejb@linux.ibm.com>; Yao, Jiewen <jiewen.yao@intel.com>;
> Tom Lendacky <thomas.lendacky@amd.com>
> Subject: [edk2-devel] [PATCH V3 06/12] ShellPkg: Update shell command
> memmap to show unaccepted memory
> 
> From: Min M Xu <min.m.xu@intel.com>
> 
> RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3937
> 
> ShellCommandRunMemMap() is updated to handle the case of unaccepted
> memory type.
> 
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Cc: Erdem Aktas <erdemaktas@google.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: James Bottomley <jejb@linux.ibm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Min Xu <min.m.xu@intel.com>
> ---
>  .../Library/UefiShellDebug1CommandsLib/MemMap.c     | 13
> +++++++++++++
>  .../UefiShellDebug1CommandsLib.uni                  |  3 ++-
>  2 files changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c
> index 72f3c58b0970..a089953b286f 100644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c
> +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c
> @@ -26,6 +26,7 @@ STATIC CONST CHAR16  NameEfiACPIMemoryNVS[]
> = L"ACPIMemoryNVS";
>  STATIC CONST CHAR16  NameEfiMemoryMappedIO[]          =
> L"MemoryMappedIO";
>  STATIC CONST CHAR16  NameEfiMemoryMappedIOPortSpace[] =
> L"MemoryMappedIOPortSpace";
>  STATIC CONST CHAR16  NameEfiPalCode[]                 = L"PalCode";
> +STATIC CONST CHAR16  NameEfiUnacceptedMemoryType[]    =
> L"Unaccepted";
> 
>  //
>  // Need short names for some memory types @@ -151,6 +152,8 @@
> ShellCommandRunMemMap (
>    UINT64                 UnusableMemoryPagesSize;
>    UINT64                 PalCodePages;
>    UINT64                 PalCodePagesSize;
> +  UINT64                 UnacceptedPages;
> +  UINT64                 UnacceptedPagesSize;
>    UINT64                 PersistentPages;
>    UINT64                 PersistentPagesSize;
>    BOOLEAN                Sfo;
> @@ -175,6 +178,7 @@ ShellCommandRunMemMap (
>    PalCodePages        = 0;
>    PersistentPages     = 0;
>    Size                = 0;
> +  UnacceptedPages     = 0;
>    Descriptors         = NULL;
>    ShellStatus         = SHELL_SUCCESS;
>    Status              = EFI_SUCCESS;
> @@ -303,6 +307,11 @@ ShellCommandRunMemMap (
>                TotalPages   += Walker->NumberOfPages;
>                PalCodePages += Walker->NumberOfPages;
>                break;
> +            case EfiUnacceptedMemoryType:
> +              ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN
> (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN
> (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle,
> NameEfiUnacceptedMemoryType, Walker->PhysicalStart, Walker-
> >PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker-
> >NumberOfPages, Walker->Attribute);
> +              TotalPages      += Walker->NumberOfPages;
> +              UnacceptedPages += Walker->NumberOfPages;
> +              break;
>              default:
>                //
>                // Shell Spec defines the SFO format.
> @@ -335,6 +344,7 @@ ShellCommandRunMemMap (
>          MmioSpacePagesSize      = MultU64x64 (SIZE_4KB, MmioSpacePages);
>          MmioPortPagesSize       = MultU64x64 (SIZE_4KB, MmioPortPages);
>          PalCodePagesSize        = MultU64x64 (SIZE_4KB, PalCodePages);
> +        UnacceptedPagesSize     = MultU64x64 (SIZE_4KB, UnacceptedPages);
>          PersistentPagesSize     = MultU64x64 (SIZE_4KB, PersistentPages);
>          UnusableMemoryPagesSize = MultU64x64 (SIZE_4KB,
> UnusableMemoryPages);
>          if (!Sfo) {
> @@ -368,6 +378,8 @@ ShellCommandRunMemMap (
>              MmioPortPagesSize,
>              PalCodePages,
>              PalCodePagesSize,
> +            UnacceptedPages,
> +            UnacceptedPagesSize,
>              AvailPages,
>              AvailPagesSize,
>              PersistentPages,
> @@ -422,6 +434,7 @@ ShellCommandRunMemMap (
>              AcpiReclaimPagesSize,
>              AcpiNvsPagesSize,
>              PalCodePagesSize,
> +            UnacceptedPagesSize,
>              PersistentPagesSize
>              );
>          }
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.uni
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.uni
> index 6693be26e699..b1d239ed37ea 100644
> ---
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.uni
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> d
> +++ sLib.uni
> @@ -88,13 +88,14 @@
>                                                    "  MMIO      : %,14ld Pages (%,ld Bytes)\r\n"
>                                                    "  MMIO_Port : %,14ld Pages (%,ld Bytes)\r\n"
>                                                    "  PalCode   : %,14ld Pages (%,ld Bytes)\r\n"
> +                                                  "  Unaccepted: %,14ld Pages (%,ld Bytes)\r\n"
>                                                    "  Available : %,14ld Pages (%,ld Bytes)\r\n"
>                                                    "  Persistent: %,14ld Pages (%,ld Bytes)\r\n"
>  #string STR_MEMMAP_LIST_SUMM_OTHER #language en-US
> "  %08x  : %,14ld Pages (%,ld Bytes)\r\n"
>  #string STR_MEMMAP_LIST_SUMM2     #language en-US "              -------------
> - \r\n"
>                                                    "Total Memory: %,14ld MB (%,ld Bytes)\r\n"
>  #string STR_MEMMAP_LIST_ITEM_SFO  #language en-US
> "MemoryMap,"%s","%LX","%LX","%LX","%LX"\r\n"
> -#string STR_MEMMAP_LIST_SUMM_SFO  #language en-US
> "MemoryMapSummary,"%Ld","%Ld","%Ld","%Ld","%Ld","%Ld","%Ld","%Ld
> ","%Ld","%Ld","%Ld","%Ld","%Ld","%Ld","%Ld","%Ld"\r\n"
> +#string STR_MEMMAP_LIST_SUMM_SFO  #language en-US
> "MemoryMapSummary,"%Ld","%Ld","%Ld","%Ld","%Ld","%Ld","%Ld","%Ld
> ","%Ld","%Ld","%Ld","%Ld","%Ld","%Ld","%Ld","%Ld", "%Ld"\r\n"
> 
>  #string STR_EFI_COMPRESS_FAIL     #language en-US "Unable to
> compress: %r.\r\n"
>  #string STR_EFI_DECOMPRESS_FAIL   #language en-US "Unable to
> decompress: %r.\r\n"
> --
> 2.29.2.windows.2
> 
> 
> 
> 
> 


  reply	other threads:[~2022-09-05  9:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05  8:34 [PATCH V3 00/12] Introduce Lazy-accept for Tdx guest Min Xu
2022-09-05  8:34 ` [PATCH V3 01/12] MdeModulePkg: Add PrePiHob.h Min Xu
2022-09-07  5:31   ` Gerd Hoffmann
2022-09-05  8:34 ` [PATCH V3 02/12] MdePkg: Increase EFI_RESOURCE_MAX_MEMORY_TYPE Min Xu
2022-09-06 18:44   ` Michael D Kinney
2022-09-07  0:19     ` Min Xu
2022-09-05  8:34 ` [PATCH V3 03/12] OvmfPkg: Use EFI_RESOURCE_MEMORY_UNACCEPTED which defined in MdeModulePkg Min Xu
2022-09-07  5:31   ` Gerd Hoffmann
2022-09-05  8:34 ` [PATCH V3 04/12] MdePkg: Add UEFI Unaccepted memory definition Min Xu
2022-09-07  5:32   ` Gerd Hoffmann
2022-09-05  8:34 ` [PATCH V3 05/12] MdeModulePkg: Update Dxe to handle unaccepted memory type Min Xu
2022-09-07  5:32   ` Gerd Hoffmann
2022-09-05  8:35 ` [PATCH V3 06/12] ShellPkg: Update shell command memmap to show unaccepted memory Min Xu
2022-09-05  9:19   ` Gao, Zhichao [this message]
2022-09-05  8:35 ` [PATCH V3 07/12] OvmfPkg: Add MaxAcceptedMemoryAddress in TDX work area Min Xu
2022-09-05  8:35 ` [PATCH V3 08/12] OvmfPkg: Introduce lazy accept in PlatformInitLib and PlatformPei Min Xu
2022-09-07  5:37   ` Gerd Hoffmann
2022-09-08  1:13     ` [edk2-devel] " Min Xu
2022-09-05  8:35 ` [PATCH V3 09/12] OvmfPkg: Update ConstructFwHobList for lazy accept Min Xu
2022-09-07  5:41   ` Gerd Hoffmann
2022-09-08  0:48     ` Min Xu
2022-09-08  7:43       ` Gerd Hoffmann
2022-09-05  8:35 ` [PATCH V3 10/12] MdePkg: The prototype definition of EdkiiMemoryAcceptProtocol Min Xu
2022-09-05  8:35 ` [PATCH V3 11/12] OvmfPkg: Realize EdkiiMemoryAcceptProtocol in TdxDxe Min Xu
2022-09-05  8:35 ` [PATCH V3 12/12] OvmfPkg: Call gEdkiiMemoryAcceptProtocolGuid to accept pages Min Xu

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=PH7PR11MB6377B83F26A42D0560D3EE88F67F9@PH7PR11MB6377.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