[Qemu-devel] [PULL v1 00/32] Merge tpm 2017/12/15

Stefan Berger posted 32 patches 7 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1513446109-9013-1-git-send-email-stefanb@linux.vnet.ibm.com
Test checkpatch passed
Test docker passed
Test ppc passed
Test s390x passed
backends/tpm.c                   |  92 +++++++++++++++-----------------------
hw/core/qdev-properties-system.c |  64 +++++++++++++++++++++++++++
hw/i386/acpi-build.c             |  14 +++---
hw/tpm/tpm_emulator.c            |  98 ++++++++++++++++++++++++++++++++++------
hw/tpm/tpm_int.h                 |  31 +++++--------
hw/tpm/tpm_ioctl.h               |  28 +++++++++++-
hw/tpm/tpm_passthrough.c         |  90 ++++++++++++++++++++-----------------
hw/tpm/tpm_tis.c                 | 101 +++++++++++++++++-------------------------
hw/tpm/tpm_util.c                | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
hw/tpm/tpm_util.h                |  11 ++++-
include/hw/qdev-properties.h     |   3 ++
include/sysemu/tpm.h             |  48 +++++++++++++++-----
include/sysemu/tpm_backend.h     |  50 +++++++++++----------
tpm.c                            |  34 +++++---------
14 files changed, 553 insertions(+), 266 deletions(-)
[Qemu-devel] [PULL v1 00/32] Merge tpm 2017/12/15
Posted by Stefan Berger 7 years, 10 months ago
The following patch series refactors the TPM TIS and backend drivers for
easier addition of new front-end devices. Further, the TPM buffer sizes
are read from the backend and the backend's buffer size can be adjusted
by the frontend, if necessary.


The following changes since commit 0ef0583d5adceb9138bdb47494dabd1549ac5b6d:

  Merge remote-tracking branch 'remotes/dgilbert/tags/pull-hmp-20171214' into staging (2017-12-14 15:32:32 +0000)

are available in the git repository at:

  git://github.com/stefanberger/qemu-tpm.git tags/pull-tpm-2017-12-15-1

for you to fetch changes up to 683c4b775355cc7acd301e8efe7d4c1c9acdafd8:

  tpm: tpm_passthrough: Fail startup if FE buffer size < BE buffer size (2017-12-14 23:39:15 -0500)

----------------------------------------------------------------
Merge tpm 2017/12/15 v1

----------------------------------------------------------------
Marc-André Lureau (27):
      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
      qdev: add DEFINE_PROP_TPMBE
      tpm-tis: use DEFINE_PROP_TPMBE
      tpm: remove tpm_register_model()

Stefan Berger (5):
      tpm: Move getting TPM buffer size to backends
      tpm: pull tpm_util_request() out of tpm_util_test()
      tpm: tpm_passthrough: Read the buffer size from the host device
      tpm: tpm_emulator: get and set buffer size of device
      tpm: tpm_passthrough: Fail startup if FE buffer size < BE buffer size

 backends/tpm.c                   |  92 +++++++++++++++-----------------------
 hw/core/qdev-properties-system.c |  64 +++++++++++++++++++++++++++
 hw/i386/acpi-build.c             |  14 +++---
 hw/tpm/tpm_emulator.c            |  98 ++++++++++++++++++++++++++++++++++------
 hw/tpm/tpm_int.h                 |  31 +++++--------
 hw/tpm/tpm_ioctl.h               |  28 +++++++++++-
 hw/tpm/tpm_passthrough.c         |  90 ++++++++++++++++++++-----------------
 hw/tpm/tpm_tis.c                 | 101 +++++++++++++++++-------------------------
 hw/tpm/tpm_util.c                | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 hw/tpm/tpm_util.h                |  11 ++++-
 include/hw/qdev-properties.h     |   3 ++
 include/sysemu/tpm.h             |  48 +++++++++++++++-----
 include/sysemu/tpm_backend.h     |  50 +++++++++++----------
 tpm.c                            |  34 +++++---------
 14 files changed, 553 insertions(+), 266 deletions(-)

-- 
2.5.5


Re: [Qemu-devel] [PULL v1 00/32] Merge tpm 2017/12/15
Posted by Peter Maydell 7 years, 10 months ago
On 16 December 2017 at 17:41, Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:
> The following patch series refactors the TPM TIS and backend drivers for
> easier addition of new front-end devices. Further, the TPM buffer sizes
> are read from the backend and the backend's buffer size can be adjusted
> by the frontend, if necessary.
>
>
> The following changes since commit 0ef0583d5adceb9138bdb47494dabd1549ac5b6d:
>
>   Merge remote-tracking branch 'remotes/dgilbert/tags/pull-hmp-20171214' into staging (2017-12-14 15:32:32 +0000)
>
> are available in the git repository at:
>
>   git://github.com/stefanberger/qemu-tpm.git tags/pull-tpm-2017-12-15-1
>
> for you to fetch changes up to 683c4b775355cc7acd301e8efe7d4c1c9acdafd8:
>
>   tpm: tpm_passthrough: Fail startup if FE buffer size < BE buffer size (2017-12-14 23:39:15 -0500)
>
> ----------------------------------------------------------------
> Merge tpm 2017/12/15 v1

Applied, thanks.

-- PMM

