[Qemu-devel] [PATCH v2 00/28] TPM: code cleanup (not 2.11)

Marc-André Lureau posted 28 patches 6 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20171106183925.16747-1-marcandre.lureau@redhat.com
Test checkpatch passed
Test docker passed
Test ppc passed
Test s390x passed
hw/tpm/tpm_int.h                 | 22 +----------
hw/tpm/tpm_util.h                |  8 +++-
include/hw/qdev-properties.h     |  3 ++
include/sysemu/tpm.h             | 48 +++++++++++++++++------
include/sysemu/tpm_backend.h     | 32 ++++++----------
backends/tpm.c                   | 83 +++++++++++++---------------------------
hw/core/qdev-properties-system.c | 64 +++++++++++++++++++++++++++++++
hw/i386/acpi-build.c             | 14 ++++---
hw/tpm/tpm_emulator.c            | 59 +++++++++++++++-------------
hw/tpm/tpm_passthrough.c         | 66 +++++++++++---------------------
hw/tpm/tpm_tis.c                 | 83 +++++++++++++++-------------------------
tpm.c                            | 34 ++++++----------
12 files changed, 255 insertions(+), 261 deletions(-)
[Qemu-devel] [PATCH v2 00/28] TPM: code cleanup (not 2.11)
Posted by Marc-André Lureau 6 years, 4 months ago
Hi,

Various code cleanups accumulated while doing reviews and implementing
a CRB device (postponed for later), aiming at a tpm-next development
branch for after qemu 2.11.

v2: after Stefan review
- rebased (half of v1 is merged upstream)
- add & use a DEFINE_PROP_TPMBE()
- remove tpm_register_model()
- fix wrong locty_number usage & regression
- tpm-tis: check that at most one TPM device exists
- I changed "tpm-passthrough: remove error cleanup from
  handle_device_opts" to "tpm-passthrough: simplify create()", it is
  mostly the same patch that Stefan didn't like much but with a
  different rationale to have code closer to tpm-emulator create().
- added some signed-offs

Marc-André Lureau (28):
  tpm-tis: remove unused locty_number
  tpm: move TpmIf in include/sysemu/tpm.h
  tpm-backend: store TPMIf interface, improve backend_init()
  tpm-tis: no longer expose TPMState
  tpm-be: call request_completed() out of thread
  tpm-be: report error instead of front-end
  tpm-be: ask model to the TPM interface
  tpm: remove unused opened code
  tpm-passthrough: don't save guessed cancel_path in options
  tpm-be: update optional function pointers
  tpm-passthrough: pass TPMPassthruState to handle_device_opts
  tpm-backend: move set 'id' to common code
  tpm-passthrough: make it safer to destroy after creation
  tpm-passthrough: simplify create()
  tpm-passthrough: workaround a possible race
  tpm-tis: simplify header inclusion
  tpm: rename qemu_find_tpm() -> qemu_find_tpm_be()
  tpm: lookup the the TPM interface instead of TIS device
  tpm: add TPM interface to lookup TPM version
  tpm: add tpm_cmd_get_size() to tpm_util
  acpi: change TPM TIS data conditions
  tpm-emulator: add a FIXME comment about blocking cancel
  tpm-tis: remove redundant 'tpm_tis:' in error messages
  tpm-tis: check that at most one TPM device exists
  tpm-emulator: protect concurrent ctrl_chr access
  qdev: add DEFINE_PROP_TPMBE
  tpm-tis: use DEFINE_PROP_TPMBE
  tpm: remove tpm_register_model()

 hw/tpm/tpm_int.h                 | 22 +----------
 hw/tpm/tpm_util.h                |  8 +++-
 include/hw/qdev-properties.h     |  3 ++
 include/sysemu/tpm.h             | 48 +++++++++++++++++------
 include/sysemu/tpm_backend.h     | 32 ++++++----------
 backends/tpm.c                   | 83 +++++++++++++---------------------------
 hw/core/qdev-properties-system.c | 64 +++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c             | 14 ++++---
 hw/tpm/tpm_emulator.c            | 59 +++++++++++++++-------------
 hw/tpm/tpm_passthrough.c         | 66 +++++++++++---------------------
 hw/tpm/tpm_tis.c                 | 83 +++++++++++++++-------------------------
 tpm.c                            | 34 ++++++----------
 12 files changed, 255 insertions(+), 261 deletions(-)

-- 
2.15.0.rc0.40.gaefcc5f6f


Re: [Qemu-devel] [PATCH v2 00/28] TPM: code cleanup (not 2.11)
Posted by Stefan Berger 6 years, 4 months ago
On 11/06/2017 01:38 PM, Marc-André Lureau wrote:
> Hi,
>
> Various code cleanups accumulated while doing reviews and implementing
> a CRB device (postponed for later), aiming at a tpm-next development
> branch for after qemu 2.11.

I put all of these now into a tpm-next branch here.

https://github.com/stefanberger/qemu-tpm/commits/tpm-next

This includes 25/28 until I rebase tpm-next on a later 2.11.

All my tests succeeded.

    Stefan


>
> v2: after Stefan review
> - rebased (half of v1 is merged upstream)
> - add & use a DEFINE_PROP_TPMBE()
> - remove tpm_register_model()
> - fix wrong locty_number usage & regression
> - tpm-tis: check that at most one TPM device exists
> - I changed "tpm-passthrough: remove error cleanup from
>    handle_device_opts" to "tpm-passthrough: simplify create()", it is
>    mostly the same patch that Stefan didn't like much but with a
>    different rationale to have code closer to tpm-emulator create().
> - added some signed-offs
>
> Marc-André Lureau (28):
>    tpm-tis: remove unused locty_number
>    tpm: move TpmIf in include/sysemu/tpm.h
>    tpm-backend: store TPMIf interface, improve backend_init()
>    tpm-tis: no longer expose TPMState
>    tpm-be: call request_completed() out of thread
>    tpm-be: report error instead of front-end
>    tpm-be: ask model to the TPM interface
>    tpm: remove unused opened code
>    tpm-passthrough: don't save guessed cancel_path in options
>    tpm-be: update optional function pointers
>    tpm-passthrough: pass TPMPassthruState to handle_device_opts
>    tpm-backend: move set 'id' to common code
>    tpm-passthrough: make it safer to destroy after creation
>    tpm-passthrough: simplify create()
>    tpm-passthrough: workaround a possible race
>    tpm-tis: simplify header inclusion
>    tpm: rename qemu_find_tpm() -> qemu_find_tpm_be()
>    tpm: lookup the the TPM interface instead of TIS device
>    tpm: add TPM interface to lookup TPM version
>    tpm: add tpm_cmd_get_size() to tpm_util
>    acpi: change TPM TIS data conditions
>    tpm-emulator: add a FIXME comment about blocking cancel
>    tpm-tis: remove redundant 'tpm_tis:' in error messages
>    tpm-tis: check that at most one TPM device exists
>    tpm-emulator: protect concurrent ctrl_chr access
>    qdev: add DEFINE_PROP_TPMBE
>    tpm-tis: use DEFINE_PROP_TPMBE
>    tpm: remove tpm_register_model()
>
>   hw/tpm/tpm_int.h                 | 22 +----------
>   hw/tpm/tpm_util.h                |  8 +++-
>   include/hw/qdev-properties.h     |  3 ++
>   include/sysemu/tpm.h             | 48 +++++++++++++++++------
>   include/sysemu/tpm_backend.h     | 32 ++++++----------
>   backends/tpm.c                   | 83 +++++++++++++---------------------------
>   hw/core/qdev-properties-system.c | 64 +++++++++++++++++++++++++++++++
>   hw/i386/acpi-build.c             | 14 ++++---
>   hw/tpm/tpm_emulator.c            | 59 +++++++++++++++-------------
>   hw/tpm/tpm_passthrough.c         | 66 +++++++++++---------------------
>   hw/tpm/tpm_tis.c                 | 83 +++++++++++++++-------------------------
>   tpm.c                            | 34 ++++++----------
>   12 files changed, 255 insertions(+), 261 deletions(-)
>