summaryrefslogtreecommitdiff
path: root/SecurityPkg/Library/Tpm2DeviceLibFfa
AgeCommit message (Collapse)AuthorFilesLines
2026-08-03SecurityPkg: Remove global use pre-memoryrdiaz4-74/+85
Updated Tpm2DeviceLibFfa to no longer use globals. Updated the SEC version of Tpm2DeviceLibFfaBase to no longer use globals when including TPM libraries in the SEC phase. Includes various cleanup regarding the updated files. Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
2026-07-20SecurityPkg: Tpm over FFA: FFA_RUN command should use the returned IDKun Qin1-6/+6
As the FFA function now returns the target ID properly, instead of hardcoding the FFA_RUN target ID being the TPM SP, we use the parsed ID to issue the FFA_RUN. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-02-24SecurityPkg: Replace include guards with #pragma onceMichael Kubacki1-4/+1
Replace traditional `#ifndef`/`#define`/`#endif` include guards with `#pragma` once. `#pragma once` is a widely supported preprocessor directive that prevents header files from being included multiple times. It is supported by all toolchains used to build edk2: GCC, Clang/LLVM, and MSVC. Compared to macro-based include guards, `#pragma once`: - Eliminates the risk of macro name collisions or copy/paste errors where two headers inadvertently use the same guard macro. - Eliminate inconsistency in the way include guard macros are named (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.). - Reduces boilerplate (three lines replaced by one). - Avoids polluting the macro namespace with guard symbols. - Can improve build times as the preprocessor can skip re-opening the file entirely, rather than re-reading it to find the matching `#endif` ("multiple-include optimization"). - Note that some compilers may already optimize traditional include guards, by recognzining the idiomatic pattern. This change is made acknowledging that overall portability of the code will technically be reduced, as `#pragma once` is not part of the C/C++ standards. However, this is considered acceptable given: 1. edk2 already defines a subset of supported compilers in BaseTools/Conf/tools_def.template, all of which have supported `#pragma once` for over two decades. 2. There have been concerns raised to the project about inconsistent include guard naming and potential macro collisions. Approximate compiler support dates: - MSVC: Supported since Visual C++ 4.2 (1996) - GCC: Supported since 3.4 (2004) (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html) - Clang (LLVM based): Since initial release in 2007 Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-01-08SecurityPkg/Library: use ArmFfaGetPartitionInfo() in Tpm2ServiceFfaLibLevi Yun1-55/+11
Use ArmFfaGetPartitionInfo() in Tpm2ServiceFfaLib. This simplifies the code line to get partition information. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-09-18SecurityPkg: Tpm2DeviceLibFfa: Recognize CRB Interface Version 2Kun Qin1-1/+2
This change adds the recognition of TPM devices that supports CRB interface v2. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-09-08Global: fix ArmFfaLibRun() caller couldn't get ret-argsLevi Yun1-6/+6
When ArmFfaLibDirectMsgReq(2) is preempted, caller of these functions should resume it works via ArmFfaLibRun() and the secure partition will be return with FFA_DIRECT_MSG_RESP(2) with return arguments. However, since ArmFfaLibRun() gets its return in its stack variable, So caller of ArmFfaLibRun() doesn't get the return arguments from secure partition. To resolve this, add output parameter to ArmFfaLibRun() to receive return arguments. Continuous-integration-options: PatchCheck.ignore-multi-package Fixes: 5d1b38dd07c4 ("ArmPkg: Add ArmFfaLib used in Dxe driver") Reported-by: Mariam Elshakfy <Mariam.Elshakfy@arm.com> Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-07-24SecurityPkg/Library: Tpm2DeviceSecLibFfa for PeilessSecLevi Yun2-0/+113
To support measurement and extend PCR in PeilessSec with TPM device using FF-A over CRB, add Tpm2DeviceSecLibFfa for PeilessSec. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-07-24SecurityPkg/Library: separate logics geting TPM2 information with FF-ALevi Yun6-44/+162
This is preparation patch to add Tpm2DeviceSecLibFfa for SEC used in PeilessSec. In SEC phase, DynamicPcd used for cacahing TPM2 information couldn't be used. To resolve this, writes wrapper functions to get TPM2 information so that in the wrapper functions used in SEC wouldn't use the related DyanmicPcd. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-05-16SecurityPkg/Tpm2InstanceLibFfa: Fix constructor wrong nameLevi Yun1-1/+1
Fix unmatched constructor name of Tpm2InstanceLibFfa. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-04-18SecurityPkg: Tpm2InstanceLibFfa: Introduce Tpm2InstanceLib over FF-AKun Qin2-0/+108
This change introduces a `Tpm2InstanceLibFfa` library to support TPM over FF-A and works with Tpm2DeviceLibRouter* libraries. The implementation follows the TPM over FF-A spec v1.0 BET: https://developer.arm.com/documentation/den0138/latest/ The change is tested on QEMU SBSA virtual platform and proprietary hardware platforms. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-18SecurityPkg: Tpm2DeviceLibFfa: Introduce TPM device library over FF-Akuqin126-0/+1312
This change introduces a `Tpm2DeviceLibFfa` library to support TPM over FF-A. The implementation follows the TPM over FF-A spec v1.0 BET: https://developer.arm.com/documentation/den0138/latest/ The change is tested on QEMU SBSA virtual platform and proprietary hardware platforms. Co-authored-by: Raymond Diaz <raymonddiaz@microsoft.com> Signed-off-by: Kun Qin <kun.qin@microsoft.com>