Skip to content

LoongArchVirt: enable TPM2 support#4

Open
MarsDoge wants to merge 8 commits into
masterfrom
codex/add-tpm2-support-in-ovmfpkg/loongarchvirt
Open

LoongArchVirt: enable TPM2 support#4
MarsDoge wants to merge 8 commits into
masterfrom
codex/add-tpm2-support-in-ovmfpkg/loongarchvirt

Conversation

@MarsDoge
Copy link
Copy Markdown
Owner

Summary

  • add TPM 2.0 library mappings, PCDs, and conditional modules to the LoongArchVirt DSC so TPM2_ENABLE and TPM2_CONFIG_ENABLE provide full measurement and configuration flows
  • include the corresponding Tcg2 PEI/DXE components in the LoongArchVirt firmware image layout

Testing

  • build -b RELEASE -t GCC5 -a LOONGARCH64 -p OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc -D TPM2_ENABLE=TRUE -D TPM2_CONFIG_ENABLE=TRUE (fails: BaseFdtLib dependency libfdt missing in workspace)

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +418 to +421
!if $(TPM2_ENABLE) == TRUE
gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress | 0x0
gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid | {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
gEfiSecurityPkgTokenSpaceGuid.PcdTpm2HashMask | 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Select a real TPM instance instead of gEfiTpmDeviceInstanceNoneGuid

When TPM2_ENABLE is set the DSC still programs PcdTpmInstanceGuid to an all‑zero GUID, which corresponds to gEfiTpmDeviceInstanceNoneGuid. The TPM2 device router rejects any Tpm2DeviceLib whose provider GUID does not match this PCD, so the newly added Tpm2DeviceLibDTpm instance cannot register and every TPM call from Tcg2Pei/Tcg2Dxe will return EFI_UNSUPPORTED. The image therefore advertises TPM2 support but will never bind to an actual TPM device. PcdTpmInstanceGuid should be set to the GUID of the intended device (for QEMU this is typically gEfiTpmDeviceInstanceTpm20DtpmGuid) whenever TPM support is enabled.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant