From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=stefanb@linux.vnet.ibm.com; receiver=edk2-devel@lists.01.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C125020965DFD for ; Fri, 18 May 2018 05:26:27 -0700 (PDT) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4ICOckE072872 for ; Fri, 18 May 2018 08:26:26 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j1uw4ysgy-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 18 May 2018 08:26:26 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 18 May 2018 06:26:25 -0600 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 18 May 2018 06:26:23 -0600 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4ICQMC211206912; Fri, 18 May 2018 05:26:22 -0700 Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 81E9C136044; Fri, 18 May 2018 06:26:22 -0600 (MDT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP id D6EB6136040; Fri, 18 May 2018 06:26:21 -0600 (MDT) To: marcandre.lureau@redhat.com, edk2-devel@lists.01.org Cc: pjones@redhat.com, jiewen.yao@intel.com, lersek@redhat.com, qemu-devel@nongnu.org, javierm@redhat.com References: <20180518122304.31020-1-marcandre.lureau@redhat.com> From: Stefan Berger Date: Fri, 18 May 2018 08:26:21 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180518122304.31020-1-marcandre.lureau@redhat.com> X-TM-AS-GCONF: 00 x-cbid: 18051812-0016-0000-0000-000008C0CE74 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009046; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000261; SDB=6.01034081; UDB=6.00528801; IPR=6.00813209; MB=3.00021182; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-18 12:26:24 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051812-0017-0000-0000-00003EC90449 Message-Id: <7ae4578a-e3e6-ee61-fca7-9d60a0030cf6@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-18_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805180138 Subject: Re: [PATCH v3 0/4] RFC: ovmf: Add support for TPM Physical Presence interface X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2018 12:26:28 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-MW On 05/18/2018 08:23 AM, marcandre.lureau@redhat.com wrote: > From: Marc-André Lureau > > Hi, > > The following series adds basic TPM PPI 1.3 support for OVMF-on-QEMU > with TPM2 (I haven't looked at TPM1, for lack of interest). > > PPI test runs successfully with Windows 10 WHLK, despite the limited > number of supported funcions (tpm2_ppi_funcs table, in particular, no > function allows to manipulate Tcg2PhysicalPresenceFlags) > > The way it works is relatively simple: a memory region is allocated by > QEMU to save PPI related variables. An ACPI interface is exposed by > QEMU to let the guest manipulate those. At boot, ovmf processes and > updates the PPI qemu region and request variables. > > I build edk2 with: > > $ build -DTPM2_ENABLE > > I test with qemu & swtpm/libtpms (tpm2 branches, swtpm_setup.sh --tpm2 > --tpm-state tpmstatedir) > > $ swtpm socket --tpmstate tpmstatedir --ctrl type=unixio,path=tpmsock > --tpm2 & Make this: swtpm socket --tpmstate dir=tpmstatedir --ctrl type=unixio,path=tpmsock --tpm2 > > $ qemu .. -chardev socket,id=chrtpm,path=tpmsock -tpmdev > emulator,id=tpm0,chardev=chrtpm -device tpm-crb,tpmdev=tpm0 > > Github trees: > https://github.com/elmarco/edk2/tree/tpm-ppi > https://github.com/elmarco/qemu/tree/tpm-ppi > > Thanks > > v3: after Laszlo review > - dropped DxeTcg2PhysicalPresenceLib.uni > - removed mTpm2PPIFuncs static initialization, use hard-coded assignments > - declared STATIC the functions that should be > - fixed an OUT/IN decorator > - use EFI_PROTOCOL_ERROR instead of EFI_INVALID_PARAMETER when PPI > initialization fails > - replaced EFI_D_INFO with DEBUG_INFO > - added a check for mPpi address that it doesn't cross a page boundary > - added a GetMemorySpaceDescriptor() check for memory type > - declared *mPpi as volatile, to correct mmio access > - a few more style changes > - comments updated > - some minor dead code/inclusion/defines removal > - added a few r-b tags > > v2: > - style and commit message fixes > > Marc-André Lureau (4): > OvmfPkg: add Tcg2PhysicalPresenceLibNull when !TPM2_ENABLE > OvmfPkg/IndustryStandard: add QemuTpm.h header > OvmfPkg: add Tcg2PhysicalPresenceLibQemu > OvmfPkg/PlatformBootManagerLib: process TPM PPI request > > OvmfPkg/OvmfPkgIa32.dsc | 4 +- > OvmfPkg/OvmfPkgIa32X64.dsc | 4 +- > OvmfPkg/OvmfPkgX64.dsc | 4 +- > .../PlatformBootManagerLib.inf | 2 + > .../DxeTcg2PhysicalPresenceLib.inf | 33 + > .../DxeTcg2PhysicalPresenceLib.inf | 46 +- > OvmfPkg/Include/IndustryStandard/QemuTpm.h | 69 ++ > .../PlatformBootManagerLib/BdsPlatform.c | 6 + > .../DxeTcg2PhysicalPresenceLib.c | 20 +- > .../DxeTcg2PhysicalPresenceLib.c | 919 ++++++++++++++++++ > .../PhysicalPresenceStrings.uni | 33 +- > 11 files changed, 1081 insertions(+), 59 deletions(-) > create mode 100644 OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf > copy {SecurityPkg/Library/DxeTcg2PhysicalPresenceLib => OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu}/DxeTcg2PhysicalPresenceLib.inf (66%) > create mode 100644 OvmfPkg/Include/IndustryStandard/QemuTpm.h > copy EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuSleep.c => OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.c (55%) > create mode 100644 OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.c > copy {SecurityPkg/Library/DxeTcg2PhysicalPresenceLib => OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu}/PhysicalPresenceStrings.uni (56%) >