Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mpam ACPI and parser changes #5888

Merged
merged 7 commits into from
Aug 1, 2024
Merged

Conversation

rohit-arm
Copy link
Contributor

@rohit-arm rohit-arm commented Jul 8, 2024

Description

This series adds the following

  • definitions corresponding to MPAM ACPI 2.0 specification.
  • MPAM parser

An MPAM ACPI table formulated using the newly added MPAM ACPI definitions=
were
validated on the linux kernel tree at [1]. The same table was parsed via
acpiview using the newly added parser. Certain aspects of the MPAM ACPI
specification are still not implemented by the kernel tree. These aspects were
verified only using acpiview.

Changes since V1:

  • Addressed comments on MPAM ACPI definitions from Sami.
  • V1 did not incorporate the parser. V2 has this implemented.

Changes since V2:

  • Addressed comments related to Interface/Link type defintions from Sami.

Changes since v3:

  • Addressed comments from Pierre

Changes since v4:

  • Addressed comments from Sami regarding Parser.

Changes from v5:

  • Addressed comments from Sami regarding Parser.

  • 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.

This PR can cause a break in the build as it touches the code. However all the build CIs have gone through and therefore I don't anticipate build failures post merge. For boot, the scope of this PR is mostly restricted for UEFI shell. It adds a new parser for MPAM ACPI table which is relevant only when UEFI shell is up.

  • 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

This PR was tested using different versions of non-mainline kernel supporting MPAM. The description of the changes detail this.

Integration Instructions

N/A

@rohit-arm
Copy link
Contributor Author

@samimujawar - Gentle reminder on the series.

Copy link
Member

@mdkinney mdkinney left a comment

Choose a reason for hiding this comment

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

MdePkg changes are approved

Copy link

mergify bot commented Jul 29, 2024

PR can not be merged due to conflict. Please rebase and resubmit

@samimujawar samimujawar self-requested a review July 30, 2024 08:47
@samimujawar
Copy link
Contributor

@ZhichaoGao This patch series looks good to me. Is it possible to apply the push label, please?

@rohit-arm
Copy link
Contributor Author

rohit-arm commented Jul 31, 2024

Hi, there was a CI failure yesterday as this patch-set introduces prototype changes for 2 widely used Parser APIs (d6f78b5 and b96f919). Anytime something gets merged upstream touching these prototypes, I would need to manual re-adapt the patch-set so that everything upstream utilizes the new prototype.

The following PRs were merged after this patch-set was posted for review 3 weeks back.
#5747
#5749

I have updated the patch-set now to align everything on upstream with the new prototype.

Tagging @ZhichaoGao @lgao4 as well - as it introduces prototype changes, gentle request if we can get this merged before upstream moves further.

Thanks!

@lgao4 lgao4 added the push Auto push patch series in PR if all checks pass label Aug 1, 2024
@github-actions github-actions bot requested a review from lgao4 August 1, 2024 05:20
rohit-arm and others added 6 commits August 1, 2024 10:10
Add definitions, macros and types for elements associated with MPAM
ACPI 2.0 specification.

Signed-off-by: Rohit Mathew <[email protected]>
Cc: James Morse <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Sami Mujawar <[email protected]>
Cc: Thomas Abraham <[email protected]>
Cc: Zhiguang Liu <[email protected]>
Acked-by: Liming Gao <[email protected]>
Reviewed-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
As of now, the field-validator implemented by FNPTR_FIELD_VALIDATOR
function pointer takes two parameters, the pointer to the field and a
context pointer. For cases where the validator has to have access to the
length of the field, there is no clean way to currently do it. In order
to resolve this, this commit updates the field-validator's prototype to
take the length of the field as an additional parameter.

This enhancement allows field validators to perform more comprehensive
validation, especially when the length of the field is critical to the
validation logic. This change should improve the overall robustness and
flexibility of AcpiView.

Signed-off-by: Rohit Mathew <[email protected]>
Cc: James Morse <[email protected]>
Cc: Sami Mujawar <[email protected]>
Cc: Thomas Abraham <[email protected]>
Cc: Zhichao Gao <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
As of now, the print-formatter implemented by the FNPTR_PRINT_FORMATTER
function pointer takes two parameters, the format string and the pointer
to the field. For cases where the print-formatter has to have access to
the length of the field, there is no clean way to currently do it. In
order to resolve this, update the print-formatter's prototype to take
the length of the field as a third parameter. This change should improve
the overall robustness and flexibility of AcpiView.

Signed-off-by: Rohit Mathew <[email protected]>
Cc: James Morse <[email protected]>
Cc: Sami Mujawar <[email protected]>
Cc: Thomas Abraham <[email protected]>
Cc: Zhichao Gao <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
Certain ACPI tables like MPAM has fields which are 16 bytes long.
Routines similar to Dump12Chars but for 16 characters are required to
print such fields. Add Dump16Chars routine to satisfy this requirement.

Signed-off-by: Rohit Mathew <[email protected]>
Cc: James Morse <[email protected]>
Cc: Sami Mujawar <[email protected]>
Cc: Thomas Abraham <[email protected]>
Cc: Zhichao Gao <[email protected]>
Reviewed-by: Pierre Gondois <[email protected]>
Reviewed-by: Zhichao Gao <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
Most of the ACPI tables have fields that are marked reserved. Implement
functions "DumpReserved" and "DumpReservedBits" aligning with the
print-formatter prototype to print out reserved fields.

Signed-off-by: Rohit Mathew <[email protected]>
Cc: James Morse <[email protected]>
Cc: Sami Mujawar <[email protected]>
Cc: Thomas Abraham <[email protected]>
Cc: Zhichao Gao <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
Add a parser for the MPAM (Memory system resource partitioning and
monitoring) ACPI table. This parser would parse all MPAM related
structures embedded as part of the ACPI table. Necessary validations are
also performed where and when required.

Signed-off-by: Rohit Mathew <[email protected]>
Cc: James Morse <[email protected]>
Cc: Sami Mujawar <[email protected]>
Cc: Thomas Abraham <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: Zhichao Gao <[email protected]>
Reviewed-by: Zhichao Gao <[email protected]>
@mergify mergify bot merged commit b0e7a75 into tianocore:master Aug 1, 2024
126 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
push Auto push patch series in PR if all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants