From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 6DA4820349D8A for ; Mon, 13 Nov 2017 03:22:43 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B1B5D793E8; Mon, 13 Nov 2017 11:26:48 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-226.rdu2.redhat.com [10.10.120.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id F065E6C932; Mon, 13 Nov 2017 11:26:44 +0000 (UTC) To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , edk2-devel@lists.01.org Cc: Jiewen Yao , Stefan Berger , Javier Martinez Canillas , Peter Jones , "Jordan Justen (Intel address)" , Ard Biesheuvel References: From: Laszlo Ersek Message-ID: <3b8f8c78-99c1-6a54-2251-6c476c9a472f@redhat.com> Date: Mon, 13 Nov 2017 12:26:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 13 Nov 2017 11:26:48 +0000 (UTC) Subject: Re: Enabling TPM support in ovmf & hang during qemu boot X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Nov 2017 11:22:43 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 11/12/17 20:09, Marc-André Lureau wrote: > Hi, > > I use the attached patch to build OVMF with TPM support. > > Even without any TPM device configured (with the following qemu > command line) the VM hangs early: > > qemu-system-x86_64 -enable-kvm -m 1024 -global > isa-debugcon.iobase=0x402 -debugcon file:ovmf.log -drive > if=pflash,format=raw,file=...src/edk2/Build/OvmfX64/DEBUG_GCC5/FV/OVMF_CODE.fd,readonly > -drive if=pflash,format=raw,file=...src/edk2/Build/OvmfX64/DEBUG_GCC5/FV/OVMF_VARS.fd > > I don't have much clue how to debug OVMF, but adding DEBUG lines, I > could learn that during ReserveEmuVariableNvStore(), GetNextHob() runs > an infinite loop, looking for EFI_HOB_TYPE_UNUSED. > > How is the HobList populated? Is it possible to add more of the UNUSED entries? > > Any help welcome > * Neither Tcg2ConfigPei nor Tcg2Pei depend, in their INF files' [depex] section, on "permanent RAM has been discovered" (= gEfiPeiMemoryDiscoveredPpiGuid). This means that they can be dispatched before OvmfPkg/PlatformPei installs the permanent PEI RAM. Therefore, if they call PeiServicesAllocatePages(), the allocation likely runs out of the -- very small -- termporary PEI RAM that we have in OVMF. The way to mitigate this is either to increase the temp PEI RAM (I already have such a set on the list, but for different purposes -- and this approach only works if the needed memory is really small), or to make both of these PEIMs dependent on gEfiPeiMemoryDiscoveredPpiGuid. I can't say -- Jiewen, would it be OK to make these PEIMs dependent on gEfiPeiMemoryDiscoveredPpiGuid? * Both PEIMs depend on PEI-phase read-only variable access (gEfiPeiReadOnlyVariable2PpiGuid). However, OVMF does not include the required drivers at the moment -- see . I had posted a series for that back in ~March 2017, but Jordan disagreed with them. (I think each of us remains unconvinced by the other's points, from the original thread.) Thanks Laszlo