[edk2-devel] [PATCH v1 5/6] ShellPkg: acpiview: Make IORT parsing logic data driven

2020-05-05 Thread Krzysztof Koch
Table - Platform Design Document, Issue D, March 2018 Signed-off-by: Krzysztof Koch --- Notes: v1: - Make IORT parsing logic data driven [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 353 +--- 1 file changed, 234 insertions(+), 119

[edk2-devel] [PATCH v1 6/6] ShellPkg: acpiview: Make PPTT parsing logic data driven

2020-05-05 Thread Krzysztof Koch
DumpProcessorHierarchyNodeStructure function signature match that of ACPI_STRUCT_PARSER_FUNC. This way, the function can be called from ParseAcpiStruct (). References: - ACPI 6.3 Specification - January 2019, Section 5.2.29 Signed-off-by: Krzysztof Koch --- Notes: v1: - Make PPTT parsing logic data driven [Krzysztof

[edk2-devel] [PATCH v1 4/6] ShellPkg: acpiview: Make GTDT parsing logic data driven

2020-05-05 Thread Krzysztof Koch
() call. Remove the definition of the DumpWatchdogTimer (). Its only purpose was to call ParseAcpi () and now this process is streamlined. References: - ACPI 6.3 Specification - January 2019, Section 5.2.24 Signed-off-by: Krzysztof Koch --- Notes: v1: - Make GTDT parsing logic data driven

[edk2-devel] [PATCH v1 1/6] ShellPkg: acpiview: Add interface for data-driven table parsing

2020-05-05 Thread Krzysztof Koch
together with the structure's current occurrence count. References: - ACPI 6.3, January 2019 Signed-off-by: Krzysztof Koch --- Notes: v1: - Add interface for data-driven table parsing [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 263 ShellPkg

[edk2-devel] [PATCH v1 2/6] ShellPkg: acpiview: Make MADT parsing logic data driven

2020-05-05 Thread Krzysztof Koch
platforms, make existing GIC Distributor (GICD) instance count validation code use ACPI_STRUCT_INFO. References: - ACPI 6.3 Specification - January 2019, Section 5.2.12 Signed-off-by: Krzysztof Koch --- Notes: v1: - Make MADT parsing logic data driven [Krzysztof] ShellPkg/Library

[edk2-devel] [PATCH v1 0/6] ShellPkg: acpiview: Refactor ACPI table parsing loops

2020-05-05 Thread Krzysztof Koch
validation in acpiview, which is implemented in this patch series. Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/tree/616_refactor_acpiview_parser_loops_v1 Krzysztof Koch (6): ShellPkg: acpiview: Add interface for data-driven table parsing ShellPkg: acpiview: Make MADT parsing

[edk2-devel] [PATCH v1 3/6] ShellPkg: acpiview: Make SRAT parsing logic data driven

2020-05-05 Thread Krzysztof Koch
Specification - January 2019, Section 5.2.16 Signed-off-by: Krzysztof Koch --- Notes: v1: - Make SRAT parsing logic data driven [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c | 204 1 file changed, 77 insertions(+), 127 deletions(-) diff

Re: [edk2-devel] [PATCH v1 0/3] Check if required ACPI tables are installed

2020-05-01 Thread Krzysztof Koch
Hi Zhichao, Any idea when this patch set will get merged? Kind regards, Krzysztof -Original Message- From: devel@edk2.groups.io On Behalf Of Gao, Zhichao via groups.io Sent: Friday, April 17, 2020 8:20 To: Krzysztof Koch ; devel@edk2.groups.io; Ni, Ray Cc: Sami Mujawar ; Matteo

[edk2-devel] [PATCH v1 1/3] ShellPkg: acpiview: Add -r parameter for table requirements validation

2020-03-25 Thread Krzysztof Koch
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 --- Notes: v1: - add '-r' parameter for table requirements validaiton [Krzysztof] ShellPkg/Library

[edk2-devel] [PATCH v1 0/3] Check if required ACPI tables are installed

2020-03-25 Thread Krzysztof Koch
tables are present on the platform. Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/tree/617_sbbr_validate_acpi_table_counts_v1 Krzysztof Koch (3): ShellPkg: acpiview: Add -r parameter for table requirements validation ShellPkg: acpiview: Add library for SBBR ACPI requirements

[edk2-devel] [PATCH v1 3/3] ShellPkg: acpiview: Check if SBBR mandatory ACPI tables are installed

2020-03-25 Thread Krzysztof Koch
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 --- Notes: v1: - check

[edk2-devel] [PATCH v1 2/3] ShellPkg: acpiview: Add library for SBBR ACPI requirements validation

2020-03-25 Thread Krzysztof Koch
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 --- Notes: v1: - add library for SBBR ACPI requirements validation [Krzysztof] ShellPkg/Library

[edk2-devel] [PATCH v2 1/1] ShellPkg: acpiview: Prevent infinite loop if structure length is 0

2020-02-19 Thread Krzysztof Koch
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 --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/tree

Re: [edk2-devel] [PATCH v1 1/1] ShellPkg: acpiview: Prevent infinite loop if structure length is 0

2020-02-17 Thread Krzysztof Koch
Hi Liming, The BZ is: https://bugzilla.tianocore.org/show_bug.cgi?id=2534 Please let me know if I should change something. Kind regards, Krzysztof -Original Message- From: devel@edk2.groups.io On Behalf Of Krzysztof Koch via Groups.Io Sent: Monday, February 17, 2020 15:23 To: devel

Re: [edk2-devel] [PATCH v1 1/1] ShellPkg: acpiview: Prevent infinite loop if structure length is 0

2020-02-17 Thread Krzysztof Koch
in making the tool more reliable. Kind regards, Krzysztof -Original Message- From: devel@edk2.groups.io On Behalf Of Liming Gao via Groups.Io Sent: Monday, February 17, 2020 15:11 To: devel@edk2.groups.io; Krzysztof Koch Cc: Ni, Ray ; Gao, Zhichao ; Sami Mujawar ; Matteo Carlini ; nd

[edk2-devel] [PATCH v1 1/1] ShellPkg: acpiview: Prevent infinite loop if structure length is 0

2020-02-14 Thread Krzysztof Koch
writer side. In short, this method helps acpiview recover gracefully from a zero-valued ACPI structure length. Signed-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/tree/612_acpiview_prevent_inf_loops_v1 Notes: v1: - prevent infinite loops

[edk2-devel] [PATCH v2 1/1] MdePkg: Add PCCT table signature definition

2020-02-12 Thread Krzysztof Koch
the definition of Platform Communications Channel Table's signature to the relevant ACPI header files. Signed-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/tree/617_add_pcct_signature_def_v2 Notes: v2: - Replicate the definition from Acpi50.h onwards

Re: [edk2-devel] [PATCH v1 1/1] MdePkg: Add PCCT table signature definition

2020-02-12 Thread Krzysztof Koch
Hi Liming, No problem, I will resubmit the patch updating the relevant ACPI spec header files. Thanks, Krzysztof -Original Message- From: Gao, Liming Sent: Wednesday, February 12, 2020 13:59 To: Krzysztof Koch ; devel@edk2.groups.io Cc: Kinney, Michael D ; Matteo Carlini ; nd

Re: [edk2-devel] [PATCH v1 1/1] MdePkg: Add PCCT table signature definition

2020-02-12 Thread Krzysztof Koch
Hi All, Is there something I can do to help get this patch merged? Kind regards, Krzysztof -Original Message- From: Sami Mujawar Sent: Thursday, January 30, 2020 11:40 To: Krzysztof Koch ; devel@edk2.groups.io Cc: michael.d.kin...@intel.com; liming@intel.com; Matteo Carlini ; nd

[edk2-devel] [PATCH v2 1/1] ShellPkg: acpiview: Validate ACPI table 'Length' field

2020-02-11 Thread Krzysztof Koch
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 --- Changes can be seet at: https

Re: [edk2-devel] [PATCH v3 00/11] Test against invalid pointers in acpiview

2020-02-03 Thread Krzysztof Koch
-Original Message- From: devel@edk2.groups.io On Behalf Of Krzysztof Koch via Groups.Io Sent: Monday, January 20, 2020 11:14 To: devel@edk2.groups.io Cc: ray...@intel.com; zhichao@intel.com; Sami Mujawar ; Matteo Carlini ; nd Subject: [edk2-devel] [PATCH v3 00/11] Test against

[edk2-devel] [PATCH v1 1/1] ShellPkg: acpiview: Validate ACPI table 'Length' field

2020-01-30 Thread Krzysztof Koch
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 --- Changes can be seet at: https

[edk2-devel] [PATCH v1 1/1] ShellPkg: acpiview: Remove duplicate ACPI structure size definitions

2020-01-30 Thread Krzysztof Koch
be that the definitions in these header files are correct. Signed-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com/tianocore/edk2/compare/master...KrzysztofKoch1:remove_dup_defs_acpiview_v1?expand=1 Notes: v1: - Remove duplicate definitions [Krzysztof] ShellPkg/Library

[edk2-devel] [PATCH v1 1/1] MdePkg: Add PCCT table signature definition

2020-01-30 Thread Krzysztof Koch
Signed-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/tree/617_add_pcct_signature_def_v1 Notes: v1: - Add definition of PCCT table signature [Krzysztof] MdePkg/Include/IndustryStandard/Acpi63.h | 7 ++- 1 file changed, 6 insertions(+), 1

[edk2-devel] [edk2-platforms][PATCH v2 1/1] Platform/ARM/ArmJunoDxe: Fix 'unused variable' error for DynamicTables

2020-01-28 Thread Krzysztof Koch
, the 'defined but not used' error got raised. Signed-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2-platforms/tree/723_fix_unused_variable_juno_dxe_v2 Notes: v2: - Specify which previous commit inroduced the error [Philippe] v1: - Fix

[edk2-devel] [PATCH v3 08/11] ShellPkg: acpiview: PPTT: Validate global pointers before use

2020-01-20 Thread Krzysztof Koch
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 --- Notes: v3: - Rebase on latest master [Krzysztof] v1

[edk2-devel] [PATCH v3 03/11] ShellPkg: acpiview: FADT: Validate global pointer before use

2020-01-20 Thread Krzysztof Koch
Check if global pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch --- Notes: v3: - Rebase on latest master [Krzysztof] v2: - Do not require FadtMinorRevision and X_DsdtAddress pointers to be valid

[edk2-devel] [PATCH v3 02/11] ShellPkg: acpiview: RSDP: Validate global pointer before use

2020-01-20 Thread Krzysztof Koch
Check if XsdtAddress pointer has been successfully updated before it is used for further table parsing. Signed-off-by: Krzysztof Koch --- Notes: v3: - Rebase on latest master [Krzysztof] v1: - Test against NULL pointers [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib

[edk2-devel] [PATCH v3 09/11] ShellPkg: acpiview: IORT: Validate global pointers before use

2020-01-20 Thread Krzysztof Koch
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 --- Notes: v3: - Rebase on latest master [Krzysztof] v1: - Test against NULL pointers [Krzysztof] ShellPkg

[edk2-devel] [PATCH v3 07/11] ShellPkg: acpiview: MADT: Validate global pointers before use

2020-01-20 Thread Krzysztof Koch
Check if the MadtInterruptControllerType and MadtInterruptControllerLength pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch --- Notes: v3: - Rebase on latest master [Krzysztof] v1: - Test against NULL pointers

[edk2-devel] [PATCH v3 00/11] Test against invalid pointers in acpiview

2020-01-20 Thread Krzysztof Koch
in FADT table parser [Zhichao] v1: - Validate static pointers in acpiview parsers before use [Krzysztof] Krzysztof Koch (11): ShellPkg: acpiview: Set ItemPtr to NULL for unprocessed table fields ShellPkg: acpiview: RSDP: Validate global pointer before use ShellPkg: acpiview: FADT

[edk2-devel] [PATCH v3 10/11] ShellPkg: acpiview: GTDT: Validate global pointers before use

2020-01-20 Thread Krzysztof Koch
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 --- Notes: v3: - Rebase on latest master [Krzysztof] v1: - Test against NULL pointers [Krzysztof] ShellPkg

[edk2-devel] [PATCH v3 04/11] ShellPkg: acpiview: SLIT: Validate global pointer before use

2020-01-20 Thread Krzysztof Koch
Check if SlitSystemLocalityCount pointer has been successfully updated before it is used for further table parsing. Signed-off-by: Krzysztof Koch --- Notes: v3: - Rebase on latest master [Krzysztof] v1: - Test against NULL pointers [Krzysztof] ShellPkg/Library

[edk2-devel] [PATCH v3 05/11] ShellPkg: acpiview: SLIT: Validate System Locality count

2020-01-20 Thread Krzysztof Koch
, 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 --- Notes: v3: - Rebase on latest master [Krzysztof] v1: - Validate the 'Number

[edk2-devel] [PATCH v3 06/11] ShellPkg: acpiview: SRAT: Validate global pointers before use

2020-01-20 Thread Krzysztof Koch
Check if SratRAType and SratRALength pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch --- Notes: v3: - Rebase on latest master [Krzysztof] v1: - Test against NULL pointers [Krzysztof] ShellPkg/Library

[edk2-devel] [PATCH v3 01/11] ShellPkg: acpiview: Set ItemPtr to NULL for unprocessed table fields

2020-01-20 Thread Krzysztof Koch
will have a dangling pointer which could cause a problem later. Signed-off-by: Krzysztof Koch --- Notes: v3: - Rebase on latest master [Krzysztof] v1: - Set ItemPtr to NULL for unprocessed table fields [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 9

[edk2-devel] [PATCH v3 11/11] ShellPkg: acpiview: DBG2: Validate global pointers before use

2020-01-20 Thread Krzysztof Koch
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 --- Notes: v3: - Rebase on latest master [Krzysztof] v1: - Test against NULL pointers [Krzysztof] ShellPkg

Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] Platform/ARM/ArmJunoDxe: Fix 'unused variable' error for DynamicTables

2020-01-20 Thread Krzysztof Koch
Sure! I don't mind changing the commit message. Shall I resubmit the patch? Kind regards, Krzysztof -Original Message- From: Philippe Mathieu-Daudé Sent: Monday, January 20, 2020 9:15 To: devel@edk2.groups.io; Krzysztof Koch Cc: Ard Biesheuvel ; Leif Lindholm ; Michael D Kinney

[edk2-devel] [edk2-platforms][PATCH v1 1/1] Platform/ARM/ArmJunoDxe: Fix 'unused variable' error for DynamicTables

2020-01-09 Thread Krzysztof Koch
, the 'defined but not used' error got raised. Signed-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2-platforms/tree/723_fix_unused_variable_juno_dxe_v1 Notes: v1: - Fix 'defined but not used' Dynamic Tables build error [Krzysztof] Platform/ARM

[edk2-devel] [PATCH v3 1/1] ShellPkg: acpiview: Update SRAT parser to ACPI 6.3

2020-01-08 Thread Krzysztof Koch
Add support for revision 3 of System Resource Affinity Table (SRAT). Decode and dump the new Generic Initiator Affinity Structure. Validate the Device Handle Type field inside the Generic Initiator Affinity Structure. Signed-off-by: Krzysztof Koch --- The changes can be seen at: https

Re: [edk2-devel] [PATCH v2 1/1] ShellPkg: acpiview: Update SRAT parser to ACPI 6.3

2019-11-19 Thread Krzysztof Koch
Hi Liming, This is a feature support. This patch is a rebased version of a reviewed patch that was pending to be merged due to a lack of 'tested-by', see: https://edk2.groups.io/g/devel/message/42297?p=,,,20,0,0,0::Created,,Krzysztof+Koch+SRAT,20,2,0,32042587 https://edk2.groups.io/g/devel

[edk2-devel] [PATCH v2 1/1] ShellPkg: acpiview: Update SRAT parser to ACPI 6.3

2019-11-12 Thread Krzysztof Koch
Add support for parsing revision 3 of System Resource Affinity Table (SRAT). Decode and dump the new Generic Initiator Affinity Structure. Validate the Device Handle Type field inside the Generic Initiator Affinity Structure. Signed-off-by: Krzysztof Koch --- The changes can be seen at https

[edk2-devel] [PATCH v2 03/11] ShellPkg: acpiview: FADT: Validate global pointer before use

2019-08-19 Thread Krzysztof Koch
Check if global pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/tree/612_add_pointer_validation_v2 Notes: v1: - Test against NULL pointers

Re: [edk2-devel] [PATCH v1 05/11] ShellPkg: acpiview: SLIT: Validate System Locality count

2019-08-19 Thread Krzysztof Koch
Hi Zhichao, Please find my comments inline marked as [Krzysztof]. Kind regards, Krzysztof -Original Message- From: Gao, Zhichao Sent: Monday, August 19, 2019 2:19 To: devel@edk2.groups.io; Krzysztof Koch Cc: Carsey, Jaben ; Ni, Ray ; Sami Mujawar ; Matteo Carlini ; nd Subject

Re: [edk2-devel] [PATCH v1 03/11] ShellPkg: acpiview: FADT: Validate global pointer before use

2019-08-16 Thread Krzysztof Koch
Hi Zhichao, I think you're right. I will submit a v2 patch that minimizes the amount of pointer validation required for parsing the remaining tables. Kind regards, Krzysztof -Original Message- From: Gao, Zhichao Sent: Friday, August 16, 2019 8:35 To: Krzysztof Koch ; devel@edk2

Re: [edk2-devel] [PATCH v1 00/11] Test against invalid pointers in acpiview

2019-08-16 Thread Krzysztof Koch
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2089 Hi Liming, Sure, no problem. Kind regards, Krzysztof -Original Message- From: Gao, Liming Sent: Friday, August 16, 2019 5:03 To: devel@edk2.groups.io; Krzysztof Koch Cc: Carsey, Jaben ; Ni, Ray ; Gao, Zhichao ; Sami Mujawar

[edk2-devel] [PATCH v1 11/11] ShellPkg: acpiview: DBG2: Validate global pointers before use

2019-08-15 Thread Krzysztof Koch
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 --- Notes: v1: - Test against NULL pointers [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2

[edk2-devel] [PATCH v1 10/11] ShellPkg: acpiview: GTDT: Validate global pointers before use

2019-08-15 Thread Krzysztof Koch
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 --- Notes: v1: - Test against NULL pointers [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt

[edk2-devel] [PATCH v1 07/11] ShellPkg: acpiview: MADT: Validate global pointers before use

2019-08-15 Thread Krzysztof Koch
Check if the MadtInterruptControllerType and MadtInterruptControllerLength pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch --- Notes: v1: - Test against NULL pointers [Krzysztof] ShellPkg/Library

[edk2-devel] [PATCH v1 09/11] ShellPkg: acpiview: IORT: Validate global pointers before use

2019-08-15 Thread Krzysztof Koch
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 --- Notes: v1: - Test against NULL pointers [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort

[edk2-devel] [PATCH v1 08/11] ShellPkg: acpiview: PPTT: Validate global pointers before use

2019-08-15 Thread Krzysztof Koch
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 --- Notes: v1: - Test against NULL pointers [Krzysztof

[edk2-devel] [PATCH v1 05/11] ShellPkg: acpiview: SLIT: Validate System Locality count

2019-08-15 Thread Krzysztof Koch
, 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 --- Notes: v1: - Validate the 'Number of System Localities' Field [Krzysztof] - Remove

[edk2-devel] [PATCH v1 01/11] ShellPkg: acpiview: Set ItemPtr to NULL for unprocessed table fields

2019-08-15 Thread Krzysztof Koch
, this could result in a dangling pointer which could cause a problem later. Signed-off-by: Krzysztof Koch --- Notes: v1: - Set ItemPtr to NULL for unprocessed table fields [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 9 - 1 file changed, 8 insertions(+), 1

[edk2-devel] [PATCH v1 02/11] ShellPkg: acpiview: RSDP: Validate global pointer before use

2019-08-15 Thread Krzysztof Koch
Check if XsdtAddress pointer has been successfully updated before it is used for further table parsing. Signed-off-by: Krzysztof Koch --- Notes: v1: - Test against NULL pointers [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c | 12 1

[edk2-devel] [PATCH v1 03/11] ShellPkg: acpiview: FADT: Validate global pointer before use

2019-08-15 Thread Krzysztof Koch
Check if global pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch --- Notes: v1: - Test against NULL pointers [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c | 14 ++ 1

[edk2-devel] [PATCH v1 00/11] Test against invalid pointers in acpiview

2019-08-15 Thread Krzysztof Koch
for NULL whenever these pointers are dereferenced. Changes can be seet at: https://github.com/KrzysztofKoch1/edk2/tree/612_add_pointer_validation_v1 Krzysztof Koch (11): ShellPkg: acpiview: Set ItemPtr to NULL for unprocessed table fields ShellPkg: acpiview: RSDP: Validate global pointer before

[edk2-devel] [PATCH v1 04/11] ShellPkg: acpiview: SLIT: Validate global pointer before use

2019-08-15 Thread Krzysztof Koch
Check if SlitSystemLocalityCount pointer has been successfully updated before it is used for further table parsing. Signed-off-by: Krzysztof Koch --- Notes: v1: - Test against NULL pointers [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c | 16

[edk2-devel] [PATCH v1 06/11] ShellPkg: acpiview: SRAT: Validate global pointers before use

2019-08-15 Thread Krzysztof Koch
Check if SratRAType and SratRALength pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch --- Notes: v1: - Test against NULL pointers [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c

Re: [edk2-devel] [PATCH v1 1/6] ShellPkg: acpiview: DBG2: Prevent buffer overruns

2019-08-05 Thread Krzysztof Koch
foHeaderParser would work as you assume that the remaining table buffer length should be passed to ParseAcpi() as an argument, not the length of the Debug Device Information Structure. What do you think? Kind regards, Krzysztof -Original Message- From: Gao, Zhichao Sent: Monday, Augus

[edk2-devel] [PATCH v1 3/6] ShellPkg: acpiview: IORT: Prevent buffer overruns

2019-08-01 Thread Krzysztof Koch
), Platform Design Document, March 2018 Signed-off-by: Krzysztof Koch --- Notes: v1: - Prevent buffer overruns in IORT acpiview parser [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 191 +++- 1 file changed, 105 insertions(+), 86

[edk2-devel] [PATCH v1 5/6] ShellPkg: acpiview: PPTT: Prevent buffer overruns

2019-08-01 Thread Krzysztof Koch
buffer fits in the PPTT table buffer before its contents are dumped. Prevent buffer overruns when reading the processor topology structure's header. References: - ACPI 6.3, January 2019, Section 5.2.29 Signed-off-by: Krzysztof Koch --- Notes: v1: - Prevent buffer overruns in PPTT acpiview

[edk2-devel] [PATCH v1 6/6] ShellPkg: acpiview: SRAT: Prevent buffer overruns

2019-08-01 Thread Krzysztof Koch
. References: - ACPI 6.3, January 2019, Section 5.2.16 Signed-off-by: Krzysztof Koch --- Notes: v1: - Prevent buffer overruns in SRAT acpiview parser [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c | 14 +- 1 file changed, 13 insertions

[edk2-devel] [PATCH v1 1/6] ShellPkg: acpiview: DBG2: Prevent buffer overruns

2019-08-01 Thread Krzysztof Koch
(to get the length) a new ACPI_PARSER array is defined. References: - Microsoft Debug Port Table 2 (DBG2), December 10, 2015 Signed-off-by: Krzysztof Koch --- Notes: v1: - Prevent buffer overruns in DBG2 acpiview parser [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers

[edk2-devel] [PATCH v1 2/6] ShellPkg: acpiview: GTDT: Prevent buffer overruns

2019-08-01 Thread Krzysztof Koch
ACPI structure's field. References: - ACPI 6.3, January 2019, Table 5-124 Signed-off-by: Krzysztof Koch --- Notes: v1: - Prevent buffer overruns in GTDT acpiview parser [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c | 147 ++-- 1

[edk2-devel] [PATCH v1 4/6] ShellPkg: acpiview: MADT: Prevent buffer overruns

2019-08-01 Thread Krzysztof Koch
Modify the parsing logic to prevent reading past the MADT table buffer length provided when parsing the Interrupt Controller Structure header. Signed-off-by: Krzysztof Koch --- Notes: v1: - Prevent buffer overruns in MADT acpiview parser [Krzysztof] ShellPkg/Library

[edk2-devel] [PATCH v1 0/6] Prevent buffer overruns in acpiview table parsers

2019-08-01 Thread Krzysztof Koch
Krzysztof Koch (6): ShellPkg: acpiview: DBG2: Prevent buffer overruns ShellPkg: acpiview: GTDT: Prevent buffer overruns ShellPkg: acpiview: IORT: Prevent buffer overruns ShellPkg: acpiview: MADT: Prevent buffer overruns ShellPkg: acpiview: PPTT: Prevent buffer overruns ShellPkg: acpiview

Re: [edk2-devel] [PATCH v2 0/6] Acpiview table parsers code style enhancements and refactoring

2019-07-26 Thread Krzysztof Koch
ot; series into smaller functional units as requested in the review comments. Kind regards, Krzysztof -Original Message- From: Sami Mujawar Sent: Tuesday, July 23, 2019 10:57 To: Krzysztof Koch ; devel@edk2.groups.io Cc: jaben.car...@intel.com; ray...@intel.com; zhichao@intel.com; nd S

Re: [edk2-devel] [PATCH v2 0/6] Acpiview table parsers code style enhancements and refactoring

2019-07-22 Thread Krzysztof Koch
devel@edk2.groups.io On Behalf Of Krzysztof Koch via Groups.Io Sent: Monday, July 22, 2019 8:50 To: devel@edk2.groups.io Cc: jaben.car...@intel.com; ray...@intel.com; zhichao@intel.com; Sami Mujawar ; Matteo Carlini ; nd Subject: [edk2-devel] [PATCH v2 0/6] Acpiview table parsers

[edk2-devel] [PATCH v2 5/6] ShellPkg: acpiview: MADT: Split structure length validation

2019-07-22 Thread Krzysztof Koch
Controller Structures (for all interrupt models which can be represented in MADT). Check if the controller length specified is shorter than the byte size of the first two fields ('Type' and 'Length') present in every valid Interrupt Controller Structure. Signed-off-by: Krzysztof Koch --- Notes

[edk2-devel] [PATCH v2 6/6] ShellPkg: acpiview: IORT: Refactor PMCG node mapping count validation

2019-07-22 Thread Krzysztof Koch
parsing and is limited to a single table field in scope, therefore, it is better to keep it away from the code responsible for traversing the table. Signed-off-by: Krzysztof Koch --- Notes: v1: - refactor PMCG node mapping count validation [Krzysztof] ShellPkg/Library

[edk2-devel] [PATCH v2 4/6] ShellPkg: acpiview: SRAT: Minor code style enhancements

2019-07-22 Thread Krzysztof Koch
Minor changes to the SRAT parser code to conform with the EDKII coding style and to make it consistent with other ACPI table parsers. Signed-off-by: Krzysztof Koch --- Notes: v1: - minor code style enhancements [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat

[edk2-devel] [PATCH v2 3/6] ShellPkg: acpiview: RSDP: Make code consistent with other parsers

2019-07-22 Thread Krzysztof Koch
. This effectively means that no more ACPI tables will be parsed because of this RSDP table content error. Signed-off-by: Krzysztof Koch --- Notes: v1: - minor code style enhancements [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c | 11 +-- 1 file

[edk2-devel] [PATCH v2 0/6] Acpiview table parsers code style enhancements and refactoring

2019-07-22 Thread Krzysztof Koch
/KrzysztofKoch1/edk2/tree/612_acpiview_code_style_enhance_v2 Krzysztof Koch (6): ShellPkg: acpiview: Allow passing buffer length to DumpGasStruct() ShellPkg: acpiview: XSDT: Remove redundant ParseAcpi() call ShellPkg: acpiview: RSDP: Make code consistent with other parsers ShellPkg: acpiview: SRAT

[edk2-devel] [PATCH v2 1/6] ShellPkg: acpiview: Allow passing buffer length to DumpGasStruct()

2019-07-22 Thread Krzysztof Koch
. Update all existing DumpGasStruct() calls in acpiview to add the length argument. Signed-off-by: Krzysztof Koch --- Notes: v2: - Pass GAS_LENGTH to DumpGasStruct() in DBG2 parser [Zhichao] v1: - Modify DumpGasStruct() signature [Krzysztof] ShellPkg/Library

[edk2-devel] [PATCH v2 2/6] ShellPkg: acpiview: XSDT: Remove redundant ParseAcpi() call

2019-07-22 Thread Krzysztof Koch
instead of a global static variable. Signed-off-by: Krzysztof Koch --- Notes: v1: - remove redundant ParseAcpi() call [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git

Re: [edk2-devel] [PATCH v1 1/6] ShellPkg: acpiview: Allow passing buffer length to DumpGasStruct()

2019-07-19 Thread Krzysztof Koch
Len); Replaced with > DumpGasStruct (DataPtr, 4, GAS_LENGTH); Is that ok? Kind regards, Krzysztof -Original Message- From: Gao, Zhichao Sent: Friday, July 19, 2019 9:09 To: Krzysztof Koch Subject: RE: [PATCH v1 1/6] ShellPkg: acpiview: Allow passing buffer length to DumpGasStruct() HI Krz

[edk2-devel] [PATCH v1 5/6] ShellPkg: acpiview: MADT: Split structure length validation

2019-07-18 Thread Krzysztof Koch
Controller Structures (for all interrupt models which can be represented in MADT). Check if the controller length specified is shorter than the byte size of the first two fields ('Type' and 'Length') present in every valid Interrupt Controller Structure. Signed-off-by: Krzysztof Koch --- Notes

[edk2-devel] [PATCH v1 4/6] ShellPkg: acpiview: SRAT: Minor code style enhancements

2019-07-18 Thread Krzysztof Koch
Minor changes to the SRAT parser code to conform with the EDKII coding style and to make it consistent with other ACPI table parsers. Signed-off-by: Krzysztof Koch --- Notes: v1: - minor code style enhancements [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat

[edk2-devel] [PATCH v1 6/6] ShellPkg: acpiview: IORT: Refactor PMCG node mapping count validation

2019-07-18 Thread Krzysztof Koch
parsing and is limited to a single table field in scope, therefore, it is better to keep it away from the code responsible for traversing the table. Signed-off-by: Krzysztof Koch --- Notes: v1: - refactor PMCG node mapping count validation [Krzysztof] ShellPkg/Library

[edk2-devel] [PATCH v1 3/6] ShellPkg: acpiview: RSDP: Make code consistent with other parsers

2019-07-18 Thread Krzysztof Koch
. This effectively means that no more ACPI tables will be parsed because of this RSDP table content error. Signed-off-by: Krzysztof Koch --- Notes: v1: - minor code style enhancements [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c | 11 +-- 1 file

[edk2-devel] [PATCH v1 2/6] ShellPkg: acpiview: XSDT: Remove redundant ParseAcpi() call

2019-07-18 Thread Krzysztof Koch
instead of a global static variable. Signed-off-by: Krzysztof Koch --- Notes: v1: - remove redundant ParseAcpi() call [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git

[edk2-devel] [PATCH v1 1/6] ShellPkg: acpiview: Allow passing buffer length to DumpGasStruct()

2019-07-18 Thread Krzysztof Koch
. Update all existing DumpGasStruct() calls in acpiview to add the length argument. Signed-off-by: Krzysztof Koch --- Notes: v1: - Modify DumpGasStruct() signature [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 26 +++- ShellPkg/Library

[edk2-devel] [PATCH v1 0/6] Acpiview table parsers code style enhancements and refactoring

2019-07-18 Thread Krzysztof Koch
/KrzysztofKoch1/edk2/tree/612_acpiview_code_style_enhance_v1 Krzysztof Koch (6): ShellPkg: acpiview: Allow passing buffer length to DumpGasStruct() ShellPkg: acpiview: XSDT: Remove redundant ParseAcpi() call ShellPkg: acpiview: RSDP: Make code consistent with other parsers ShellPkg: acpiview: SRAT

[edk2-devel] [PATCH v1 8/8] ShellPkg: acpiview: DBG2: Remove redundant forward declarations

2019-07-18 Thread Krzysztof Koch
Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch --- Notes: v1: - remove redundant forward function declarations [Krzysztof

[edk2-devel] [PATCH v1 2/8] ShellPkg: acpiview: FADT: Remove redundant forward declarations

2019-07-18 Thread Krzysztof Koch
Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch --- Notes: v1: - remove redundant forward function declarations [Krzysztof

[edk2-devel] [PATCH v1 6/8] ShellPkg: acpiview: IORT: Remove redundant forward declarations

2019-07-18 Thread Krzysztof Koch
Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch --- Notes: v1: - remove redundant forward function declarations [Krzysztof

[edk2-devel] [PATCH v1 0/8] Remove redundant forward declarations in acpiview

2019-07-18 Thread Krzysztof Koch
declarations, so this set of patches makes the code structure consistent across all acpiview parsers. Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/tree/612_remove_forward_decl_v1 Krzysztof Koch (8): ShellPkg: acpiview: RSDP: Remove redundant forward declarations ShellPkg

[edk2-devel] [PATCH v1 3/8] ShellPkg: acpiview: SPCR: Remove redundant forward declaration

2019-07-18 Thread Krzysztof Koch
Reposition blocks of code to remove redundant forward function declarations in order to reduce the code size. Signed-off-by: Krzysztof Koch --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr

[edk2-devel] [PATCH v1 4/8] ShellPkg: acpiview: SRAT: Remove redundant forward declarations

2019-07-18 Thread Krzysztof Koch
Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch --- Notes: v1: - remove redundant forward function declarations [Krzysztof

[edk2-devel] [PATCH v1 1/8] ShellPkg: acpiview: RSDP: Remove redundant forward declarations

2019-07-18 Thread Krzysztof Koch
Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch --- Notes: v1: - remove redundant forward function declarations [Krzysztof

[edk2-devel] [PATCH v1 5/8] ShellPkg: acpiview: MADT: Remove redundant forward declarations

2019-07-18 Thread Krzysztof Koch
Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch --- Notes: v1: - remove redundant forward function declarations [Krzysztof

[edk2-devel] [PATCH v1 7/8] ShellPkg: acpiview: GTDT: Remove redundant forward declarations

2019-07-18 Thread Krzysztof Koch
. Signed-off-by: Krzysztof Koch --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c | 91 +++- 1 file changed, 33 insertions(+), 58 deletions(-) diff --git a/ShellPkg/Library

Re: [edk2-devel] [PATCH v1 01/11] ShellPkg: acpiview: FADT: Validate global pointers before use

2019-07-17 Thread Krzysztof Koch
.groups.io On Behalf Of Carsey, Jaben via Groups.Io Sent: Friday, July 12, 2019 15:27 To: Krzysztof Koch ; devel@edk2.groups.io Cc: Ni, Ray ; Gao, Zhichao ; Sami Mujawar ; Matteo Carlini ; nd Subject: Re: [edk2-devel] [PATCH v1 01/11] ShellPkg: acpiview: FADT: Validate global pointers before use

[edk2-devel] [PATCH v1 10/11] ShellPkg: acpiview: GTDT: Add error-checking in the parsing logic

2019-07-12 Thread Krzysztof Koch
. Remove redundant forward function declarations by repositioning blocks of code. 5. Convert a 'do-while' loop for parsing GTDT table body into a 'while' block for consistency with other table parsers. Signed-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com/KrzysztofKoch1

[edk2-devel] [PATCH v1 11/11] ShellPkg: acpiview: DBG2: Add error-checking in the parsing logic

2019-07-12 Thread Krzysztof Koch
against buffer overrruns are simpler to implement. 5. Modify the signature of DumpGasStruct() function inside AcpiParser.c to facilitate protection against buffer overruns in the DBG2 parser. Signed-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/commit

[edk2-devel] [PATCH v1 09/11] ShellPkg: acpiview: IORT: Add error-checking in the parsing logic

2019-07-12 Thread Krzysztof Koch
-by: Krzysztof Koch --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/commit/0b398f116f7aed99dbec4090b5c2c0ed93273ef7 Notes: v1: - improve the logic in the IORT parser [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 419

[edk2-devel] [PATCH v1 08/11] ShellPkg: acpiview: PPTT: Add error-checking in the parsing logic

2019-07-12 Thread Krzysztof Koch
this check, there is a possibility for the parser to enter an ifninite loop. 3. Test against buffer overruns. 4. Allow silencing ACPI table content validation errors which do not cause table parsing to fail. Signed-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com

[edk2-devel] [PATCH v1 07/11] ShellPkg: acpiview: MADT: Add error-checking in the parsing logic

2019-07-12 Thread Krzysztof Koch
-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/commit/ef11738efc94a9c3d7270d376a2cb273bbadbba2 Notes: v1: - improve the logic in the MADT parser [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c | 187

[edk2-devel] [PATCH v1 06/11] ShellPkg: acpiview: SRAT: Add error-checking in the parsing logic

2019-07-12 Thread Krzysztof Koch
-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/commit/d46d682d28654b1c6263be2f4fd961c35e80e5cb Notes: v1: - improve the logic in the SRAT parser [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c | 113

[edk2-devel] [PATCH v1 01/11] ShellPkg: acpiview: FADT: Validate global pointers before use

2019-07-12 Thread Krzysztof Koch
not cause table parsing to fail. Signed-off-by: Krzysztof Koch --- Changes can be seen at: https://github.com/KrzysztofKoch1/edk2/commit/49cc41430775fb93205e302590a7d31f080c3952 Notes: v1: - improve the logic in the parser [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib

  1   2   >