[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 5/5] tpm: add CRB device
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v4 5/5] tpm: add CRB device |
Date: |
Wed, 31 Jan 2018 16:01:43 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Marc-André Lureau <address@hidden> writes:
> tpm_crb is a device for TPM 2.0 Command Response Buffer (CRB)
> Interface as defined in TCG PC Client Platform TPM Profile (PTP)
> Specification Family “2.0” Level 00 Revision 01.03 v22.
>
> The PTP allows device implementation to switch between TIS and CRB
> model at run time, but given that CRB is a simpler device to
> implement, I chose to implement it as a different device.
>
> The device doesn't implement other locality than 0 for now (my laptop
> TPM doesn't either, so I assume this isn't so bad)
>
> Tested with some success with Linux upstream and Windows 10, seabios &
> modified ovmf. The device is recognized and correctly transmit
> command/response with passthrough & emu. However, we are missing PPI
> ACPI part atm.
>
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
> qapi/tpm.json | 5 +-
> include/hw/acpi/tpm.h | 51 +++++++
> include/sysemu/tpm.h | 3 +
> hw/i386/acpi-build.c | 34 ++++-
> hw/tpm/tpm_crb.c | 303
> +++++++++++++++++++++++++++++++++++++
> tests/tpm-crb-test.c | 275 +++++++++++++++++++++++++++++++++
> default-configs/i386-softmmu.mak | 1 +
> default-configs/x86_64-softmmu.mak | 1 +
> hw/tpm/Makefile.objs | 1 +
> tests/Makefile.include | 2 +
> 10 files changed, 666 insertions(+), 10 deletions(-)
> create mode 100644 hw/tpm/tpm_crb.c
> create mode 100644 tests/tpm-crb-test.c
>
> diff --git a/qapi/tpm.json b/qapi/tpm.json
> index 7093f268fb..d50deef5e9 100644
> --- a/qapi/tpm.json
> +++ b/qapi/tpm.json
> @@ -11,10 +11,11 @@
> # An enumeration of TPM models
> #
> # @tpm-tis: TPM TIS model
> +# @tpm-crb: TPM CRB model (since 2.12)
> #
> # Since: 1.5
> ##
> -{ 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
> +{ 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb' ] }
>
> ##
> # @query-tpm-models:
> @@ -28,7 +29,7 @@
> # Example:
> #
> # -> { "execute": "query-tpm-models" }
> -# <- { "return": [ "tpm-tis" ] }
> +# <- { "return": [ "tpm-tis", "tpm-crb" ] }
> #
> ##
> { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
QAPI Schema change looks good to me.
- [Qemu-devel] [PATCH v4 0/5] tpm: CRB device and cleanups, Marc-André Lureau, 2018/01/29
- [Qemu-devel] [PATCH v4 1/5] tpm: fix alignment issues, Marc-André Lureau, 2018/01/29
- [Qemu-devel] [PATCH v4 2/5] tpm: lookup cancel path under tpm device class, Marc-André Lureau, 2018/01/29
- [Qemu-devel] [PATCH v4 3/5] tpm: replace GThreadPool with AIO threadpool, Marc-André Lureau, 2018/01/29
- [Qemu-devel] [PATCH v4 4/5] tpm: report backend request error, Marc-André Lureau, 2018/01/29
- [Qemu-devel] [PATCH v4 5/5] tpm: add CRB device, Marc-André Lureau, 2018/01/29
- Re: [Qemu-devel] [PATCH v4 5/5] tpm: add CRB device,
Markus Armbruster <=