* TPM ACPI HID creation
@ 2019-06-25 15:58 jason.spottswood
2019-06-25 16:07 ` [edk2-devel] " Yao, Jiewen
[not found] ` <15AB7CC2B08E2631.2932@groups.io>
0 siblings, 2 replies; 4+ messages in thread
From: jason.spottswood @ 2019-06-25 15:58 UTC (permalink / raw)
To: devel
[-- Attachment #1: Type: text/plain, Size: 1780 bytes --]
Tcg2Smm.c has a function "UpdateHID to create the ACPI HID for the TPM. This function uses the TPM vendor ID combined with the firmware version number to create the ACPI HID. The use of the TPM firmware version is not specified in any spec from the TCG or otherwise that I have been able to find. I believe this was a design choice specific to EDK2. However, using the TPM firmware version does not match the intended use case from the TCG PC Client spec, where the HID should be comprised of the vendor ID and device ID. See below. One problem that arises from this design is that the ACPI tables will change when the TPM FW has been updated. Since the ACPI tables are hashed into PCR[0], it consequently means that a TPM FW change will cause a change to PCR[0]. It is not intuitive nor spec'd that TPM FW be included in PCR[0] measurements. In fact, PCR[0] is used only for system FW/UEFI code measurements. If a user does not update UEFI, then there is no expectation of PCR[0] measurement changes. I propose that EDK2 change the UpdateHID function to use the vendor ID and device ID read from register TPM_DID_VID_0 (locality 0 offset 0xF00) in the creation of the ACPI HID.
The following was taken from the TCG PC Client Platform Firmware spec:
According to the ACPI Specification (version 5, Errata A, Section 6.1.5 and 6.1.3) a
hardware ID or compatibility ID is either a PNP ID with format “AAA####” or ACPI ID
with format “NNNN####”. The manufacturer ID returned by a TPM2_GetCapability
command can be used to set the “AAA” or “NNNN” portion of the ID. The remaining four
hexadecimal digits should be set to a value that allows software to differentiate different
device classes built by the same manufacturer.
[-- Attachment #2: Type: text/html, Size: 2924 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [edk2-devel] TPM ACPI HID creation
2019-06-25 15:58 TPM ACPI HID creation jason.spottswood
@ 2019-06-25 16:07 ` Yao, Jiewen
2019-06-26 1:42 ` Zhang, Chao B
[not found] ` <15AB7CC2B08E2631.2932@groups.io>
1 sibling, 1 reply; 4+ messages in thread
From: Yao, Jiewen @ 2019-06-25 16:07 UTC (permalink / raw)
To: devel@edk2.groups.io, jason.spottswood@hpe.com; +Cc: Zhang, Chao B, Yao, Jiewen
[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]
Thanks Jason.
I think we should NOT measure TPM2 table *after* ACPI table patch.
The measurement should happen *before* ACPI table patch.
Hi Chao
Do you agree on that?
Thank you
Yao Jiewen
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of jason.spottswood@hpe.com
Sent: Tuesday, June 25, 2019 11:58 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] TPM ACPI HID creation
Tcg2Smm.c has a function "UpdateHID to create the ACPI HID for the TPM. This function uses the TPM vendor ID combined with the firmware version number to create the ACPI HID. The use of the TPM firmware version is not specified in any spec from the TCG or otherwise that I have been able to find. I believe this was a design choice specific to EDK2. However, using the TPM firmware version does not match the intended use case from the TCG PC Client spec, where the HID should be comprised of the vendor ID and device ID. See below. One problem that arises from this design is that the ACPI tables will change when the TPM FW has been updated. Since the ACPI tables are hashed into PCR[0], it consequently means that a TPM FW change will cause a change to PCR[0]. It is not intuitive nor spec'd that TPM FW be included in PCR[0] measurements. In fact, PCR[0] is used only for system FW/UEFI code measurements. If a user does not update UEFI, then there is no expectation of PCR[0] measurement changes. I propose that EDK2 change the UpdateHID function to use the vendor ID and device ID read from register TPM_DID_VID_0 (locality 0 offset 0xF00) in the creation of the ACPI HID.
The following was taken from the TCG PC Client Platform Firmware spec:
According to the ACPI Specification (version 5, Errata A, Section 6.1.5 and 6.1.3) a
hardware ID or compatibility ID is either a PNP ID with format “AAA####” or ACPI ID
with format “NNNN####”. The manufacturer ID returned by a TPM2_GetCapability
command can be used to set the “AAA” or “NNNN” portion of the ID. The remaining four
hexadecimal digits should be set to a value that allows software to differentiate different
device classes built by the same manufacturer.
[-- Attachment #2: Type: text/html, Size: 8488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [edk2-devel] TPM ACPI HID creation
[not found] ` <15AB7CC2B08E2631.2932@groups.io>
@ 2019-06-26 1:03 ` Yao, Jiewen
0 siblings, 0 replies; 4+ messages in thread
From: Yao, Jiewen @ 2019-06-26 1:03 UTC (permalink / raw)
To: devel@edk2.groups.io, Yao, Jiewen, jason.spottswood@hpe.com; +Cc: Zhang, Chao B
[-- Attachment #1: Type: text/plain, Size: 2726 bytes --]
Hi Jason
Would you mind to help us to file a Bugzilla - https://bugzilla.tianocore.org/ for tracking purpose?
Thank you
Yao Jiewen
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Yao, Jiewen
Sent: Wednesday, June 26, 2019 12:08 AM
To: devel@edk2.groups.io; jason.spottswood@hpe.com
Cc: Zhang, Chao B <chao.b.zhang@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
Subject: Re: [edk2-devel] TPM ACPI HID creation
Thanks Jason.
I think we should NOT measure TPM2 table *after* ACPI table patch.
The measurement should happen *before* ACPI table patch.
Hi Chao
Do you agree on that?
Thank you
Yao Jiewen
From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> [mailto:devel@edk2.groups.io] On Behalf Of jason.spottswood@hpe.com<mailto:jason.spottswood@hpe.com>
Sent: Tuesday, June 25, 2019 11:58 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Subject: [edk2-devel] TPM ACPI HID creation
Tcg2Smm.c has a function "UpdateHID to create the ACPI HID for the TPM. This function uses the TPM vendor ID combined with the firmware version number to create the ACPI HID. The use of the TPM firmware version is not specified in any spec from the TCG or otherwise that I have been able to find. I believe this was a design choice specific to EDK2. However, using the TPM firmware version does not match the intended use case from the TCG PC Client spec, where the HID should be comprised of the vendor ID and device ID. See below. One problem that arises from this design is that the ACPI tables will change when the TPM FW has been updated. Since the ACPI tables are hashed into PCR[0], it consequently means that a TPM FW change will cause a change to PCR[0]. It is not intuitive nor spec'd that TPM FW be included in PCR[0] measurements. In fact, PCR[0] is used only for system FW/UEFI code measurements. If a user does not update UEFI, then there is no expectation of PCR[0] measurement changes. I propose that EDK2 change the UpdateHID function to use the vendor ID and device ID read from register TPM_DID_VID_0 (locality 0 offset 0xF00) in the creation of the ACPI HID.
The following was taken from the TCG PC Client Platform Firmware spec:
According to the ACPI Specification (version 5, Errata A, Section 6.1.5 and 6.1.3) a
hardware ID or compatibility ID is either a PNP ID with format “AAA####” or ACPI ID
with format “NNNN####”. The manufacturer ID returned by a TPM2_GetCapability
command can be used to set the “AAA” or “NNNN” portion of the ID. The remaining four
hexadecimal digits should be set to a value that allows software to differentiate different
device classes built by the same manufacturer.
[-- Attachment #2: Type: text/html, Size: 10625 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [edk2-devel] TPM ACPI HID creation
2019-06-25 16:07 ` [edk2-devel] " Yao, Jiewen
@ 2019-06-26 1:42 ` Zhang, Chao B
0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Chao B @ 2019-06-26 1:42 UTC (permalink / raw)
To: Yao, Jiewen, devel@edk2.groups.io, jason.spottswood@hpe.com
[-- Attachment #1: Type: text/plain, Size: 2730 bytes --]
Hi Jason:
The behavior is defined in PFP spec v0.51 Chapter 8. 2 ACPI measuring points don’t comply with PFP spec. All ACPI DATA for EV_POST_CODE must be measured before fixup.
Tks for pointing it.
From: Yao, Jiewen
Sent: Wednesday, June 26, 2019 12:08 AM
To: devel@edk2.groups.io; jason.spottswood@hpe.com
Cc: Zhang, Chao B <chao.b.zhang@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
Subject: RE: [edk2-devel] TPM ACPI HID creation
Thanks Jason.
I think we should NOT measure TPM2 table *after* ACPI table patch.
The measurement should happen *before* ACPI table patch.
Hi Chao
Do you agree on that?
Thank you
Yao Jiewen
From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> [mailto:devel@edk2.groups.io] On Behalf Of jason.spottswood@hpe.com<mailto:jason.spottswood@hpe.com>
Sent: Tuesday, June 25, 2019 11:58 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Subject: [edk2-devel] TPM ACPI HID creation
Tcg2Smm.c has a function "UpdateHID to create the ACPI HID for the TPM. This function uses the TPM vendor ID combined with the firmware version number to create the ACPI HID. The use of the TPM firmware version is not specified in any spec from the TCG or otherwise that I have been able to find. I believe this was a design choice specific to EDK2. However, using the TPM firmware version does not match the intended use case from the TCG PC Client spec, where the HID should be comprised of the vendor ID and device ID. See below. One problem that arises from this design is that the ACPI tables will change when the TPM FW has been updated. Since the ACPI tables are hashed into PCR[0], it consequently means that a TPM FW change will cause a change to PCR[0]. It is not intuitive nor spec'd that TPM FW be included in PCR[0] measurements. In fact, PCR[0] is used only for system FW/UEFI code measurements. If a user does not update UEFI, then there is no expectation of PCR[0] measurement changes. I propose that EDK2 change the UpdateHID function to use the vendor ID and device ID read from register TPM_DID_VID_0 (locality 0 offset 0xF00) in the creation of the ACPI HID.
The following was taken from the TCG PC Client Platform Firmware spec:
According to the ACPI Specification (version 5, Errata A, Section 6.1.5 and 6.1.3) a
hardware ID or compatibility ID is either a PNP ID with format “AAA####” or ACPI ID
with format “NNNN####”. The manufacturer ID returned by a TPM2_GetCapability
command can be used to set the “AAA” or “NNNN” portion of the ID. The remaining four
hexadecimal digits should be set to a value that allows software to differentiate different
device classes built by the same manufacturer.
[-- Attachment #2: Type: text/html, Size: 9527 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-26 1:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-25 15:58 TPM ACPI HID creation jason.spottswood
2019-06-25 16:07 ` [edk2-devel] " Yao, Jiewen
2019-06-26 1:42 ` Zhang, Chao B
[not found] ` <15AB7CC2B08E2631.2932@groups.io>
2019-06-26 1:03 ` Yao, Jiewen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox