From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 1649BAC19E9 for ; Thu, 4 Apr 2024 21:26:38 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=5E4TwGuRypfx0k7nBpl+W4eOGfLzaGKrW4kYPToRZF4=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1712265997; v=1; b=U/So8uDvGjBmi8nXfYhIdHOpCGAZ2wJW/2vlYsGKWScmFsp37rgfzhxtMlWvdG90qXo3uKge Uh+cKpkBaZ9okUoX6JrWSAa9vnZwG1nIEeJxv41wJVPxBkne3z3hR3skTD2jUuC4+2ammh8XJQJ IcLiicwkDkrgjBTslOLinK+aZjGchvXpyXGD0HQgcOzaMcOAvp1JdJLZzXeekDvJA+7oEYPp90J MTgJEll4BYNJtTSZHmUT1ggnt7I81zDl+912KUxrHXCb7V9vi3LUqXolT3MNd0U34259gM+AGhv gt3TecDwe06DmLvrflZsJi+PTvOBK8YejaMpExy3YGmhg== X-Received: by 127.0.0.2 with SMTP id nEwjYY7687511xBT4lZQpiOA; Thu, 04 Apr 2024 14:26:37 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.4393.1712265996783112112 for ; Thu, 04 Apr 2024 14:26:36 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E296DFEC; Thu, 4 Apr 2024 14:27:06 -0700 (PDT) X-Received: from [10.118.105.166] (C02F85CGML7H.austin.arm.com [10.118.105.166]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1F88F3F64C; Thu, 4 Apr 2024 14:26:36 -0700 (PDT) Message-ID: <04cea3f3-1f36-43fa-a20c-0b33d2d1ea2b@arm.com> Date: Thu, 4 Apr 2024 16:26:35 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v4 1/3] ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in Dmem.c To: devel@edk2.groups.io, sam.kaynor@arm.com Cc: Ray Ni , Zhichao Gao References: <20240403211933.1662236-1-Sam.Kaynor@arm.com> <20240403211933.1662236-2-Sam.Kaynor@arm.com> From: "Stuart Yoder" In-Reply-To: <20240403211933.1662236-2-Sam.Kaynor@arm.com> Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 04 Apr 2024 14:26:36 -0700 Resent-From: stuart.yoder@arm.com Reply-To: devel@edk2.groups.io,stuart.yoder@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ZS5JvyTFJ9QZYxeYwNVLPdVnx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b="U/So8uDv"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: Stuart Yoder On 4/3/24 4:19 PM, Sam Kaynor via groups.io wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4352 >=20 > Implemented the dumping of the UEFI RT Properties Table using Dmem.c >=20 > Added new entry to the help command for the -verbose option >=20 > Cc: Ray Ni > Cc: Zhichao Gao > Signed-off-by: Sam Kaynor > --- >=20 > Notes: > v4: > - fixed crash when RTProperties table not present > - expanded help output to include -verbose option > v3: > - fixed build errors > - properly using Address variable >=20 > ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c = | 63 ++++++++++++++++++++ > ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.= uni | 23 ++++++- > 2 files changed, 84 insertions(+), 2 deletions(-) >=20 > diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPk= g/Library/UefiShellDebug1CommandsLib/Dmem.c > index a609971f345e..52a0630f1cdc 100644 > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c > @@ -84,8 +84,64 @@ DisplayMmioMemory ( > return (ShellStatus); > } > =20 > +/** > + Display the RtPropertiesTable entries > + > + @param[in] Address The pointer to the RtPropertiesTable. > +**/ > +SHELL_STATUS > +DisplayRtProperties ( > + IN UINT64 Address > + ) > +{ > + EFI_RT_PROPERTIES_TABLE *RtPropertiesTable; > + UINT32 RtServices; > + SHELL_STATUS ShellStatus; > + EFI_STATUS Status; > + > + ShellStatus =3D SHELL_SUCCESS; > + > + if (Address !=3D 0) { > + RtPropertiesTable =3D (EFI_RT_PROPERTIES_TABLE *)Address; > + > + RtServices =3D (UINT32)RtPropertiesTable->RuntimeServicesSupported; > + Status =3D ShellPrintHiiEx ( > + -1, > + -1, > + NULL, > + STRING_TOKEN (STR_DMEM_RT_PROPERTIES), > + gShellDebug1HiiHandle, > + EFI_RT_PROPERTIES_TABLE_VERSION, > + (RtServices & EFI_RT_SUPPORTED_GET_TIME) ? 1 : 0, > + (RtServices & EFI_RT_SUPPORTED_SET_TIME) ? 1 : 0, > + (RtServices & EFI_RT_SUPPORTED_GET_WAKEUP_TIME) ? 1 : 0, > + (RtServices & EFI_RT_SUPPORTED_SET_WAKEUP_TIME) ? 1 : 0, > + (RtServices & EFI_RT_SUPPORTED_GET_VARIABLE) ? 1 : 0, > + (RtServices & EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME) ? 1 : 0, > + (RtServices & EFI_RT_SUPPORTED_SET_VARIABLE) ? 1 : 0, > + (RtServices & EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP) ? 1 : 0, > + (RtServices & EFI_RT_SUPPORTED_CONVERT_POINTER) ? 1 : 0, > + (RtServices & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT) ? 1 = : 0, > + (RtServices & EFI_RT_SUPPORTED_RESET_SYSTEM) ? 1 : 0, > + (RtServices & EFI_RT_SUPPORTED_UPDATE_CAPSULE) ? 1 : 0, > + (RtServices & EFI_RT_SUPPORTED_QUERY_CAPSULE_CAPABILITIES) ? 1 : 0= , > + (RtServices & EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO) ? 1 : 0 > + ); > + > + if (EFI_ERROR (Status)) { > + ShellStatus =3D SHELL_ABORTED; > + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_ERR_GET_FAIL= ), gShellDebug1HiiHandle, L"RtPropertiesTable"); > + } > + } else { > + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_ERR_NOT_FOUND)= , gShellDebug1HiiHandle, L"RtPropertiesTable"); > + } > + > + return (ShellStatus); > +} > + > STATIC CONST SHELL_PARAM_ITEM ParamList[] =3D { > { L"-mmio", TypeFlag }, > + { L"-verbose", TypeFlag }, > { NULL, TypeMax } > }; > =20 > @@ -308,6 +364,13 @@ ShellCommandRunDmem ( > ConformanceProfileTableAddress > ); > } > + > + if (ShellCommandLineGetFlag (Package, L"-verbose")) { > + if (ShellStatus =3D=3D SHELL_SUCCESS) { > + ShellStatus =3D DisplayRtProperties (RtPropertiesTableAddres= s); > + } > + } > + > } else { > ShellStatus =3D DisplayMmioMemory (Address, (UINTN)Size); > } > diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1C= ommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug= 1CommandsLib.uni > index 4041f0cd483e..a2241614f109 100644 > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands= Lib.uni > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands= Lib.uni > @@ -126,8 +126,26 @@ > "Memory Range Capsule= %016LX\r\n" > "Hii Database Export = Buffer %016LX\r\n" > "Conformance Profile = Table %016LX\r\n" > - > - > +#string STR_DMEM_RT_PROPERTIES #language en-US "\r\nRT Properties Tab= le\r\n" > + "---------------------= -------------------\r\n" > + "Version 0x%= 01LX\r\n" > + "Runtime Services Supp= orted:\r\n" > + " GET_TIME = %d\r\n" > + " GET_WAKEUP_TIME = %d\r\n" > + " SET_TIME = %d\r\n" > + " SET_WAKEUP_TIME = %d\r\n" > + " GET_VARIABLE = %d\r\n" > + " GET_NEXT_VARIABLE_N= AME %d\r\n" > + " SET_VARIABLE = %d\r\n" > + " SET_VIRTUAL_ADDRESS= _MAP %d\r\n" > + " CONVERT_POINTERS = %d\r\n" > + " GET_NEXT_HIGH_MONOT= ONIC_COUNT %d\r\n" > + " RESET_SYSTEM = %d\r\n" > + " UPDATE_CAPSULE = %d\r\n" > + " QUERY_CAPSULE_CAPAB= ILITIES %d\r\n" > + " QUERY_VARIABLE_INFO= %d\r\n" > +#string STR_DMEM_ERR_NOT_FOUND #language en-US "\r\n%H%s%N: Table add= ress not found.\r\n" > +#string STR_DMEM_ERR_GET_FAIL #language en-US "\r\n%H%s%N: Unable to= get table information.\r\n" > =20 > #string STR_LOAD_PCI_ROM_RES #language en-US "Image '%B%s%N' load = result: %r\r\n" > #string STR_LOADPCIROM_CORRUPT #language en-US "%H%s%N: File '%B%s%N= ' Image %d is corrupt.\r\n" > @@ -589,6 +607,7 @@ > " \r\n" > " -b - Displays one screen at a time.\r\n" > " -MMIO - Forces address cycles to the PCI bus.\r\n" > +" -verbose - Displays contents of certain EFI System Tables.\r\n" > " address - Specifies a starting address in hexadecimal format.\r\n" > " size - Specifies the number of bytes to display in hexadecimal fo= rmat.\r\n" > ".SH DESCRIPTION\r\n" -=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 (#117444): https://edk2.groups.io/g/devel/message/117444 Mute This Topic: https://groups.io/mt/105318209/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-