Re: [Qemu-devel] [PULL v1 00/32] Merge tpm 2017/12/15
Posted by Thomas Huth 7 years, 10 months ago
On 17.12.2017 22:34, Peter Maydell wrote:
> On 16 December 2017 at 17:41, Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:
>> The following patch series refactors the TPM TIS and backend drivers for
>> easier addition of new front-end devices. Further, the TPM buffer sizes
>> are read from the backend and the backend's buffer size can be adjusted
>> by the frontend, if necessary.
>>
>>
>> The following changes since commit 0ef0583d5adceb9138bdb47494dabd1549ac5b6d:
>>
>>   Merge remote-tracking branch 'remotes/dgilbert/tags/pull-hmp-20171214' into staging (2017-12-14 15:32:32 +0000)
>>
>> are available in the git repository at:
>>
>>   git://github.com/stefanberger/qemu-tpm.git tags/pull-tpm-2017-12-15-1
>>
>> for you to fetch changes up to 683c4b775355cc7acd301e8efe7d4c1c9acdafd8:
>>
>>   tpm: tpm_passthrough: Fail startup if FE buffer size < BE buffer size (2017-12-14 23:39:15 -0500)
>>
>> ----------------------------------------------------------------
>> Merge tpm 2017/12/15 v1
> 
> Applied, thanks.

This apparently broke compilation on non-x86 architectures:

  LINK    s390x-softmmu/qemu-system-s390x
../hw/core/qdev-properties-system.o: In function `release_tpm':
/home/thuth/devel/qemu/hw/core/qdev-properties-system.c:291: undefined reference to `tpm_backend_reset'
../hw/core/qdev-properties-system.o: In function `set_tpm':
/home/thuth/devel/qemu/hw/core/qdev-properties-system.c:274: undefined reference to `qemu_find_tpm_be'
/home/thuth/devel/qemu/hw/core/qdev-properties-system.c:278: undefined reference to `tpm_backend_init'
collect2: error: ld returned 1 exit status
make: Leaving directory `/home/thuth/s390x/qemu'
make[1]: *** [qemu-system-s390x] Error 1
make: *** [subdir-s390x-softmmu] Error 2

Could you please fix this ASAP?

 Thomas

Re: [Qemu-devel] [PULL v1 00/32] Merge tpm 2017/12/15
Posted by Thomas Huth 7 years, 10 months ago
On 18.12.2017 12:18, Thomas Huth wrote:
> On 17.12.2017 22:34, Peter Maydell wrote:
>> On 16 December 2017 at 17:41, Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:
>>> The following patch series refactors the TPM TIS and backend drivers for
>>> easier addition of new front-end devices. Further, the TPM buffer sizes
>>> are read from the backend and the backend's buffer size can be adjusted
>>> by the frontend, if necessary.
>>>
>>>
>>> The following changes since commit 0ef0583d5adceb9138bdb47494dabd1549ac5b6d:
>>>
>>>   Merge remote-tracking branch 'remotes/dgilbert/tags/pull-hmp-20171214' into staging (2017-12-14 15:32:32 +0000)
>>>
>>> are available in the git repository at:
>>>
>>>   git://github.com/stefanberger/qemu-tpm.git tags/pull-tpm-2017-12-15-1
>>>
>>> for you to fetch changes up to 683c4b775355cc7acd301e8efe7d4c1c9acdafd8:
>>>
>>>   tpm: tpm_passthrough: Fail startup if FE buffer size < BE buffer size (2017-12-14 23:39:15 -0500)
>>>
>>> ----------------------------------------------------------------
>>> Merge tpm 2017/12/15 v1
>>
>> Applied, thanks.
> 
> This apparently broke compilation on non-x86 architectures:
> 
>   LINK    s390x-softmmu/qemu-system-s390x
> ../hw/core/qdev-properties-system.o: In function `release_tpm':
> /home/thuth/devel/qemu/hw/core/qdev-properties-system.c:291: undefined reference to `tpm_backend_reset'
> ../hw/core/qdev-properties-system.o: In function `set_tpm':
> /home/thuth/devel/qemu/hw/core/qdev-properties-system.c:274: undefined reference to `qemu_find_tpm_be'
> /home/thuth/devel/qemu/hw/core/qdev-properties-system.c:278: undefined reference to `tpm_backend_init'
> collect2: error: ld returned 1 exit status
> make: Leaving directory `/home/thuth/s390x/qemu'
> make[1]: *** [qemu-system-s390x] Error 1
> make: *** [subdir-s390x-softmmu] Error 2
> 
> Could you please fix this ASAP?

FWIW, looks like there was a "--disable-tpm" in my config.status file,
not sure why. So that's likely causing the issue here, not the non-x86
system.

 Thomas

Re: [Qemu-devel] [PULL v1 00/32] Merge tpm 2017/12/15
Posted by Peter Maydell 7 years, 10 months ago
On 18 December 2017 at 11:50, Thomas Huth <thuth@redhat.com> wrote:
> On 18.12.2017 12:18, Thomas Huth wrote:
>> This apparently broke compilation on non-x86 architectures:
>>
>>   LINK    s390x-softmmu/qemu-system-s390x
>> ../hw/core/qdev-properties-system.o: In function `release_tpm':
>> /home/thuth/devel/qemu/hw/core/qdev-properties-system.c:291: undefined reference to `tpm_backend_reset'
>> ../hw/core/qdev-properties-system.o: In function `set_tpm':
>> /home/thuth/devel/qemu/hw/core/qdev-properties-system.c:274: undefined reference to `qemu_find_tpm_be'
>> /home/thuth/devel/qemu/hw/core/qdev-properties-system.c:278: undefined reference to `tpm_backend_init'
>> collect2: error: ld returned 1 exit status
>> make: Leaving directory `/home/thuth/s390x/qemu'
>> make[1]: *** [qemu-system-s390x] Error 1
>> make: *** [subdir-s390x-softmmu] Error 2
>>
>> Could you please fix this ASAP?
>
> FWIW, looks like there was a "--disable-tpm" in my config.status file,
> not sure why. So that's likely causing the issue here, not the non-x86
> system.

Yeah, I build on non-x86 but I don't have --disable-tpm in
any of the build configs. That should definitely work though :-)

thanks
-- PMM