From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web09.3237.1663027349527091004 for ; Mon, 12 Sep 2022 17:02:43 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=lAN/70Ul; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663027363; x=1694563363; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RZZdTIG18AYNjXhgZ64yEuu+ZxRLbUCXAG6cUGdxbeQ=; b=lAN/70Ul1Qrmc3jTSdUJAY2FiDEsbwp9ZyysbbDQssAJTAO5v9qU1sGh e/D0it1pSVNqQGjOgOnqtQ/rl0Uee1k7qI8l+B98/p7Ki3UEDtbh3Lg6Z x9nVeee350OPGExRodM9h+2p7K259hpGAg4H4S+trcRvlyCumLXHQL+Xn kPXfgWBVcpIQ2FMk1CJA131Pj+SvgYdFAFYymk0W3lWKZT8KX61sB5hv3 4byJp/FP/d6Uczj4x/l7AV+C+yHfgdETeg61UcilN4UywTIA24/fSSIq1 htBm7xcEBy8Qqu+t1pardlfnEWLxWs9snid5DZJ5cKoSBNnWd26o0gZvm A==; X-IronPort-AV: E=McAfee;i="6500,9779,10468"; a="384294432" X-IronPort-AV: E=Sophos;i="5.93,311,1654585200"; d="scan'208";a="384294432" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 17:02:43 -0700 X-IronPort-AV: E=Sophos;i="5.93,311,1654585200"; d="scan'208";a="678320906" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.254.212.104]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 17:02:41 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Ray Ni , Zhichao Gao , Erdem Aktas , Gerd Hoffmann , James Bottomley , Jiewen Yao , Tom Lendacky Subject: [PATCH V4 06/10] ShellPkg: Update shell command memmap to show unaccepted memory Date: Tue, 13 Sep 2022 08:02:10 +0800 Message-Id: <91d6622326a90c86ae6a70121f2ad15299e56e75.1663026445.git.min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Min M Xu RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3937 ShellCommandRunMemMap() is updated to handle the case of unaccepted memory type. Cc: Ray Ni Cc: Zhichao Gao Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Acked-by: Gerd Hoffmann Acked-by: Zhichao Gao Signed-off-by: Min Xu --- .../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/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni index 6693be26e699..b1d239ed37ea 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.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