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

Add ACPI TPM2 table generator #5827

Merged
merged 4 commits into from
Aug 8, 2024

Conversation

nvidia-dmach
Copy link
Contributor

Description

  • Add AcpiTpm2LibArm for generating ACPI TPM2 table using the information obtained from Tpm2InterfaceInfo CM object.

  • Add helper function HexDump for printing hex dump of CM Object fields. Also merge multiple flavors of PrintCharX into one function PrintChars by using the field length.

  • Add parser for Tpm2 CM object, which uses HexDump for dumping the 12 bytes of "StartMethodParameters" field.

  • Breaking change?

  • Impacts security?

  • Includes tests?

How This Was Tested

  • Verified that TPM2 table was created properly on platform that produces Tpm2InterfaceInfo CM object.
  • Called ParseCmObjDesc() and ensured that all fields of the CM objects were printed correctly.

Integration Instructions

N/A

@nvidia-dmach nvidia-dmach force-pushed the dmach-tpm2-generator branch 4 times, most recently from 199e7bc to 327ba1f Compare June 26, 2024 19:33
@nvidia-dmach nvidia-dmach marked this pull request as ready for review June 26, 2024 20:25
@pierregondois
Copy link
Contributor

Also:

  • I saw there is a revision 5 of the ACPI table, do you plan to add support for it (I didn't check how much modification this represent)
  • Do you plan to add a parser for the table in acpiview ?
  • There seems to be an SSDT table corresponding to this ACPI table, do you plan to generate it aswell ?
    Regards,
    Pierre

@nvidia-dmach
Copy link
Contributor Author

Hi Pierre,
Thanks for your review. Below are the answers to your questions:

  • I saw there is a revision 5 of the ACPI table, do you plan to add support for it (I didn't check how much modification this represent)
    No, not at the moment. We can add rev 5 in the future patch.
  • Do you plan to add a parser for the table in acpiview ?
    I suppose you mean the CM parser. If so, yes, it was added as the 3rd patch of this PR.
  • There seems to be an SSDT table corresponding to this ACPI table, do you plan to generate it aswell ?
    The SSDT one is platform specific. So I think it's better to do in platform code instead.

BTW, I will be OOTO next week. Please expect some delay in my response.

Thanks,
Dat

@pierregondois
Copy link
Contributor

Hi Pierre, Thanks for your review. Below are the answers to your questions:

  • I saw there is a revision 5 of the ACPI table, do you plan to add support for it (I didn't check how much modification this represent)
    No, not at the moment. We can add rev 5 in the future patch.
  • Do you plan to add a parser for the table in acpiview ?
    I suppose you mean the CM parser. If so, yes, it was added as the 3rd patch of this PR.

There is a module in another package which allows to display ACPI tables, for instance:
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/

I was wondering if you were planning to add support to display this table aswell

  • There seems to be an SSDT table corresponding to this ACPI table, do you plan to generate it aswell ?
    The SSDT one is platform specific. So I think it's better to do in platform code instead.

I think that all the ACPI tables are platform specific.
The SSDT table seems complicated to generate, I was just wondering, no worries if we don't generate it.

BTW, I will be OOTO next week. Please expect some delay in my response.

Thanks, Dat

@nvidia-dmach
Copy link
Contributor Author

Hi Pierre, Sami,

I have made fixes to my patch set. Please review again when you get a chance.

Thanks,
Dat

@nvidia-dmach
Copy link
Contributor Author

Hi Pierre, Sami,

Thank you for your feedbacks. I have updated my patches to address them. Please review again when you get a chance.

Thanks,
Dat

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 Dat,
I added some comments. I think that with the following changes (if you think they are correct), the patch would be ok for me,

patch.txt

Regards,
Pierre

@lgao4
Copy link
Contributor

lgao4 commented Aug 4, 2024

The change in MdePkg is good to me.

Copy link

mergify bot commented Aug 5, 2024

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

@samimujawar
Copy link
Contributor

Hi Liming @lgao4, Mike @mdkinney,

This is a new feature to add TPM2 table generation capability in Dynamic Tables Framework.

This patch set had almost completed the review before 5th Aug. Would it be possible to apply the push label so that it can catch this release cycle, please?

Regards,

Sami Mujawar

@samimujawar
Copy link
Contributor

@nvidia-dmach I think you may need to rebase and push this series again. Can you take a look, please?

@nvidia-dmach
Copy link
Contributor Author

Hi Sami,
I just rebased my patches. Please review again. Thanks.

@lgao4
Copy link
Contributor

lgao4 commented Aug 6, 2024

Hi Liming @lgao4, Mike @mdkinney,

This is a new feature to add TPM2 table generation capability in Dynamic Tables Framework.

This patch set had almost completed the review before 5th Aug. Would it be possible to apply the push label so that it can catch this release cycle, please?

Regards,

Sami Mujawar

Yes. But, this pach needs approve from the maintainer or reviewer of MdePkg and DynamicTablesPkg. I will give my approval. After DynamicTablesPkg maintainer gives the approval, I will add push label for this change.

@nvidia-dmach
Copy link
Contributor Author

Hi Sami, Liming,

Thanks for the approvals. Is there anything I need to do for this patch set to merge?

Thanks,
Dat

Define macro for the max size of the Start Method Specific Paramemeters
field.

Signed-off-by: Dat Mach <dmach@nvidia.com>
Generate ACPI TPM2 table using the information obtained from
Tpm2InterfaceInfo CM object.

Signed-off-by: Dat Mach <dmach@nvidia.com>
Add helper function HexDump for printing hex dump of CM Object fields.

Also merge multiple flavors of PrintCharX into one function PrintChars
by using the field length.

Signed-off-by: Dat Mach <dmach@nvidia.com>
Update the CM Object parser to add support for parsing the
CM_ARM_TPM2_INTERFACE_INFO object.

Signed-off-by: Dat Mach <dmach@nvidia.com>
@lgao4 lgao4 added the push Auto push patch series in PR if all checks pass label Aug 8, 2024
@mergify mergify bot merged commit b0f43dd into tianocore:master Aug 8, 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