All of lore.kernel.org
 help / color / mirror / Atom feed
From: marcandre.lureau@redhat.com
To: edk2-devel@lists.01.org
Cc: pjones@redhat.com, jiewen.yao@intel.com,
	stefanb@linux.vnet.ibm.com, lersek@redhat.com,
	qemu-devel@nongnu.org, javierm@redhat.com,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH 0/4] RFC: ovmf: Add support for TPM Physical Presence interface
Date: Tue, 15 May 2018 14:30:03 +0200	[thread overview]
Message-ID: <20180515123007.10164-1-marcandre.lureau@redhat.com> (raw)

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Hi,

The following series adds basic TPM PPI 1.3 support for OVMF-on-QEMU
with TPM2 (I haven't tested 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 -DSECURE_BOOT_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

Marc-André Lureau (4):
  ovmf: add and link with Tcg2PhysicalPresenceLibNull when !TPM2_ENABLE
  ovmf: add QemuTpm.h header
  ovmf: replace SecurityPkg with OvfmPkg Tcg2PhysicalPresenceLibQemu
  ovmf: process TPM PPI request in AfterConsole()

 OvmfPkg/Include/IndustryStandard/QemuTpm.h    |  67 ++
 .../PlatformBootManagerLib/BdsPlatform.c      |   8 +
 .../PlatformBootManagerLib.inf                |   2 +
 .../DxeTcg2PhysicalPresenceLib.c              |  26 +
 .../DxeTcg2PhysicalPresenceLib.inf            |  34 +
 .../DxeTcg2PhysicalPresenceLib.c              | 881 ++++++++++++++++++
 .../DxeTcg2PhysicalPresenceLib.inf            |  67 ++
 .../DxeTcg2PhysicalPresenceLib.uni            |  26 +
 .../PhysicalPresenceStrings.uni               |  49 +
 OvmfPkg/OvmfPkgIa32.dsc                       |   4 +-
 OvmfPkg/OvmfPkgIa32X64.dsc                    |   4 +-
 OvmfPkg/OvmfPkgX64.dsc                        |   4 +-
 12 files changed, 1169 insertions(+), 3 deletions(-)
 create mode 100644 OvmfPkg/Include/IndustryStandard/QemuTpm.h
 create mode 100644 OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.c
 create mode 100644 OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf
 create mode 100644 OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.c
 create mode 100644 OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf
 create mode 100644 OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.uni
 create mode 100644 OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/PhysicalPresenceStrings.uni

-- 
2.17.0.253.g3dd125b46d

             reply	other threads:[~2018-05-15 12:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15 12:30 marcandre.lureau [this message]
2018-05-15 12:30 ` [Qemu-devel] [PATCH 1/4] ovmf: add and link with Tcg2PhysicalPresenceLibNull when !TPM2_ENABLE marcandre.lureau
2018-05-17  7:58   ` [Qemu-devel] [edk2] " Laszlo Ersek
2018-05-15 12:30 ` [Qemu-devel] [PATCH 2/4] ovmf: add QemuTpm.h header marcandre.lureau
2018-05-17  8:10   ` [Qemu-devel] [edk2] " Laszlo Ersek
2018-05-15 12:30 ` [Qemu-devel] [PATCH 3/4] ovmf: replace SecurityPkg with OvfmPkg Tcg2PhysicalPresenceLibQemu marcandre.lureau
2018-05-17 10:14   ` [Qemu-devel] [edk2] " Laszlo Ersek
2018-05-15 12:30 ` [Qemu-devel] [PATCH 4/4] ovmf: process TPM PPI request in AfterConsole() marcandre.lureau
2018-05-17 10:24   ` [Qemu-devel] [edk2] " Laszlo Ersek
2018-05-16  9:29 ` [Qemu-devel] [edk2] [PATCH 0/4] RFC: ovmf: Add support for TPM Physical Presence interface Laszlo Ersek
2018-05-17  7:41   ` Laszlo Ersek
2018-05-17 14:43   ` Marc-André Lureau
2018-05-17 14:58     ` Laszlo Ersek
2018-05-17  7:54 ` Laszlo Ersek
2018-05-17  8:26   ` Laszlo Ersek
2018-05-17 14:44   ` Marc-André Lureau

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=20180515123007.10164-1-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=edk2-devel@lists.01.org \
    --cc=javierm@redhat.com \
    --cc=jiewen.yao@intel.com \
    --cc=lersek@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.