summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellAcpiViewCommandLib
Commit message (Collapse)AuthorAgeFilesLines
* ShellPkg/Acpiview: Adds ACPI WSMT Table parseAbdul Lateef Attar2024-03-254-0/+166
| | | | | | | | | | Adds WSMT parse to the UefiShellAcpiViewCommandLib library. Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/Acpiview: Adds HPET parserAbdul Lateef Attar2024-03-254-0/+241
| | | | | | | | | | Adds HPET parse to the UefiShellAcpiViewCommandLib library. Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: Acpiview: Update MADT parser for TRBE interruptSami Mujawar2023-10-301-2/+46
| | | | | | | | | | | | | | | | | ACPI 6.5 introduces a new filed to the MADT GICC structure to specify the TRBE interrupt. The TRBE interrupt is a Processor Private interrupt (PPI) and is used to specify a platform-specific interrupt to signal TRBE events. Therefore, update the MADT GICC structure parser to parse the new TRBE interrupt field. Also, add validations to check that the TRBE interrupt is within the PPI interrupt range. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
* ShellPkg/AcpiView: ERST ParserJeshua Smith2023-02-024-0/+304
| | | | | | | | | Add a new parser for the Error Record Serialization Table. The ERST table describes how an OS can save and retrieve hardware error information to and from a persistent store. Signed-off-by: Jeshua Smith <jeshuas@nvidia.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/AcpiView: APMT ParserJeff Brasen2022-12-135-0/+130
| | | | | | | | | | Add a new parser for the Arm Performance Monitoring Unit Table. The APMT table describes the properties of PMU support implemented by components in an Arm-based system. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ShellPkg/AcpiView: Update PCCT fields for ACPI 6.5Pierre Gondois2022-10-311-3/+3
| | | | | | | | | | | | | The ACPI specification updated some terms in accordance with: s1.1.1 Principle of Inclusive Terminology Update the PCCT parser accordincly with these new terms. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ShellPkg: Adds Local APIC parser to AcpiViewAbdul Lateef Attar2022-08-311-7/+67
| | | | | | | | | | Parse Type 0 or Local APIC structure. Also parse the Local APIC Flags as bitfields. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Abdul Lateef Attar <abdattar@amd.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* Revert "ShellPkg: Adds Local APIC parser to AcpiView"Liming Gao2022-08-281-67/+7
| | | | | | | | This reverts commit d5fd86f256b9ab5b4e3aff70d3c177c18faea892 for tag202208. This feature will be merged after stable tag 202208 is created. Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* ShellPkg: Add revision check for DSDT Header on ArmEdward Pickup2022-08-241-1/+17
| | | | | | | | | | | | | | | | | Bugzilla: 3995 (https://bugzilla.tianocore.org/show_bug.cgi?id=3995) ACPI 6.4 spec states that if the revision field in the DSDT header is less than 2, then all integers are restricted in width to 32 bits, including in SSDTs. Arm Base boot requirements state that platforms must conform to ACPI 6.3 or later, and that legacy tables are not supported. Adds a check for this field and raise warning if revision is less than 2 on arm. Signed-off-by: Edward Pickup <edward.pickup@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: Adds Local APIC parser to AcpiViewAbdul Lateef Attar2022-08-221-7/+67
| | | | | | | | | | Parse Type 0 or Local APIC structure. Also parse the Local APIC Flags as bitfields. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Abdul Lateef Attar <abdattar@amd.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: Acpiview: IORT parser update for IORT Rev E.d specSami Mujawar2022-07-291-18/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bugzilla: 3458 - Add support IORT Rev E.d specification updates (https://bugzilla.tianocore.org/show_bug.cgi?id=3458) The IO Remapping Table, Platform Design Document, Revision E.d, Feb 2022 (https://developer.arm.com/documentation/den0049/) introduces the following updates, collectively including the updates and errata fixes to Rev E, Rev E.a, Rev E.b, Rev E.c: - increments the IORT table revision to 5. - updates the node definition to add an 'Identifier' field. - adds definition of node type 6 - Reserved Memory Range node. - adds definition for Memory Range Descriptors. - adds flag to indicate PRI support for root complexes. - adds flag to indicate if the root complex supports forwarding of PASID information on translated transactions to the SMMU. - adds flag to indicate if the root complex supports PASID. - adds flags to define access privilege and attributes for the memory ranges. Therefore, update the IORT parser to: - parse the Identifier field. - parse Reserved Memory Range node. - parse Memory Range Descriptors. - add validations to check that the physical range base and size of the Memory Range Descriptor is 64KB aligned. - add validation to check that the IORT Table Revision is not 4 as IORT Rev E.c is deprecated. - add validation to check that the IORT RMR node revision is not 2 as it breaks backward compatibility and was deprecated as part of IORT Rev E.c. - skip parsing of IORT Rev E, Rev E.a, Rev E.b, Rev E.c as some fields were deprecated in these revisions. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
* ShellPkg: Acpiview: Abbreviate field names to preserve alignmentSami Mujawar2022-07-291-5/+8
| | | | | | | | | | Some field names in the IORT table parser were longer than the OUTPUT_FIELD_COLUMN_WIDTH plus indentation, resulting in loss of the output print alignment. Therefore, abbreviate the field names. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
* ShellPkg/AcpiView: PrintFormatter for FADT Flags fieldAbdul Lateef Attar2022-03-282-56/+113
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3839 Adds PrintFormatter function to the FADT flags field. Prints indivisual flag name along with flag value. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Abdul Lateef Attar <abdattar@amd.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parserAbdul Lateef Attar2022-03-282-0/+236
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3839 Adds ParseAcpiBitFields() which is based on ParseAcpi() and capable of parsing the bit fields. Supports parsing of UINT8, UINT16, UINT32 and UINT64 byte data. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Abdul Lateef Attar <abdattar@amd.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: Fix incorrect PPTT FlagName dereferenceChris Jones2022-02-071-3/+3
| | | | | | | | | | | | | | | Bugzilla: 3770 (https://bugzilla.tianocore.org/show_bug.cgi?id=3770) The PPTT parser in AcpiView incorrectly dereferences a pointer to FlagName when trying to log an error with the PPTT cache flags, which can lead to random crashes and other errors. Also fix some spacing in the error message to ensure the message is printed cleanly. Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ShellPkg: Add Cache ID to PPTT parserChris Jones2021-12-101-15/+144
| | | | | | | | | | | | Bugzilla: 3697 (https://bugzilla.tianocore.org/show_bug.cgi?id=3697) Update the Acpiview PPTT parser with the Cache ID field and relevant validations as defined in tables 5.140 and 5.141 of the ACPI 6.4 specification. Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ShellPkg: Update Acpiview PPTT parser to ACPI 6.4Chris Jones2021-12-102-51/+12
| | | | | | | | | | | | | | Bugzilla: 3697 (https://bugzilla.tianocore.org/show_bug.cgi?id=3697) Update the Acpiview PPTT parser to use Acpi64.h. As part of the changes, remove support for parsing PPTT type 2 ID structure. Mantis ID for removing PPTT type 2 structure: 2072 (https://mantis.uefi.org/mantis/view.php?id=2072) Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ShellPkg: Apply uncrustify changesMichael Kubacki2021-12-0733-1837/+1974
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the ShellPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* ShellPkg: Add comment that ItemPtr is set after validationChris Jones2021-11-091-1/+3
| | | | | | | | | Add a comment to clarify that in Acpiview the ItemPtr is not set until after the FieldValidator has been called. Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: Parse I/O APIC and x2APIC structureAbdul Lateef Attar2021-10-211-0/+99
| | | | | | | | | | | Parse and print the below interrupt structures - I/O APIC Structure - Interrupt Source Override Structure - Processor Local x2APIC Structure - Local x2APIC NMI Structure Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: Update Acpiview HMAT parser to ACPI spec version 6.4Chris Jones2021-10-082-10/+11
| | | | | | | | | | | | | Add parser support for the new "MinTransferSize" field of the System Locality, Latency and Bandwidth structure, introduced by the ACPI specification version 6.4. Also update the HMAT parser to use the newer ACPI version 6.4 definitions. Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Zhichao Gao <zhcihao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ShellPkg: Add Type 5 PCC Subspace Structure parserChris Jones2021-10-061-3/+55
| | | | | | | | | | | | Bugzilla: 3563 (https://bugzilla.tianocore.org/show_bug.cgi?id=3563) Update the Acpiview PCCT parser with the HW Registers based Communications Subspace Structure (Type 5) as defined in Section 14.1.7 of the ACPI 6.4 specification. Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar <sami.mujawar@arm.com>
* ShellPkg: Update Acpiview PCCT parser to ACPI 6.4Chris Jones2021-10-062-25/+25
| | | | | | | | | | Bugzilla: 3563 (https://bugzilla.tianocore.org/show_bug.cgi?id=3563) Update the Acpiview PCCT parser to use Acpi64.h. Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar <sami.mujawar@arm.com>
* ShellPkg: Update Acpiview GTDT parser to ACPI 6.4Chris Jones2021-10-052-8/+8
| | | | | | | | | | | Bugzilla: 3565 (https://bugzilla.tianocore.org/show_bug.cgi?id=3565) Update the Acpiview GTDT parser to use Acpi64.h and as such rename all occurences of "SBSA Generic Watchdog" to "Arm Generic Watchdog". Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ShellPkg: Rename Address Size to Access sizeJoey Gouly2021-04-191-2/+2
| | | | | | | | This matches the ACPI spec 6.3, table 5.1: Generic Address Structure. Signed-off-by: Joey Gouly <joey.gouly@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ShellPkg/AcpiView: HMAT ParserMarc Moisson-Franckhauser2021-02-035-0/+679
| | | | | | | | | | | | | | | | | Bugzilla: 3045 (https://bugzilla.tianocore.org/show_bug.cgi?id=3045) Add a new parser for the Heterogeneous Memory Attribute Table. The parser also validates some fields for this table. The HMAT table is used to describe the memory attributes such as memory side cache attributes and bandwidth and latency details related to memory proximity domains. The info in the HMAT table can be used by an operating system for optimisation. Signed-off-by: Marc Moisson-Franckhauser <marc.moisson-franckhauser@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Tested-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/Acpiview: AEST ParserMarc Moisson-Franckhauser2021-01-085-1/+781
| | | | | | | | | | | | | | | | | Bugzilla: 3048 (https://bugzilla.tianocore.org/show_bug.cgi?id=3048) Add a new parser for the Arm Error Source Table (AEST) described in the ACPI for the Armv8 RAS Extensions 1.1 Platform Design Document, dated 28 September 2020. (https://developer.arm.com/documentation/den0085/0101/) AEST enables kernel-first handling of errors in a system that supports the Armv8 RAS extensions. It covers Armv8.2+ RAS extensions for PEs and the RAS system architecture for non-PE system components. Signed-off-by: Marc Moisson-Franckhauser <marc.moisson-franckhauser@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/AcpiView: PCCT ParserMarc Moisson-Franckhauser2020-12-116-5/+679
| | | | | | | | | | | | | | | | | | | | Bugzilla: 3047 (https://bugzilla.tianocore.org/show_bug.cgi?id=3047) Create a new parser for the PCCT Table. The PCCT Table is used to describe how the OSPM can communicate with entities outside the platform. It describes which memory spaces correspond to which entity as well as a few of the needed information to handle the communications. This new PCCT parser dumps the values and names of the table fields. It also performs some validation on the table's fields. Signed-off-by: Marc Moisson-Franckhauser <marc.moisson-franckhauser@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/AcpiView: Fix field validator invocationSami Mujawar2020-12-111-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | Bugzilla: 3046 (https://bugzilla.tianocore.org/show_bug.cgi?id=3046) The field validator function provides means to validate fields in the ACPI table structures. To print complex field types a print formatter function is provided. The field validator was being invoked for simple data fields for which the default print format is used. However, the field validator function was not invoked if a print formatter function was provided. This problem is noticed when a Generic Address Structure (GAS) is printed using DumpGas() and a field validator is present to validate the GAS structure. To fix this move the invocation of the field validator after the field is printed such that the validation function is called even when a print formatter function is present. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: Add AcpiViewCommandLibTomas Pilar2020-06-304-49/+3
| | | | | | | | | | | | | | | The UefiShellAcpiViewCommandLib is converted from NULL library to a named library so that it may be used in modules other than shell. The library interface exposes the main method for to AcpiView functionality as well as a helper method to dump a buffer to a file. The Shell module is still built by pulling UefiShellAcpiViewCommandLib as a NULL library to preserve the modularity of shell builds. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
* ShellPkg/AcpiView: Refactor DumpAcpiTableToFileTomas Pilar2020-06-303-38/+76
| | | | | | | | | | | | | | Method is refactored into two parts. A new method is created that dumps arbitrary buffers into a newly created file. This method is called from core code after the core code determined the appropriate filename to be used. This improves the modular design. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
* ShellPkg/AcpiView: Move parameter parsingTomas Pilar2020-06-304-211/+240
| | | | | | | | | | | Parsing command line parameters is done in the shell command wrapper. This declutters the core code and improves modular design. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
* ShellPkg/AcpiView: Move table count resetTomas Pilar2020-06-301-3/+5
| | | | | | | | | | | The table count module level symbols are now reset when executing the core method, rather than the shell command wrapper. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
* ShellPkg/AcpiView: Refactor configurationTomas Pilar2020-06-3012-315/+479
| | | | | | | | | | | | | | A new file and header (AcpiViewConfig.[ch]) is created that houses the user configuration. This declutters the core code and improves modularity of the design. The module level symbols for verbosity, table selection, and highlighting are refactored into the new file. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
* ShellPkg/AcpiView: Move log reset to main methodTomas Pilar2020-06-301-4/+4
| | | | | | | | | | The error and warning counters are reset in the AcpiView main method. This improves reusability of the main method. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
* ShellPkg: acpiview: Check if SBBR mandatory ACPI tables are installedKrzysztof Koch2020-05-062-0/+38
| | | | | | | | | | | | | | | | | | | | | For Arm-based platforms, count the instances of installed tables for each ACPI table listed as 'mandatory' in any Server Base Boot Requirements (SBBR) specification. Validate that the all the mandatory SBBR tables present. Report an error for each missing table. This new feature is optional and can be enabled with the -r command line parameter. Reference(s): - Arm Server Base Boot Requirements 1.2, September 2019 - Arm Server Base Boot Requirements 1.1, May 2018 - Arm Server Base Boot Requirements 1.0, March 2016 Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <Sami.Mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: acpiview: Add library for SBBR ACPI requirements validationKrzysztof Koch2020-05-063-1/+318
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For Arm-based platforms, define and implement an interface for Server Base Boot Requirements (SBBR) compliance checks. The library is responsible for validating that all mandatory ACPI tables are installed on the platform. Internally, the library maintains a data structure which tracks instance counts for ACPI tables which are labeled as 'mandatory' in any SBBR specification version. The provided interface allows: - resetting all instance counts to 0 - incremementing the instance count for a table with a given signature - validating the instance counts against the requirements in SBBR The ACPI table requirements for each SBBR spec version are represented internally as a list of table signatures. Every missing mandatory table (for the input SBBR version) is reported to the user as a separate error. If all requirements are met, an info message is displayed. Reference(s): - Arm Server Base Boot Requirements 1.2, September 2019 - Arm Server Base Boot Requirements 1.1, May 2018 - Arm Server Base Boot Requirements 1.0, March 2016 Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <Sami.Mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: acpiview: Add -r parameter for table requirements validationKrzysztof Koch2020-05-063-4/+136
| | | | | | | | | | | | | | | | | | | | | | | Define a new command line parameter '-r' to enable checking if all mandatory ACPI tables listed in a specification are present. The -r parameter takes an integer value to specify which specification the validation should be performed against. The parameter is used to set two Acpiview variables. An interface to access these variables is implemented in this patch. The new functionality is aimed at Arm-based platforms, however, there are no restriction on extending it to other architectures. For the 32-bit and 64-bit Arm architectures, the possible values for the -r parameter are: 0: Arm Server Base Boot Requirements 1.0, March 2016 1: Arm Server Base Boot Requirements 1.1, May 2018 2: Arm Server Base Boot Requirements 1.2, September 2019 Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <Sami.Mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: acpiview: Prevent infinite loop if structure length is 0Krzysztof Koch2020-02-206-52/+47
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2534 Extend validation of ACPI structure lengths which are read from the ACPI table being parsed. Additionally check if the structure 'Length' field value is positive. If not, stop parsing the faulting table. Some ACPI tables define internal structures of variable size. The 'Length' field inside the substructure is used to update a pointer used for table traversal. If the byte-length of the structure is equal to 0, acpiview can enter an infinite loop. This condition can occur if, for example, the zero-allocated ACPI table buffer is not fully populated. This is typically a bug on the ACPI table writer side. In short, this method helps acpiview recover gracefully from a zero-valued ACPI structure length. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: acpiview: Validate ACPI table 'Length' fieldKrzysztof Koch2020-02-191-1/+19
| | | | | | | | | | | | Check if the ACPI table length, as reported in the ACPI table header, is big enough to fit at least the header itself. If not, report an error to the user and stop parsing the table in order to prevent buffer overruns. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: acpiview: Remove duplicate ACPI structure size definitionsKrzysztof Koch2020-02-192-25/+5
| | | | | | | | | | | | | | | | | | | | Remove duplicate Generic Address Structure (GAS) and ACPI table header size definitions. Replace any dependencies with the definitions from Acpi63.h. AcpiParser.h redefines the size of Generic Address Structure (GAS) and the ACPI table header. The motivation is to 'minimise any reference to the EDK2 ACPI headers in an attempt to provide cross checking'. While the redefined values are unlikely to change, redefinition causes unnecessary maintenance overhead for acpiview. In addition to this, EDK2 ACPI headers are referenced throughout the entire project, so the assumption should be that the definitions in these header files are correct. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: acpiview: DBG2: Validate global pointers before useKrzysztof Koch2020-02-111-0/+43
| | | | | | | Check if global (in the scope of the DBG2 parser) pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: GTDT: Validate global pointers before useKrzysztof Koch2020-02-111-0/+37
| | | | | | | Check if global (in the scope of the GTDT parser) pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: IORT: Validate global pointers before useKrzysztof Koch2020-02-111-0/+52
| | | | | | | Check if global (in the scope of the IORT parser) pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: PPTT: Validate global pointers before useKrzysztof Koch2020-02-111-0/+25
| | | | | | | | Check if the NumberOfPrivateResources, ProcessorTopologyStructureType and ProcessorTopologyStructureLength pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: MADT: Validate global pointers before useKrzysztof Koch2020-02-111-0/+13
| | | | | | | | Check if the MadtInterruptControllerType and MadtInterruptControllerLength pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: SRAT: Validate global pointers before useKrzysztof Koch2020-02-111-0/+13
| | | | | | | Check if SratRAType and SratRALength pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: SLIT: Validate System Locality countKrzysztof Koch2020-02-111-5/+42
| | | | | | | | | | | | | | | 1. Check if the 'Number of System Localities' provided can be represented in the SLIT table. The table 'Length' field is a 32-bit value while the 'Number of System Localities' field is 64-bit long. 2. Check if the SLIT matrix fits in the table buffer. If N is the SLIT locality count, then the matrix used to represent the localities is N*N bytes long. The ACPI table length must be big enough to fit the matrix. 3. Remove (now) redundant 64x64 bit multiplication. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: SLIT: Validate global pointer before useKrzysztof Koch2020-02-111-2/+14
| | | | | | | Check if SlitSystemLocalityCount pointer has been successfully updated before it is used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: FADT: Validate global pointer before useKrzysztof Koch2020-02-111-10/+11
| | | | | | | Check if global pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>