summaryrefslogtreecommitdiffstats
path: root/ShellPkg
Commit message (Collapse)AuthorAgeFilesLines
* ShellPkg: Fix smbiosview system enclosure type tableRebecca Cran2021-04-121-4/+4
| | | | | | | | | | The SystemEnclosureTypeTable in QueryTable.c contained a couple of errors: value 0x10 is "Lunch Box" not "Main Server Chassis", and the Sub Notebook value was repeated as 0x13 when that entry is for "SubChassis". The entries in-between needed adjusted. Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: Consume MdeLibs.dsc.inc for RegisterFilterLibDandan Bi2021-03-311-1/+3
| | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246 MdeLibs.dsc.inc was added for some basic/default library instances provided by MdePkg and RegisterFilterLibNull Library was also added into it as the first version of MdeLibs.dsc.inc. So update platform dsc to consume MdeLibs.dsc.inc for RegisterFilterLibNull which will be consumed by IoLib and BaseLib. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* ShellPkg/UefiHandleParsingLib: Support EFI Redfish protocolsAbner Chang2021-03-263-3/+13
| | | | | | | | | | | | | | Add handle parsing for EFI Redfish Discover protocol. Add handle parsing for EFI RestEx protocol. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Nickle Wang <nickle.wang@hpe.com> Cc: Peter O'Hanley <peter.ohanley@hpe.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* ShellPkg/Pci: Add valid check for PCI extended config space parserVincentX Ke2021-03-221-2/+8
| | | | | | | | | | Bugzilla: 3262 (https://bugzilla.tianocore.org/show_bug.cgi?id=3262) No need to print PCIe details while CapabilityId is 0xFFFF. Limit the NextCapabilityOffset to PCI configuration space. Signed-off-by: VincentX Ke <vincentx.ke@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/SmbiosView: add more items for smbiosview -t 3Mars CC Lin2021-03-182-0/+17
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3177 Add ContainedElementCount, ContainedElementRecordLength and ContainedElements for smbiosview type 3. Signed-off-by: Mars CC Lin <mars_cc_lin@phoenix.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Philippe Mathieu-Daude <philmd@redhat.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Zhichao Gao <zhichao.gao@intel.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/ShellProtocol: sort files by FullName in RemoveDupInFileList()Laszlo Ersek2021-01-191-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of EfiShellRemoveDupInFileList(): - has quadratic time complexity, as a disadvantage, and - needs no dynamic memory, as an advantage. Because the UEFI Shell Spec requires EFI_SHELL_PROTOCOL.RemoveDupInFileList() to succeed at all times, keep the current method as a fallback (it cannot fail due to needing no dynamic memory). However, as a higher priority option, call the new ShellSortFileList() function at first, separating out and releasing duplicates. (ShellSortFileList() can fail due to EFI_OUT_OF_RESOURCES.) Beyond improving the runtime of EfiShellRemoveDupInFileList(), this change has the extremely desirable effect that the ShellOpenFileMetaArg() function in the ShellPkg/Library/UefiShellLib instance will produce file lists that are sorted by FullName. Consequently, when used with wildcards, the ATTRIB, CP, FOR, LOAD, LOADPCIROM, LS, MV, RM, TOUCH, TYPE commands will process files in FullName order. (LS in recursive mode uses wildcards internally.) Before: > FS2:\> dir -r -sfo apps > [...] > FileInfo,"FS2:\apps\" > FileInfo,"FS2:\apps\X64" > FileInfo,"FS2:\apps\AARCH64" > FileInfo,"FS2:\" > FileInfo,"FS2:\apps\IA32" > FileInfo,"FS2:\apps\X64\DumpDynPcd.efi" > FileInfo,"FS2:\apps\X64\SmiHandlerProfileInfo.efi" > FileInfo,"FS2:\apps\X64\" > FileInfo,"FS2:\apps\X64\VariableInfo.efi" > FileInfo,"FS2:\apps\X64\MemoryProfileInfo.efi" > FileInfo,"FS2:\apps\X64\AcpiViewApp.efi" > FileInfo,"FS2:\apps\X64\Cpuid.efi" > FileInfo,"FS2:\apps\" > FileInfo,"FS2:\apps\AARCH64\DumpDynPcd.efi" > FileInfo,"FS2:\apps\AARCH64\" > FileInfo,"FS2:\apps\AARCH64\VariableInfo.efi" > FileInfo,"FS2:\apps\AARCH64\MemoryProfileInfo.efi" > FileInfo,"FS2:\apps\AARCH64\AcpiViewApp.efi" > FileInfo,"FS2:\apps\" > FileInfo,"FS2:\apps\IA32\DumpDynPcd.efi" > FileInfo,"FS2:\apps\IA32\SmiHandlerProfileInfo.efi" > FileInfo,"FS2:\apps\IA32\" > FileInfo,"FS2:\apps\IA32\VariableInfo.efi" > FileInfo,"FS2:\apps\IA32\MemoryProfileInfo.efi" > FileInfo,"FS2:\apps\IA32\AcpiViewApp.efi" > FileInfo,"FS2:\apps\IA32\Cpuid.efi" > FileInfo,"FS2:\apps\" After: > FS2:\> dir -r -sfo apps > [...] > FileInfo,"FS2:\" > FileInfo,"FS2:\apps\" > FileInfo,"FS2:\apps\AARCH64" > FileInfo,"FS2:\apps\IA32" > FileInfo,"FS2:\apps\X64" > FileInfo,"FS2:\apps\" > FileInfo,"FS2:\apps\AARCH64\" > FileInfo,"FS2:\apps\AARCH64\AcpiViewApp.efi" > FileInfo,"FS2:\apps\AARCH64\DumpDynPcd.efi" > FileInfo,"FS2:\apps\AARCH64\MemoryProfileInfo.efi" > FileInfo,"FS2:\apps\AARCH64\VariableInfo.efi" > FileInfo,"FS2:\apps\" > FileInfo,"FS2:\apps\IA32\" > FileInfo,"FS2:\apps\IA32\AcpiViewApp.efi" > FileInfo,"FS2:\apps\IA32\Cpuid.efi" > FileInfo,"FS2:\apps\IA32\DumpDynPcd.efi" > FileInfo,"FS2:\apps\IA32\MemoryProfileInfo.efi" > FileInfo,"FS2:\apps\IA32\SmiHandlerProfileInfo.efi" > FileInfo,"FS2:\apps\IA32\VariableInfo.efi" > FileInfo,"FS2:\apps\" > FileInfo,"FS2:\apps\X64\" > FileInfo,"FS2:\apps\X64\AcpiViewApp.efi" > FileInfo,"FS2:\apps\X64\Cpuid.efi" > FileInfo,"FS2:\apps\X64\DumpDynPcd.efi" > FileInfo,"FS2:\apps\X64\MemoryProfileInfo.efi" > FileInfo,"FS2:\apps\X64\SmiHandlerProfileInfo.efi" > FileInfo,"FS2:\apps\X64\VariableInfo.efi" Regarding LS in non-SFO mode, the stability of ShellSortFileList() shows. The ShellSortFileList() call added to LS in the previous patch re-sorts the output of ShellOpenFileMetaArg(); and so this patch improves the ordering between identical FileNames: Before: > FS2:\> dir -r apps > Directory of: FS2:\apps\ > 01/01/1970 01:00 <DIR> r 0 . > 01/01/1970 01:00 <DIR> r 0 .. > 12/22/2020 17:53 <DIR> 4,096 AARCH64 > 12/22/2020 17:53 <DIR> 4,096 IA32 > 12/22/2020 17:53 <DIR> 4,096 X64 > 0 File(s) 0 bytes > 5 Dir(s) > Directory of: FS2:\apps\X64\ > 01/01/1970 01:00 <DIR> r 0 . > 01/01/1970 01:00 <DIR> r 0 .. > 12/22/2020 17:53 126,656 AcpiViewApp.efi > 12/22/2020 17:53 38,784 Cpuid.efi > 12/22/2020 17:52 18,752 DumpDynPcd.efi > 12/22/2020 17:52 26,304 MemoryProfileInfo.efi > 12/22/2020 17:52 34,240 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 11,456 VariableInfo.efi > 6 File(s) 256,192 bytes > 2 Dir(s) > Directory of: FS2:\apps\AARCH64\ > 01/01/1970 01:00 <DIR> r 0 . > 01/01/1970 01:00 <DIR> r 0 .. > 12/22/2020 17:53 139,264 AcpiViewApp.efi > 12/22/2020 17:52 32,768 DumpDynPcd.efi > 12/22/2020 17:52 40,960 MemoryProfileInfo.efi > 12/22/2020 17:52 20,480 VariableInfo.efi > 4 File(s) 233,472 bytes > 2 Dir(s) > Directory of: FS2:\apps\IA32\ > 01/01/1970 01:00 <DIR> r 0 . > 01/01/1970 01:00 <DIR> r 0 .. > 12/22/2020 17:53 105,536 AcpiViewApp.efi > 12/22/2020 17:53 36,096 Cpuid.efi > 12/22/2020 17:52 17,344 DumpDynPcd.efi > 12/22/2020 17:52 24,192 MemoryProfileInfo.efi > 12/22/2020 17:52 30,720 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 10,880 VariableInfo.efi > 6 File(s) 224,768 bytes > 2 Dir(s) > > FS2:\> dir apps\*\*.efi > Directory of: FS2:\apps\*\ > 12/22/2020 17:53 126,656 AcpiViewApp.efi > 12/22/2020 17:53 139,264 AcpiViewApp.efi > 12/22/2020 17:53 105,536 AcpiViewApp.efi > 12/22/2020 17:53 38,784 Cpuid.efi > 12/22/2020 17:53 36,096 Cpuid.efi > 12/22/2020 17:52 18,752 DumpDynPcd.efi > 12/22/2020 17:52 32,768 DumpDynPcd.efi > 12/22/2020 17:52 17,344 DumpDynPcd.efi > 12/22/2020 17:52 26,304 MemoryProfileInfo.efi > 12/22/2020 17:52 40,960 MemoryProfileInfo.efi > 12/22/2020 17:52 24,192 MemoryProfileInfo.efi > 12/22/2020 17:52 34,240 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 30,720 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 11,456 VariableInfo.efi > 12/22/2020 17:52 20,480 VariableInfo.efi > 12/22/2020 17:52 10,880 VariableInfo.efi > 16 File(s) 714,432 bytes > 0 Dir(s) After: > FS2:\> dir -r apps > Directory of: FS2:\apps\ > 01/01/1970 01:00 <DIR> r 0 . > 01/01/1970 01:00 <DIR> r 0 .. > 12/22/2020 17:53 <DIR> 4,096 AARCH64 > 12/22/2020 17:53 <DIR> 4,096 IA32 > 12/22/2020 17:53 <DIR> 4,096 X64 > 0 File(s) 0 bytes > 5 Dir(s) > Directory of: FS2:\apps\AARCH64\ > 01/01/1970 01:00 <DIR> r 0 . > 01/01/1970 01:00 <DIR> r 0 .. > 12/22/2020 17:53 139,264 AcpiViewApp.efi > 12/22/2020 17:52 32,768 DumpDynPcd.efi > 12/22/2020 17:52 40,960 MemoryProfileInfo.efi > 12/22/2020 17:52 20,480 VariableInfo.efi > 4 File(s) 233,472 bytes > 2 Dir(s) > Directory of: FS2:\apps\IA32\ > 01/01/1970 01:00 <DIR> r 0 . > 01/01/1970 01:00 <DIR> r 0 .. > 12/22/2020 17:53 105,536 AcpiViewApp.efi > 12/22/2020 17:53 36,096 Cpuid.efi > 12/22/2020 17:52 17,344 DumpDynPcd.efi > 12/22/2020 17:52 24,192 MemoryProfileInfo.efi > 12/22/2020 17:52 30,720 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 10,880 VariableInfo.efi > 6 File(s) 224,768 bytes > 2 Dir(s) > Directory of: FS2:\apps\X64\ > 01/01/1970 01:00 <DIR> r 0 . > 01/01/1970 01:00 <DIR> r 0 .. > 12/22/2020 17:53 126,656 AcpiViewApp.efi > 12/22/2020 17:53 38,784 Cpuid.efi > 12/22/2020 17:52 18,752 DumpDynPcd.efi > 12/22/2020 17:52 26,304 MemoryProfileInfo.efi > 12/22/2020 17:52 34,240 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 11,456 VariableInfo.efi > 6 File(s) 256,192 bytes > 2 Dir(s) > > FS2:\> dir apps\*\*.efi > Directory of: FS2:\apps\*\ > 12/22/2020 17:53 139,264 AcpiViewApp.efi > 12/22/2020 17:53 105,536 AcpiViewApp.efi > 12/22/2020 17:53 126,656 AcpiViewApp.efi > 12/22/2020 17:53 36,096 Cpuid.efi > 12/22/2020 17:53 38,784 Cpuid.efi > 12/22/2020 17:52 32,768 DumpDynPcd.efi > 12/22/2020 17:52 17,344 DumpDynPcd.efi > 12/22/2020 17:52 18,752 DumpDynPcd.efi > 12/22/2020 17:52 40,960 MemoryProfileInfo.efi > 12/22/2020 17:52 24,192 MemoryProfileInfo.efi > 12/22/2020 17:52 26,304 MemoryProfileInfo.efi > 12/22/2020 17:52 30,720 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 34,240 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 20,480 VariableInfo.efi > 12/22/2020 17:52 10,880 VariableInfo.efi > 12/22/2020 17:52 11,456 VariableInfo.efi > 16 File(s) 714,432 bytes > 0 Dir(s) Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3151 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Message-Id: <20210113085453.10168-9-lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* ShellPkg/Ls: sort output by FileName in non-SFO modeLaszlo Ersek2021-01-191-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sorting the LS output in non-SFO mode by FileName is best demonstrated with two examples. (1a) Before: > FS2:\> dir -r apps > Directory of: FS2:\apps\ > 01/01/1970 01:00 <DIR> r 0 . > 12/22/2020 17:53 <DIR> 4,096 X64 > 12/22/2020 17:53 <DIR> 4,096 AARCH64 > 01/01/1970 01:00 <DIR> r 0 .. > 12/22/2020 17:53 <DIR> 4,096 IA32 > 0 File(s) 0 bytes > 5 Dir(s) > Directory of: FS2:\apps\X64\ > 12/22/2020 17:52 18,752 DumpDynPcd.efi > 12/22/2020 17:52 34,240 SmiHandlerProfileInfo.efi > 01/01/1970 01:00 <DIR> r 0 . > 12/22/2020 17:52 11,456 VariableInfo.efi > 12/22/2020 17:52 26,304 MemoryProfileInfo.efi > 12/22/2020 17:53 126,656 AcpiViewApp.efi > 12/22/2020 17:53 38,784 Cpuid.efi > 01/01/1970 01:00 <DIR> r 0 .. > 6 File(s) 256,192 bytes > 2 Dir(s) > Directory of: FS2:\apps\AARCH64\ > 12/22/2020 17:52 32,768 DumpDynPcd.efi > 01/01/1970 01:00 <DIR> r 0 . > 12/22/2020 17:52 20,480 VariableInfo.efi > 12/22/2020 17:52 40,960 MemoryProfileInfo.efi > 12/22/2020 17:53 139,264 AcpiViewApp.efi > 01/01/1970 01:00 <DIR> r 0 .. > 4 File(s) 233,472 bytes > 2 Dir(s) > Directory of: FS2:\apps\IA32\ > 12/22/2020 17:52 17,344 DumpDynPcd.efi > 12/22/2020 17:52 30,720 SmiHandlerProfileInfo.efi > 01/01/1970 01:00 <DIR> r 0 . > 12/22/2020 17:52 10,880 VariableInfo.efi > 12/22/2020 17:52 24,192 MemoryProfileInfo.efi > 12/22/2020 17:53 105,536 AcpiViewApp.efi > 12/22/2020 17:53 36,096 Cpuid.efi > 01/01/1970 01:00 <DIR> r 0 .. > 6 File(s) 224,768 bytes > 2 Dir(s) (1b) After: > FS2:\> dir -r apps > Directory of: FS2:\apps\ > 01/01/1970 01:00 <DIR> r 0 . > 01/01/1970 01:00 <DIR> r 0 .. > 12/22/2020 17:53 <DIR> 4,096 AARCH64 > 12/22/2020 17:53 <DIR> 4,096 IA32 > 12/22/2020 17:53 <DIR> 4,096 X64 > 0 File(s) 0 bytes > 5 Dir(s) > Directory of: FS2:\apps\X64\ > 01/01/1970 01:00 <DIR> r 0 . > 01/01/1970 01:00 <DIR> r 0 .. > 12/22/2020 17:53 126,656 AcpiViewApp.efi > 12/22/2020 17:53 38,784 Cpuid.efi > 12/22/2020 17:52 18,752 DumpDynPcd.efi > 12/22/2020 17:52 26,304 MemoryProfileInfo.efi > 12/22/2020 17:52 34,240 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 11,456 VariableInfo.efi > 6 File(s) 256,192 bytes > 2 Dir(s) > Directory of: FS2:\apps\AARCH64\ > 01/01/1970 01:00 <DIR> r 0 . > 01/01/1970 01:00 <DIR> r 0 .. > 12/22/2020 17:53 139,264 AcpiViewApp.efi > 12/22/2020 17:52 32,768 DumpDynPcd.efi > 12/22/2020 17:52 40,960 MemoryProfileInfo.efi > 12/22/2020 17:52 20,480 VariableInfo.efi > 4 File(s) 233,472 bytes > 2 Dir(s) > Directory of: FS2:\apps\IA32\ > 01/01/1970 01:00 <DIR> r 0 . > 01/01/1970 01:00 <DIR> r 0 .. > 12/22/2020 17:53 105,536 AcpiViewApp.efi > 12/22/2020 17:53 36,096 Cpuid.efi > 12/22/2020 17:52 17,344 DumpDynPcd.efi > 12/22/2020 17:52 24,192 MemoryProfileInfo.efi > 12/22/2020 17:52 30,720 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 10,880 VariableInfo.efi > 6 File(s) 224,768 bytes > 2 Dir(s) (2a) Before: > FS2:\> dir apps\*\*.efi > Directory of: FS2:\apps\*\ > 12/22/2020 17:52 18,752 DumpDynPcd.efi > 12/22/2020 17:52 34,240 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 11,456 VariableInfo.efi > 12/22/2020 17:52 26,304 MemoryProfileInfo.efi > 12/22/2020 17:53 126,656 AcpiViewApp.efi > 12/22/2020 17:53 38,784 Cpuid.efi > 12/22/2020 17:52 32,768 DumpDynPcd.efi > 12/22/2020 17:52 20,480 VariableInfo.efi > 12/22/2020 17:52 40,960 MemoryProfileInfo.efi > 12/22/2020 17:53 139,264 AcpiViewApp.efi > 12/22/2020 17:52 17,344 DumpDynPcd.efi > 12/22/2020 17:52 30,720 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 10,880 VariableInfo.efi > 12/22/2020 17:52 24,192 MemoryProfileInfo.efi > 12/22/2020 17:53 105,536 AcpiViewApp.efi > 12/22/2020 17:53 36,096 Cpuid.efi > 16 File(s) 714,432 bytes > 0 Dir(s) (2b) After: > FS2:\> dir apps\*\*.efi > Directory of: FS2:\apps\*\ > 12/22/2020 17:53 126,656 AcpiViewApp.efi > 12/22/2020 17:53 139,264 AcpiViewApp.efi > 12/22/2020 17:53 105,536 AcpiViewApp.efi > 12/22/2020 17:53 38,784 Cpuid.efi > 12/22/2020 17:53 36,096 Cpuid.efi > 12/22/2020 17:52 18,752 DumpDynPcd.efi > 12/22/2020 17:52 32,768 DumpDynPcd.efi > 12/22/2020 17:52 17,344 DumpDynPcd.efi > 12/22/2020 17:52 26,304 MemoryProfileInfo.efi > 12/22/2020 17:52 40,960 MemoryProfileInfo.efi > 12/22/2020 17:52 24,192 MemoryProfileInfo.efi > 12/22/2020 17:52 34,240 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 30,720 SmiHandlerProfileInfo.efi > 12/22/2020 17:52 11,456 VariableInfo.efi > 12/22/2020 17:52 20,480 VariableInfo.efi > 12/22/2020 17:52 10,880 VariableInfo.efi > 16 File(s) 714,432 bytes > 0 Dir(s) (In example (2), note that the sorting is stable; that is, whatever order is established between identical FileNames by ShellOpenFileMetaArg(), it is preserved by ShellSortFileList().) Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3151 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Message-Id: <20210113085453.10168-8-lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* ShellPkg/ShellCommandLib: add ShellSortFileList()Laszlo Ersek2021-01-195-0/+414
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce the ShellSortFileList() function, for sorting an EFI_SHELL_FILE_INFO list, by FileName or by FullName. Duplicates can be kept in the same list, or separated out to a new list. In either case, the relative order between duplicates does not change (the sorting is stable). For the sorting, use OrderedCollectionLib rather than SortLib: - The PerformQuickSort() function from the latter has quadratic worst-case time complexity, plus it is implemented recursively (see "MdeModulePkg/Library/UefiSortLib/UefiSortLib.c"). It can also not return an error on memory allocation failure. - In comparison, the Red-Black Tree instance of OrderedCollectionLib sorts in O(n*log(n)) worst-case time, contains no recursion with the default PcdValidateOrderedCollection=FALSE setting, and the OrderedCollectionLib class APIs return errors appropriately. The OrderedCollectionLib APIs do not permit duplicates natively, but by using lists as collection entries, stable sorting of duplicates can be achieved. Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3151 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Message-Id: <20210113085453.10168-7-lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* ShellPkg/Comp: add file bufferingLaszlo Ersek2021-01-192-3/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The COMP shell command compares two files byte for byte. In order to retrieve the bytes to compare, it currently invokes gEfiShellProtocol->ReadFile() on both files, using a single-byte buffer every time. This is very inefficient; the underlying EFI_FILE_PROTOCOL.Read() function may be costly. Read both file operands in chunks of "PcdShellFileOperationSize" bytes. Draw bytes for comparison from the internal read-ahead buffers. Some ad-hoc measurements on my laptop, using OVMF, and the 4KB default of "PcdShellFileOperationSize": - When comparing two identical 1MB files that are served by EnhancedFatDxe on top of VirtioScsiDxe, this patch brings no noticeable improvement; the comparison completes in <1s both before and after. - When comparing two identical 1MB files served by VirtioFsDxe, the comparison time improves from 2 minutes 25 seconds to <1s. Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3123 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Message-Id: <20210113085453.10168-2-lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* ShellPkg: Remove bogus "Bits" text from some smbiosview strings.Rebecca Cran2021-01-112-3/+3
| | | | | | | | | | | | Neither of the "CPU Socket Unpopulated" or "Do not reboot" messages should contain the word "Bits". Remove them and update the identifier for the "Do not reboot" message to remove the word "BITS". Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.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>
* MdePkg: Define structures for Resizable BAR CapabilityLuo, Heng2021-01-041-3/+3
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3138 Define structures for Resizable BAR Capability in MdePkg/Include/IndustryStandard/PciExpress21.h, Change ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c to use new structures. Cc: Ray Ni <ray.ni@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Heng Luo <heng.luo@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Liming Gao <liming.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>
* MdePkg,ShellPkg: Fix typo in SMBIOS_TABLE_TYPE17 field FirmwareVersionRebecca Cran2020-12-101-1/+1
| | | | | | | | "FirmwareVersion" was misspelled "FirwareVersion". Also, update SmbiosView PrintInfo.c to use the new field name. Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdePkg,ShellPkg: Fix typo in SMBIOS_TABLE_TYPE4 field ProcessorManufacturerRebecca Cran2020-12-101-1/+1
| | | | | | | | | | In SmBios.h, the SMBIOS_TABLE_TYPE4 field "ProcessorManufacture" should be "ProcessorManufacturer". Also, update SmbiosView PrintInfo.c to use the new field name. Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* ShellPkg:Fix bug in FileBuffer.cEnze Zhu2020-11-061-0/+2
| | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2998 In the function FileBufferCutLine(),set the CutLine pointer to NULL, The function header specifies that the pointer is valid on a successful or failed return code. Signed-off-by: Enze Zhu <zhuenze@byosoft.com.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: Add ARM64 SoC ID to Processor Characteristics in smbiosviewRebecca Cran2020-10-301-0/+4
| | | | | | | | | | SMBIOS 3.4.0 defines bit 9 of the Type 4 table Processor Characteristics field to be the ARM64 SoC ID support. Add support for it to the smbiosview command. Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* ShellPkg: Fix smbiosview string definition name for "boot from CD"Rebecca Cran2020-10-302-2/+2
| | | | | | | | | The "boot from CD supported" string definition name should contain the word "from" instead of "form". Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* ShellPkg: Fix a couple of typos in smbiosviewRebecca Cran2020-10-301-2/+2
| | | | | | | | | | Fix a couple of typos in SmbiosViewStrings.uni: "Boot form CD" should be "Boot from CD", and "plugged from the wall" should be "plugged into the wall". Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* ShellPkg/SmbiosView: Add DDR5 supportGao, Zhichao2020-10-141-0/+8
| | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2352 Refer to SMBIOS 3.4 spec, add new memory device type - DDR5 and LPDDR5 support for the shell command "smbiosview". Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* ShellPkg/DynamicCommand: add HttpDynamicCommandVladimir Olovyannikov2020-09-3010-0/+2441
| | | | | | | | | | | | | | | | | | | | | | | | | | Introduce an http client utilizing EDK2 HTTP protocol, to allow fast image downloading from http/https servers. HTTP download speed is usually faster than tftp. The client is based on the same approach as tftp dynamic command, and uses the same UEFI Shell command line parameters. This makes it easy integrating http into existing UEFI Shell scripts. Note that to enable HTTP download, feature Pcd gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections must be set to TRUE. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2860 Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Nd <nd@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* ShellPkg: Fix spelling mistake for occurredMichael D Kinney2020-08-1923-93/+93
| | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2361 Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Guomin Jiang <guomin.jiang@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/ShellPkg.ci.yaml: Add configuration for Ecc checkShenglei Zhang2020-08-171-0/+12
| | | | | | | | | | | Add configuration ExceptionList and IgnoreFiles for package config files. So users can rely on this to ignore some Ecc issues. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Acked-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* ShellPkg: smbiosview - Change some type 17 field values formatSamer El-Haj-Mahmoud2020-08-071-7/+7
| | | | | | | | | | | | | | | | | Change how some SMBIOS TYpe 17 field values are printed: - TotalWidth, DataWidth, ConfiguredMemoryClockSpeed: Print as hex values instead of decimal, since there are some special meanings for certain values (e.g. 0xFFFF) - VolatileSize, NonVolatileSize, CacheSize, and LogicalSize: Print as "0x%lx" instead of "0x%x" to prevent truncating output when printing these QWORD fields. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Sami Mujawar <Sami.Mujawar@arm.com> Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/ShellPkg.ci.yaml: Add configuration for LicenseCheckShenglei Zhang2020-07-311-0/+3
| | | | | | | | | | | Add configuration IgnoreFiles for package config files. So users can rely on this to skip license conflict for some generated files. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/AcpiView: Add application wrapperTomas Pilar2020-06-304-0/+197
| | | | | | | | | | | | | | | | | | | Simple application wrapper that invokes the shell command wrapper for 'acpiview'. This allows the AcpiView functionality to be used on platforms with older specifications of the UEFI shell or where the 'acpiview' command is not built in due to platform build configuration. Furthermore, this app can be integrated into more comprehensive testing frameworks as a single component of a more thorough specification compliance validation strategy. 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: Add AcpiViewCommandLibTomas Pilar2020-06-306-12/+16
| | | | | | | | | | | | | | | 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: Update timezone of 3 citiesDorapika Wu2020-06-181-6/+6
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2780 The timezone of following cities should be updated: Istanbul: UTC+3 Novosibirsk: UTC+7 Georgetown (Guyana): UTC-4 Signed-off-by: Dorapika Wu <chuan-hsun.wu@hpe.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: smbiosview - print field values as unsigned integersRebecca Cran2020-06-151-3/+3
| | | | | | | | | | | | This prevents overflow when printing DWORD fields such as the type 17 tables's extended DIMM size. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.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: Shell package changes for RISC-V EDK2 CI.Abner Chang2020-04-031-1/+2
| | | | | | | | | | | | | | | | Add RISC-V architecture to ShellPkg for EDK2 CI testing. BZ:2562: https://bugzilla.tianocore.org/show_bug.cgi?id=2562 Signed-off-by: Abner Chang <abner.chang@hpe.com> Acked-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Gilbert Chen <gilbert.chen@hpe.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
* ShellPkg: Fix 'ping' command Ip4 receive flow.Maciej Rabeda2020-04-011-4/+5
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2032 'ping' command's receive flow utilizes a single Rx token which it attempts to reuse before recycling the previously received packet. This causes a situation where under ICMP traffic, Ping6OnEchoReplyReceived() function will receive an already recycled packet with EFI_SUCCESS token status and finally dereference invalid pointers from RxData structure. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com> Acked-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>