Skip to content

Conversation

@abdattar
Copy link
Contributor

Add a new parser for the Firmware Performance Data Table (FPDT), as per the ACPI6.5 specification.

  • Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • Examples: Does it add a new library class or move a module to a different repo.
  • Impacts security?
    • Security - Does this PR have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • Includes tests?
    • Tests - Does this PR include any explicit test code?
    • Examples: Unit tests or integration tests.

How This Was Tested

Tested on AMD platform by running "acpiview -S FPDT" from UEFI shell.

Integration Instructions

N/A

Add a new parser for the Firmware Performance Data Table (FPDT),
as per the ACPI6.5 specification.

Signed-off-by: Abdul Lateef Attar <[email protected]>
Copy link
Contributor

@pierregondois pierregondois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Abdul,
Thanks for the new parser. I added some comments

#include "AcpiViewConfig.h"

// Local Variables
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be mAcpiHdrInfo for static structures

{ L"Length", 1, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Revision", 1, 3, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
{ L"BootPerformanceTablePointer", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: personal preference, but I think it might be easier to read the acronyms instead when reading the table:

  • BootPerformanceTablePointer -> FBPT
  • S3PerformanceTablePointer - > S3PT
  • etc.

{ L"Length", 1, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Revision", 1, 3, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Reserved", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
{ L"BootPerformanceTablePointer", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, would it be possible to check if this is possible to parse the structure pointed by BootPerformanceTablePointer by providing a ACPI_PARSER.PrintFormatter ?

It seems the DumpSmmuNode is doing that for instance.
It would allow to simplify the logic in ParseAcpiFpdt()

FpdtBasicBootPtr->Header.Length,
PARSER_PARAMS (FpdtBootPerfPointerParser)
);
// Parse the header AcpiFpdtHdrParser
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: I think it should be ok to remove these comments

FpdtS3ResumeRec->Header.Length,
PARSER_PARAMS (FpdtS3ResumeRecordParser)
);
} else if (FpdtRecHdr->Type == EFI_ACPI_6_5_FPDT_RUNTIME_RECORD_TYPE_S3_SUSPEND) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT:
I think there are new structures defined in ACPI 6.6.
If you have some time feel free to add support for them. Otherwise it s already nice to have this parser!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants