From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0627.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::627]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3E39582158 for ; Tue, 20 Dec 2016 04:22:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=lxW4bLfE9DvahNl6uzqAZZ5k2NV+JPGbKcnrngYF0GU=; b=bAcxmNTnfQsoYvr3YArMFNvHHd1s8XHnZoqcJl+ubUMr7rAF2JUAjdi07HWgZbO0PFh5i+4dUePtTZGIAZOgTs6tbYW8nGcHhnNpbmhuHVpiBZl1AIk7uKr5RuruiSDQvCsl0mV9rJlEPsZZtygtvocqILvc5FQxHAFjyOa9hmA= Received: from AM5PR0801MB1762.eurprd08.prod.outlook.com (10.169.247.16) by VI1PR0802MB2511.eurprd08.prod.outlook.com (10.175.20.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14; Tue, 20 Dec 2016 12:22:40 +0000 Received: from AM5PR0801MB1762.eurprd08.prod.outlook.com ([10.169.247.16]) by AM5PR0801MB1762.eurprd08.prod.outlook.com ([10.169.247.16]) with mapi id 15.01.0771.020; Tue, 20 Dec 2016 12:22:40 +0000 From: Evan Lloyd To: "Ni, Ruiyu" , "Carsey, Jaben" , Sami Mujawar CC: Leif Lindholm , "ard.biesheuvel@linaro.org" , "edk2-devel@ml01.01.org" Thread-Topic: [edk2] [PATCH] ShellPkg: Add acpiview tool to dump ACPI tables Thread-Index: AQHSV8nfzRASeiOrb0O70tD1DSK8y6EPCpYAgABWn6CAADMGgIAAllIAgACUMtA= Date: Tue, 20 Dec 2016 12:22:40 +0000 Message-ID: References: <20161216182547.616-1-evan.lloyd@arm.com> <734D49CCEBEEF84792F5B80ED585239D5B836C04@SHSMSX103.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5B8371E1@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5B8371E1@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Evan.Lloyd@arm.com; x-originating-ip: [217.140.96.140] x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-office365-filtering-correlation-id: 97591f4b-3a59-4147-f426-08d428d2e478 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:VI1PR0802MB2511; x-microsoft-exchange-diagnostics: 1; VI1PR0802MB2511; 7:rWt6jui6sU3OE+7LQRn7kaPWj/yvrIvs4di1owuR3ZkjOVf9IcEU0vWqSnd6eVS0FvoSrtu8/uPH1mPxHYVSUA6l25Bxk4iG02I/i4ajR+LJtUo8h/0SjmXBaIhyYtF0Mrre2lMsXQAG+llgK1KfRbxTh7Fp/hoZcGhZmIbhxYz66LJnEZRpfDS5Btc9kpJZOsCqChfwnC9Eki4f/3ea9U4UdGOKv11EZ0tCOBellStXEPFvm4Fqh0Gsi2RLmF6G86KgB9DP8NIsBSYNwdYWO912Hj5Qs5918ol2Cxu3KAqXf9CyZN4DldgI8y59YXodXaqnpL4xSrrgI/1+RKCy0C9GKseDtnqsDjjat0jWzA8nG6tlgcIXSaVG2D1ZV5vSQRvfwkGkPdwH0CkMd6eiiEVLj+T8TmhabgSUaVViOYiMqiWCoeKFdSkaVMc3VyKHg7XkOSgsUya3wftyxS1kQA== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(166708455590820)(162533806227266)(211171220733660)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(6072148); SRVR:VI1PR0802MB2511; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0802MB2511; x-forefront-prvs: 0162ACCC24 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39840400002)(39410400002)(39450400003)(39860400002)(39850400002)(377454003)(40434004)(199003)(13464003)(189002)(51914003)(6636002)(2906002)(101416001)(4326007)(6116002)(102836003)(3846002)(50986999)(33656002)(122556002)(105586002)(93886004)(106356001)(345774005)(92566002)(5001770100001)(76176999)(76576001)(3900700001)(3660700001)(54356999)(68736007)(38730400001)(86362001)(5660300001)(106116001)(74316002)(189998001)(6436002)(25786008)(97736004)(7696004)(77096006)(7736002)(81156014)(66066001)(3280700002)(305945005)(8936002)(8676002)(6506006)(81166006)(2950100002)(5890100001)(2900100001)(9686002)(229853002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0802MB2511; H:AM5PR0801MB1762.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Dec 2016 12:22:40.5135 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2511 Subject: Re: [PATCH] ShellPkg: Add acpiview tool to dump ACPI tables X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2016 12:22:44 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ray. Comments inline below >-----Original Message----- >From: Ni, Ruiyu [mailto:ruiyu.ni@intel.com] >Sent: 20 December 2016 02:59 >To: Carsey, Jaben; Evan Lloyd >Cc: Leif Lindholm; ard.biesheuvel@linaro.org; edk2-devel@ml01.01.org >Subject: RE: [edk2] [PATCH] ShellPkg: Add acpiview tool to dump ACPI >tables > >Evan, >Thanks for the answers. BSD license of your code is great! Thanks for your >contribution. >But I do have some other thoughts in below. > >Jaben, Evan, >The implementation style of "acpiview" is to embed it into "Shell.efi" as = an >internal >command, in "Debug1" profile. > >I am afraid it's a violation of Shell spec because Shell spec defines a fi= xed list >of commands >that belongs to "Debug1" profile, while "acpiview" isn't in the list. Don't tell anyone, but we hope eventually to get this added to the shell sp= ec. We wrote the tool to investigate some problems, and it proved so useful tha= t we wanted to make it available as quickly as possible. >On the other side, some people may want a standalone "acpiview.efi" that >he use it in >any UEFI Shell environment. Sami originally had this - I am to blame for making it a Shell app like smb= iosview. The .efi is helpful for platforms that support USB drives, as you can just = invoke it off a drive. Sami will look at adding the INF #2 to our patch. > >How about we provide two INF files for this tool: >1. NULL class INF providing constructor/destructor(Current INF) >2. APP INF generating standalone "acpiview.efi" (New INF I want) > >When creating INF #2, in order to embed the help message into the >resource section of EFI file >so that Shell core can find it and display when "-?" is typed, we need to: >1. declare "UEFI_HII_RESOURCE_SECTION =3D TRUE" to let build tool embed >HII resource (string) > into the resource section. >2. write code in entrypoint of application to retrieve the string resource >from ImageHandle, and > free the resource in Unload. > Sample code is in >MdeModulePkg/Universal/HiiResourcesSampleDxe/HiiResourcesSample.c >3. Explicitly reference the token ID of help string in C file so that buil= d tool >doesn't optimize out > the help string from HII resource. > Sample code in MdeModulePkg/Application/HelloWorld/HelloWorld.c: > GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID >mStringHelpTokenId > =3D STRING_TOKEN >(STR_HELLO_WORLD_HELP_INFORMATION); > >The step 2&3 can be put in a new .C file that only be referenced by the AP= P >INF file. Thank you for the pointers. We'll add this advice into our next update. > >Since now we provide both library and application for acpiview, how about >put it in new location >ShellPkg/Application/AcpiView directory? You're the maintainer - we'll happily take your advice on the best place fo= r it. > >What's your option? If you agree, I can help to create the APP INF. We'll take all the help we can get, please. If you would like to send us a= .INF, we'd be grateful for the time it will save us. > >Thanks/Ray > >> -----Original Message----- >> From: Carsey, Jaben >> Sent: Tuesday, December 20, 2016 2:01 AM >> To: Evan Lloyd ; Ni, Ruiyu ; >> edk2-devel@ml01.01.org >> Cc: Leif Lindholm ; ard.biesheuvel@linaro.org; >> Carsey, Jaben >> Subject: RE: [edk2] [PATCH] ShellPkg: Add acpiview tool to dump ACPI >tables >> >> I am good with this addition. The BSD is a huge advantage for me. >> >> Reviewed-by: Jaben Carsey >> >> I will allow Ray to resolve any issues he and push it. >> >> -Jaben >> >> > -----Original Message----- >> > From: Evan Lloyd [mailto:Evan.Lloyd@arm.com] >> > Sent: Monday, December 19, 2016 7:57 AM >> > To: Ni, Ruiyu ; edk2-devel@ml01.01.org >> > Cc: Carsey, Jaben ; Leif Lindholm >> > ; ard.biesheuvel@linaro.org >> > Subject: RE: [edk2] [PATCH] ShellPkg: Add acpiview tool to dump ACPI >> > tables >> > Importance: High >> > >> > Hi Ray. >> > Good question. Answer inline. >> > >> > >-----Original Message----- >> > >From: Ni, Ruiyu [mailto:ruiyu.ni@intel.com] >> > >Sent: 19 December 2016 09:49 >> > >To: Evan Lloyd; edk2-devel@ml01.01.org >> > >Cc: Carsey, Jaben; Leif Lindholm; ard.biesheuvel@linaro.org >> > >Subject: RE: [edk2] [PATCH] ShellPkg: Add acpiview tool to dump ACPI >> > >tables >> > > >> > >I happened to find another version of acpi dump tool in shell. >> > >Binary can be downloaded from: https://acpica.org/downloads/uefi- >> > >support >> > >Source can be downloaded from: https://github.com/acpica/acpica >> > > >> > >Are there any differences between the above one and yours? >> > >> > The main differences are: >> > 1.acpiview provides a formatted dump of non-AML tables at the Shell >level. >> > This provides the equivalent of using acpidump -b, then transferring >> > the file to use "iasl -d" on another system. However, it works on >> > systems where the tables do not yet enable an OS to boot, or have >limited >> disk functionality. >> > 2.It provides a small amount of specification consistency >> > checking/error reporting at the Shell level. We have found that to be >> > an invaluable aid to debugging. >> > 3.It has a normal UEFI BSD license, so doesn't instigate legal anxiety= . >> > >> > Regards, >> > Evan >> > >> > >> > > >> > >Thanks/Ray >> > > >> > >> -----Original Message----- >> > >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On >Behalf >> > >> Of evan.lloyd@arm.com >> > >> Sent: Saturday, December 17, 2016 2:26 AM >> > >> To: edk2-devel@ml01.01.org >> > >> Cc: Carsey, Jaben ; Ni, Ruiyu >> > >; >> > >> Leif Lindholm ; Ard Biesheuvel >> > >> >> > >> Subject: [edk2] [PATCH] ShellPkg: Add acpiview tool to dump ACPI >> > >> tables >> > >> >> > >> From: Sami Mujawar >> > >> >> > >> This program is provided to allow examination of ACPI table >> > >> contents from the UEFI Shell. This can help with investigations, >> > >> especially at that stage where the tables are not enabling an OS to >boot. >> > >> The program is not exhaustive, and only encapsulates detailed >> > >> knowledge of a limited number of table types. >> > >> >> > >> Default behaviour is to display the content of all tables installed= . >> > >> 'Known' table types will be parsed and displayed with descriptions >> > >> and field values. Where appropriate a degree of consistency >> > >> checking is done and errors may be reported in the output. >> > >> Other table types will be displayed as an array of Hexadecimal byte= s. >> > >> >> > >> To facilitate debugging, the -t and -b options can be used to >> > >> generate a binary file image of a table that can be copied >> > >> elsewhere for investigation using tools such as those provided by >> > >> acpica.org. This is especially relevant for AML type tables like D= SDT >and >> SSDT. >> > >> >> > >> The inspiration for this is the existing smbiosview Debug1 Shell >> > >> command, and the command is also intended for Debug1. >> > >> >> > >> Many tables are not explicitly handled, in part because no examples >> > >> are available for our testing. >> > >> >> > >> The program is designed to be extended to new tables with minimal >> > >> effort, and contributions are invited. >> > >> >> > >> The code is available for examination at: >> > >> https://github.com/EvanLloyd/tianocore/tree/651_acpiview_v1 >> > >> >> > >> Contributed-under: TianoCore Contribution Agreement 1.0 >> > >> Signed-off-by: Sami Mujawar >> > >> Signed-off-by: Evan Lloyd >> > >> --- >> > >> ShellPkg/ShellPkg.dec = | 2 + >> > >> >> > >> >> > ... >> > >> Guid("CE165669-3EF3-493F-B85D-6190EE5B9759") >> > >> >> > >> _______________________________________________ >> > >> edk2-devel mailing list >> > >> edk2-devel@lists.01.org >> > >> https://lists.01.org/mailman/listinfo/edk2-devel >> > IMPORTANT NOTICE: The contents of this email and any attachments >are >> > confidential and may also be privileged. If you are not the intended >> > recipient, please notify the sender immediately and do not disclose >> > the contents to any other person, use it for any purpose, or store or >> > copy the information in any medium. Thank you. IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.