public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>,
	edk2-devel@lists.01.org
Cc: Jiewen Yao <jiewen.yao@intel.com>,
	Stefan Berger <stefanb@linux.vnet.ibm.com>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Peter Jones <pjones@redhat.com>,
	"Jordan Justen (Intel address)" <jordan.l.justen@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: Enabling TPM support in ovmf & hang during qemu boot
Date: Mon, 13 Nov 2017 12:26:44 +0100	[thread overview]
Message-ID: <3b8f8c78-99c1-6a54-2251-6c476c9a472f@redhat.com> (raw)
In-Reply-To: <CAJ+F1CJ6DA58Je6cArnORSpYa7TKLDi93sYtgP0T38UH+PqzhQ@mail.gmail.com>

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
<https://bugzilla.tianocore.org/show_bug.cgi?id=386>. 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


  reply	other threads:[~2017-11-13 11:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-12 19:09 Enabling TPM support in ovmf & hang during qemu boot Marc-André Lureau
2017-11-13 11:26 ` Laszlo Ersek [this message]
2017-11-13 14:21   ` Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b8f8c78-99c1-6a54-2251-6c476c9a472f@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox