From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 8AD5D2034860B for ; Tue, 22 May 2018 07:38:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C5F5B40201A9; Tue, 22 May 2018 14:38:14 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-18.rdu2.redhat.com [10.10.120.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 628D3215CDA7; Tue, 22 May 2018 14:38:13 +0000 (UTC) To: marcandre.lureau@redhat.com, edk2-devel@lists.01.org Cc: qemu-devel@nongnu.org, javierm@redhat.com, pjones@redhat.com, jiewen.yao@intel.com References: <20180518122304.31020-1-marcandre.lureau@redhat.com> From: Laszlo Ersek Message-ID: Date: Tue, 22 May 2018 16:38:12 +0200 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-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 22 May 2018 14:38:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 22 May 2018 14:38:14 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' 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: Tue, 22 May 2018 14:38:15 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 05/18/18 14:23, 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 & > > $ 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%) > I briefly summarized the updates that I mentioned in review on the patches themselves, and pushed the series as commit range 75135cc6988e..8d65d3b25e35. Thank you guys again! Laszlo