From nobody Fri Nov 15 13:55:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+95799+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+95799+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1667279657; cv=none; d=zohomail.com; s=zohoarc; b=BCx8nuiBi59LNHW5dN//FRIS6SrnvcYAr1qshCpHpIJ0nFd1K34W0ysR5Sjb0k3KxI0qTtF/ezjyR5SBk/ZpXN0wH2Rlprfn5iYgR6mBrHtPNW4fk2R3KXG/Ao+xt5vCI0FDs+gq1iO7dzk3FZH1aowFm4kSPihQZNgkZNYwk2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667279657; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=WyizsL0LEIO/TzqkJzY01P8pDEYMZj3DuIp6G9IHWqg=; b=MexaSfyd6v9bHz7iVxqsrDU9wF5HxTTp2OqA52ZjZ0MWo7e656YgMMBQHwAcAcTaHTGlbm9wal8TbsErNKzTkcJNusUm3ZTMgif8Qka0lR+uVA0+JAD/+B0nRv8IqEn1JbY22qkg+mEANNOWPHHUjo16hSNNEG24voLDrFQLckQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+95799+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1667279657598437.589115387918; Mon, 31 Oct 2022 22:14:17 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id TsLQYY1788612xyiF3Z3Xi4Y; Mon, 31 Oct 2022 22:14:17 -0700 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.2818.1667279643333273629 for ; Mon, 31 Oct 2022 22:14:16 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10517"; a="310162741" X-IronPort-AV: E=Sophos;i="5.95,229,1661842800"; d="scan'208";a="310162741" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2022 22:14:16 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10517"; a="878985527" X-IronPort-AV: E=Sophos;i="5.95,229,1661842800"; d="scan'208";a="878985527" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.119]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2022 22:14:14 -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: [edk2-devel] [PATCH V5 06/10] ShellPkg: Update shell command memmap to show unaccepted memory Date: Tue, 1 Nov 2022 13:13:45 +0800 Message-Id: <20221101051349.13-7-min.m.xu@intel.com> In-Reply-To: <20221101051349.13-1-min.m.xu@intel.com> References: <20221101051349.13-1-min.m.xu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,min.m.xu@intel.com X-Gm-Message-State: B5x7WKYMDWsmCPI2mdcRr4INx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1667279657; bh=quDzizvuXs8FjrH2o1fe/X9rF7BZBY5HNTxPj60NeCA=; h=Cc:Date:From:Reply-To:Subject:To; b=Nx59v7ptB9Q0So1lDY51t/t+SEXSQQ4Im6u82Qezrlyjs3V3XBGMf7jpEhZqYnV1SJn 14kQ4Ft/zzw/Vt1sOS+JxWP3GyhncwbGwgjVAmtHxu9GQJsL0wCop9A0ZZaE8IzN3ejh6 arExz3cOC8TzChVa7owHXsyVFc7OwkqVzMw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1667279658469100010 Content-Type: text/plain; charset="utf-8" From: Min M Xu RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3937 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/ShellPk= g/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[] =3D= L"ACPIMemoryNVS"; STATIC CONST CHAR16 NameEfiMemoryMappedIO[] =3D L"MemoryMappedIO= "; STATIC CONST CHAR16 NameEfiMemoryMappedIOPortSpace[] =3D L"MemoryMappedIO= PortSpace"; STATIC CONST CHAR16 NameEfiPalCode[] =3D L"PalCode"; +STATIC CONST CHAR16 NameEfiUnacceptedMemoryType[] =3D L"Unaccepted"; =20 // // 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 =3D 0; PersistentPages =3D 0; Size =3D 0; + UnacceptedPages =3D 0; Descriptors =3D NULL; ShellStatus =3D SHELL_SUCCESS; Status =3D EFI_SUCCESS; @@ -303,6 +307,11 @@ ShellCommandRunMemMap ( TotalPages +=3D Walker->NumberOfPages; PalCodePages +=3D 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)), g= ShellDebug1HiiHandle, NameEfiUnacceptedMemoryType, Walker->PhysicalStart, W= alker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker= ->NumberOfPages, Walker->Attribute); + TotalPages +=3D Walker->NumberOfPages; + UnacceptedPages +=3D Walker->NumberOfPages; + break; default: // // Shell Spec defines the SFO format. @@ -335,6 +344,7 @@ ShellCommandRunMemMap ( MmioSpacePagesSize =3D MultU64x64 (SIZE_4KB, MmioSpacePages); MmioPortPagesSize =3D MultU64x64 (SIZE_4KB, MmioPortPages); PalCodePagesSize =3D MultU64x64 (SIZE_4KB, PalCodePages); + UnacceptedPagesSize =3D MultU64x64 (SIZE_4KB, UnacceptedPages); PersistentPagesSize =3D MultU64x64 (SIZE_4KB, PersistentPages); UnusableMemoryPagesSize =3D MultU64x64 (SIZE_4KB, UnusableMemoryPa= ges); 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/UefiShellDebug1Com= mandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1C= ommandsLib.uni index 6693be26e699..b1d239ed37ea 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.uni @@ -88,13 +88,14 @@ " MMIO : %,14ld Pa= ges (%,ld Bytes)\r\n" " MMIO_Port : %,14ld Pa= ges (%,ld Bytes)\r\n" " PalCode : %,14ld Pa= ges (%,ld Bytes)\r\n" + " Unaccepted: %,14ld Pa= ges (%,ld Bytes)\r\n" " Available : %,14ld Pa= ges (%,ld Bytes)\r\n" " Persistent: %,14ld Pa= ges (%,ld Bytes)\r\n" #string STR_MEMMAP_LIST_SUMM_OTHER #language en-US " %08x : %,14ld Pa= ges (%,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","%L= d","%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","%L= d","%Ld","%Ld", "%Ld"\r\n" =20 #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" --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#95799): https://edk2.groups.io/g/devel/message/95799 Mute This Topic: https://groups.io/mt/94703262/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-