From: Javier Martinez Canillas <javierm@redhat.com>
To: "Laszlo Ersek" <lersek@redhat.com>,
"Jiewen Yao" <jiewen.yao@intel.com>,
"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
"Peter Jones" <pjones@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Amarnath Valluri" <amarnath.valluri@intel.com>
Cc: edk2-devel-01 <edk2-devel@lists.01.org>,
qemu devel list <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] investigating TPM for OVMF-on-QEMU
Date: Mon, 17 Jul 2017 11:04:44 +0200 [thread overview]
Message-ID: <1c955fdc-90d5-4bdd-3518-815595bbfd70@redhat.com> (raw)
In-Reply-To: <eef9a031-36e9-0443-1d73-30a49df02e9a@redhat.com>
Hello Laszlo,
Thanks a lot for the great summary.
On 07/14/2017 08:04 PM, Laszlo Ersek wrote:
[snip]
>
> Here I should mention some ACPI and hardware aspects. Under TPM1
> (whose ACPI table was called "TCPA"), the TPM events (measurements
> I think) were logged in a reserved memory area described by the
> TCPA table. Under TPM2, the "TPM2" ACPI table does no such thing,
> it only helps identify the communication characteristics of the
> device, and the event log itself is accessible to the OS boot
> loader via the EFI_TCG2_PROTOCOL.
>
> (If you are curious how a legacy BIOS boot loader is supposed to
> read the event log from a TPM2-only device (no "TCPA" table): I
> don't have the slightest clue.)
>
The latest "TCG ACPI Specification" draft from February 27, 2017 mentions that
the TPM2 table contains the LAML and LASA fields for the TPM event logs memory
area. But as Stefan pointed out this is just a draft, and has this disclaimer:
"Work in Progress:
This document is an intermediate draft for comment only and is subject to change
without notice. Readers should not design products based on this document."
So I think that will be supported in the future (if the draft doesn't change and
is published).
> I'm not sure about the exact characteristics of the virtual TPM
> that Stefan's swtpm project:
>
> https://github.com/stefanberger/swtpm
>
> combined with Amarnath's pending QEMU patches:
>
> http://mid.mail-archive.com/1496666711-14630-1-git-send-email-amarnath.valluri@intel.com
>
> will expose to the guest. What I do know is that the current QEMU
> solution, which mostly forwards a physical (host) TPM to the guest,
> produces a "TPM2" ACPI table if said host TPM device is TPM2. The
> "TPM2" table is exposed to the guest OS with OVMF's help, and has
> the following fields:
>
> - address of control area: zero
> - start method: 6 (TIS plus Cancel)
> - platform specific params: none.
>
> This implies that neither ACPI activation (method 2) nor Command
> Response Buffer activation (method 7) nor a combination of these
> two (method 8) is available in QEMU.
>
Even when QEMU always exposes a start method 6 (TIS + cancel) in its TPM2 table
to the guest, pass-through works when the host TPM advertises a different start
method.
For example I've a laptop with an Intel PTT fTPM and the start method is 2, but
I'm able to access the host TPM2 from the guest using the Linux tpm_tis driver.
>
> In brief, by not including these two modules, we avoid a "TPM2"
> ACPI table duplication. We also turn off the Memory Overwrite
> Request and Physical Presence Interface features -- which are both
> optional, as far as I can see, and very messy for OVMF's platform
> code.
>
Agreed.
> (3) Drivers (and features) that are *not in edk2/SecurityPkg/Tcg:
>
> The Intel whitepaper discusses (and Peter also mentioned earlier)
> "dTPM" versus "fTPM".
>
> "dTPM" is basically TPM provided in publicly specified hardware,
> where the firmware can offer support, such as EFI_TCG2_PROTOCOL, but
> the OS can also directly drive the hardware. This is what QEMU
> offers with the TIS+Cancel start method (value 6). (The "Command
> Response Buffer" start method (value 7) would also qualify as
> "dTPM"). When the platform provides "dTPM", the _DSM method
> described above *may* be offered, but it is not required.
>
> "fTPM" is where the hardware is completely hidden from the OS, and
> is implemented fully in firmware. The corresponding start method
> values are 2 ("ACPI") and 8 ("ACPI with CRB"). In this case, the
> _DSM method is *required*.
>
> To my understanding, edk2 contains no "fTPM" implementation. The
> in-tree drivers recognize hardware that describes itself as
> TIS+Cancel (6) or CRB (7). Pure ACPI variants are neither recognized
> nor offered.
>
That's my understanding as well. I see that the Valley View 2 / Minnowboard Max
platform pkg (Vlv2TbltDevicePkg) as references to fTPM and a FTPM_ENABLE var to
enable it, but IIUC the fTPM driver is distributed as proprietary binary files:
https://firmware.intel.com/projects/minnowboard-max
> I think TIS+Cancel / dTPM is the best match: the emulated TPM has to
> be implemented in virtual hardware (not just faked within the guest,
> in RAM), so that QEMU can secure the sensitive stuff from guest
> kernel level access.
>
Agreed.
Best regards,
--
Javier Martinez Canillas
Software Engineer - Desktop Hardware Enablement
Red Hat
prev parent reply other threads:[~2017-07-17 9:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-14 18:04 [Qemu-devel] investigating TPM for OVMF-on-QEMU Laszlo Ersek
2017-07-14 20:30 ` Peter Jones
2017-07-14 21:31 ` [Qemu-devel] [edk2] " Laszlo Ersek
2017-07-17 2:03 ` [Qemu-devel] " Yao, Jiewen
2017-07-17 9:04 ` Javier Martinez Canillas [this message]
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-all 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=1c955fdc-90d5-4bdd-3518-815595bbfd70@redhat.com \
--to=javierm@redhat.com \
--cc=amarnath.valluri@intel.com \
--cc=edk2-devel@lists.01.org \
--cc=jiewen.yao@intel.com \
--cc=lersek@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pjones@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.vnet.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).