]> git.proxmox.com Git - mirror_edk2.git/commit
OvmfPkg/TdTcg2Dxe: Fix the mapping error between PCR index and MR index
authorMin M Xu <min.m.xu@intel.com>
Wed, 14 Dec 2022 07:14:18 +0000 (15:14 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 15 Dec 2022 03:07:33 +0000 (03:07 +0000)
commitfb91d6cbd0cff704586c4cadbef870acef9c52ef
tree85f926ca2f0de02dbbd6de443b25ad98de937fa2
parent19f7c63ea978c5a4ef9345b9bf4995dcd48fa328
OvmfPkg/TdTcg2Dxe: Fix the mapping error between PCR index and MR index

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4179

According to UEFI Spec 2.10 it is supposed to return the mapping from PCR
index to CC MR index:
//
// In the current version, we use the below mapping for TDX:
//
// TPM PCR Index | CC Measurement Register Index | TDX-measurement register
// -----------------------------------------------------------------------
// 0             |   0                           |   MRTD
// 1, 7          |   1                           |   RTMR[0]
// 2~6           |   2                           |   RTMR[1]
// 8~15          |   3                           |   RTMR[2]

In the current implementation TdMapPcrToMrIndex returns the index of RTMR,
not the MR index.

After fix the spec unconsistent, other related codes are updated
accordingly.
1) The index of event log uses the input MrIndex.
2) MrIndex is decreated by 1 before it is sent for RTMR extending.

Cc: Erdem Aktas <erdemaktas@google.com> [ruleof2]
Cc: James Bottomley <jejb@linux.ibm.com> [jejb]
Cc: Jiewen Yao <jiewen.yao@intel.com> [jyao1]
Cc: Tom Lendacky <thomas.lendacky@amd.com> [tlendacky]
Cc: Arti Gupta <ARGU@microsoft.com>
Reported-by: Arti Gupta <ARGU@microsoft.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
OvmfPkg/IntelTdx/TdTcg2Dxe/TdTcg2Dxe.c