From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.158.5]) by mx.groups.io with SMTP id smtpd.web11.1676.1638387047622166561 for ; Wed, 01 Dec 2021 11:30:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ibm.com header.s=pp1 header.b=iTm3WQpc; spf=pass (domain: linux.ibm.com, ip: 148.163.158.5, mailfrom: stefanb@linux.ibm.com) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B1HmFIe007882 for ; Wed, 1 Dec 2021 19:30:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=pp1; bh=Q+UK0l352CNow8om8SB/CinNdLgL7+I3PBG50SSnhPE=; b=iTm3WQpc2kz9NP0kI5JlU5iOnwkxovDYDcJgkPfxv/Q6bDP9HaVKFYdp+PW4qIrbO9Zk hvzbplmvVXZVVtaS/0g6OuQYAkaocKf6HiNOXgnQTgYUHEz1T2R3NN7PcGj8Qix3xyh1 M7JoZnYjjKFF/RuRktfmwvRJhye4TDFfvLgEvL2TVND7/Za9Bu4PUWyI6UNzxWf/3kIV RM/hieOg5/TeFzOQhjuTtLi5YODFduyHd0oryz9JYLjmaacY4AMunXC0F/8kpfV2Olb7 K+LRyRqcQ/wt8WGY68XHe/brDl46EjBSPQxz0juZ9eNVdY3xI455O6Juyw6s4teNyw8U 4g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cpbn3599h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 01 Dec 2021 19:30:45 +0000 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1B1JRSce025089 for ; Wed, 1 Dec 2021 19:30:45 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cpbn35999-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Dec 2021 19:30:45 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1B1JCpM8005518; Wed, 1 Dec 2021 19:30:44 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma02dal.us.ibm.com with ESMTP id 3cn5f05vr6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Dec 2021 19:30:44 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1B1JUhll60621266 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Dec 2021 19:30:43 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 55F346E062; Wed, 1 Dec 2021 19:30:43 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9CD796E050; Wed, 1 Dec 2021 19:30:42 +0000 (GMT) Received: from sbct-2.pok.ibm.com (unknown [9.47.158.152]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 1 Dec 2021 19:30:42 +0000 (GMT) From: "Stefan Berger" To: devel@edk2.groups.io, kraxel@redhat.com, marcandre.lureau@redhat.com Cc: Stefan Berger Subject: [PATCH v3 0/8] Add support for TPM 1.2 Physical Presence Interface and Menu Date: Wed, 1 Dec 2021 14:30:22 -0500 Message-Id: <20211201193030.3932074-1-stefanb@linux.ibm.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: sGDqzX8chfL9ctnmM2qu9dzWznJq7ShU X-Proofpoint-GUID: 9ImxY6DtAuP-gsUtA0S--0fjYb61FzmA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-30_10,2021-12-01_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=749 impostorscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 spamscore=0 bulkscore=0 clxscore=1011 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112010102 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This series adds support for the full TPM 1.2 Physical Presence Interface (PPI) and activates the TPM 1.2 menu at the end. PPI is a prerequisite for the menu to work. The modifications to the original code are mostly due to the fact that we are using a memory region for PPI in QEMU. I tried to keep them at a minimum. For the PPI Flags I am using a EFI variable just like the original code does. (SecurityPkg/Library/DxeTcgPhysicalPresenceLib/DxeTcgPhysicalPresenceLib.c) The PhysicalPresenceFlags variable is write-protected (since v3) by adding an entry to AuthVariableLib.c. The consequence of locking the variable is that the processing of the physical presence opcodes, and with that write-access to that variable, had to be moved to before the end-of-DXE because afterwards it cannot be changed anymore. Regards, Stefan v3: - Moved processing of physical presence opcodes to before end-of-DXE - Write-protected PhysicalPresenceFlags variable by entry in AuthVariableLib.c v2: - Added patch that copies sources from SecurityPkg to OvmfPkg before changes - Use CONSTRUCTOR from DxeTcgPhysicalPresenceLib.inf - Other nits Gerd Hoffmann (1): OvmfPkg: add TPM 1.2 config menu Stefan Berger (7): OvmfPkg: Move processing of physical presence opcode before End-of-Dxe OvmfPkg: Check for TPM 2 early to leave function early SecurityPkg: Store physical presence code by submitting to PreOS func SecurityPkg: Declare PhysicalPresenceFlags variable and its properties OvmfPkg: Copy TPM 1.2 DxeTcgPhysicalPresenceLib.c from SecurityPkg OvmfPkg: Enable physical presence interface for TPM 1.2 OvmfPkg: Enable TPM 1.2 Physical Presence Opcode processing OvmfPkg/Bhyve/BhyveX64.dsc | 1 + .../PlatformBootManagerLib/BdsPlatform.c | 23 +- .../PlatformBootManagerLib.inf | 1 + .../PlatformBootManagerLibBhyve/BdsPlatform.c | 20 +- .../PlatformBootManagerLibGrub/BdsPlatform.c | 20 +- .../DxeTcg2PhysicalPresenceLib.c | 36 +- .../DxeTcgPhysicalPresenceLib.c | 22 + .../DxeTcgPhysicalPresenceLib.inf | 27 + .../DxeTcgPhysicalPresenceLib.c | 1448 +++++++++++++++++ .../DxeTcgPhysicalPresenceLib.inf | 64 + .../DxeTcgPhysicalPresenceLib.uni | 22 + .../PhysicalPresenceStrings.uni | 46 + OvmfPkg/Microvm/MicrovmX64.dsc | 1 + OvmfPkg/OvmfTpmComponentsDxe.dsc.inc | 1 + OvmfPkg/OvmfTpmDxe.fdf.inc | 1 + OvmfPkg/OvmfTpmLibs.dsc.inc | 4 + OvmfPkg/OvmfXen.dsc | 1 + .../Include/Library/TcgPhysicalPresenceLib.h | 39 + .../AuthVariableLib/AuthServiceInternal.h | 1 + .../Library/AuthVariableLib/AuthVariableLib.c | 11 + .../AuthVariableLib/AuthVariableLib.inf | 4 + .../DxeTcgPhysicalPresenceLib.c | 55 + SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDxe.inf | 1 + SecurityPkg/Tcg/TcgConfigDxe/TcgConfigImpl.c | 41 +- 24 files changed, 1819 insertions(+), 71 deletions(-) create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibNull/DxeTcgPhysicalPresenceLib.c create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibNull/DxeTcgPhysicalPresenceLib.inf create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibQemu/DxeTcgPhysicalPresenceLib.c create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibQemu/DxeTcgPhysicalPresenceLib.inf create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibQemu/DxeTcgPhysicalPresenceLib.uni create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibQemu/PhysicalPresenceStrings.uni -- 2.31.1