From: Laszlo Ersek <lersek@redhat.com>
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
Subject: Re: [PATCH 2/4] ovmf: add QemuTpm.h header
Date: Thu, 17 May 2018 10:10:48 +0200 [thread overview]
Message-ID: <48283244-9534-24b8-263f-47d5fa9ff675@redhat.com> (raw)
In-Reply-To: <20180515123007.10164-3-marcandre.lureau@redhat.com>
On 05/15/18 14:30, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Add some common macros and type definitions corresponding to the QEMU
> TPM interface.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> OvmfPkg/Include/IndustryStandard/QemuTpm.h | 67 ++++++++++++++++++++++
> 1 file changed, 67 insertions(+)
> create mode 100644 OvmfPkg/Include/IndustryStandard/QemuTpm.h
>
> diff --git a/OvmfPkg/Include/IndustryStandard/QemuTpm.h b/OvmfPkg/Include/IndustryStandard/QemuTpm.h
> new file mode 100644
> index 000000000000..054cf79374b5
> --- /dev/null
> +++ b/OvmfPkg/Include/IndustryStandard/QemuTpm.h
> @@ -0,0 +1,67 @@
> +/** @file
> + Macro and type definitions corresponding to the QEMU TPM interface.
> +
> + Refer to "docs/specs/tpm.txt" in the QEMU source directory.
> +
> + Copyright (C) 2018, Red Hat, Inc.
> + Copyright (c) 2018, IBM Corporation. All rights reserved.<BR>
> +
> + This program and the accompanying materials are licensed and made available
> + under the terms and conditions of the BSD License which accompanies this
> + distribution. The full text of the license may be found at
> + http://opensource.org/licenses/bsd-license.php
> +
> + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
> + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +**/
> +
> +#ifndef __QEMU_TPM_H__
> +#define __QEMU_TPM_H__
> +
> +#include <Base.h>
> +
> +/* whether function is blocked by BIOS settings; bits 0, 1, 2 */
> +#define QEMU_TPM_PPI_FUNC_NOT_IMPLEMENTED (0 << 0)
> +#define QEMU_TPM_PPI_FUNC_BIOS_ONLY (1 << 0)
> +#define QEMU_TPM_PPI_FUNC_BLOCKED (2 << 0)
> +#define QEMU_TPM_PPI_FUNC_ALLOWED_USR_REQ (3 << 0)
> +#define QEMU_TPM_PPI_FUNC_ALLOWED_USR_NOT_REQ (4 << 0)
> +#define QEMU_TPM_PPI_FUNC_MASK (7 << 0)
> +
> +//
> +// The following structure is shared between firmware and ACPI.
> +//
> +#pragma pack (1)
> +typedef struct {
> + UINT8 Func[256]; /* func */
> + UINT8 In; /* ppin */
> + UINT32 Ip; /* ppip */
> + UINT32 Response; /* pprp */
> + UINT32 Request; /* pprq */
> + UINT32 RequestParameter; /* pprm */
> + UINT32 LastRequest; /* lppr */
> + UINT32 FRet; /* fret */
> + UINT8 Res1[0x40]; /* res1 */
> + UINT8 NextStep; /* next_step */
> +} QEMU_TPM_PPI;
> +#pragma pack ()
> +
> +//
> +// The following structure is for the fw_cfg etc/tpm/config file.
> +//
> +#pragma pack (1)
> +typedef struct {
> + UINT32 PpiAddress;
> + UINT8 TpmVersion;
> + UINT8 PpiVersion;
> +} QEMU_FWCFG_TPM_CONFIG;
> +#pragma pack ()
> +
> +#define QEMU_TPM_VERSION_UNSPEC 0
> +#define QEMU_TPM_VERSION_1_2 1
> +#define QEMU_TPM_VERSION_2 2
> +
> +#define QEMU_TPM_PPI_VERSION_NONE 0
> +#define QEMU_TPM_PPI_VERSION_1_30 1
> +
> +#endif
>
(1) Please update the subject line as discussed earlier; for example:
OvmfPkg/IndustryStandard: add QemuTpm.h header
(2) Please convert the file to CRLF.
(3) Please use the "// ..." comment style near the fields of QEMU_TPM_PPI.
(4) Please align the member identifiers in each of QEMU_TPM_PPI and
QEMU_FWCFG_TPM_CONFIG -- in practice this means inserting another space
char after each "UINT8" type name.
With those changes:
Acked-by: Laszlo Ersek <lersek@redhat.com>
Thanks!
Laszlo
next prev parent reply other threads:[~2018-05-17 8:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-15 12:30 [PATCH 0/4] RFC: ovmf: Add support for TPM Physical Presence interface marcandre.lureau
2018-05-15 12:30 ` [PATCH 1/4] ovmf: add and link with Tcg2PhysicalPresenceLibNull when !TPM2_ENABLE marcandre.lureau
2018-05-17 7:58 ` Laszlo Ersek
2018-05-15 12:30 ` [PATCH 2/4] ovmf: add QemuTpm.h header marcandre.lureau
2018-05-17 8:10 ` Laszlo Ersek [this message]
2018-05-15 12:30 ` [PATCH 3/4] ovmf: replace SecurityPkg with OvfmPkg Tcg2PhysicalPresenceLibQemu marcandre.lureau
2018-05-17 10:14 ` Laszlo Ersek
2018-05-15 12:30 ` [PATCH 4/4] ovmf: process TPM PPI request in AfterConsole() marcandre.lureau
2018-05-17 10:24 ` Laszlo Ersek
2018-05-16 9:29 ` [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-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=48283244-9534-24b8-263f-47d5fa9ff675@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