[Qemu-devel] [PULL v2 00/10] Merge tpm 2017/10/04

Stefan Berger posted 10 patches 6 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1507599235-25123-1-git-send-email-stefanb@linux.vnet.ibm.com
Test checkpatch passed
Test docker passed
Test s390x passed
There is a newer version of this series
backends/tpm.c                   | 115 ++++++++------
configure                        |  13 +-
docs/specs/tpm.txt               | 123 +++++++++++++++
hmp.c                            |   5 +
hw/tpm/Makefile.objs             |   1 +
hw/tpm/tpm_emulator.c            | 587 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
hw/tpm/tpm_ioctl.h               | 246 ++++++++++++++++++++++++++++++
hw/tpm/tpm_passthrough.c         | 242 +++++++-----------------------
hw/tpm/tpm_tis.c                 |  14 +-
hw/tpm/tpm_util.c                |  25 ++++
hw/tpm/tpm_util.h                |   4 +
include/sysemu/tpm_backend.h     |  80 +++++-----
include/sysemu/tpm_backend_int.h |  41 -----
qapi/tpm.json                    |  21 ++-
qemu-options.hx                  |  22 ++-
tpm.c                            |  37 +----
vl.c                             |   1 +
17 files changed, 1211 insertions(+), 366 deletions(-)
create mode 100644 docs/specs/tpm.txt
create mode 100644 hw/tpm/tpm_emulator.c
create mode 100644 hw/tpm/tpm_ioctl.h
delete mode 100644 include/sysemu/tpm_backend_int.h
[Qemu-devel] [PULL v2 00/10] Merge tpm 2017/10/04
Posted by Stefan Berger 6 years, 6 months ago
The following changes since commit d147f7e815f97cb477e223586bcb80c316ae10ea:

  Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-10-03 16:27:24 +0100)

are available in the git repository at:

  git://github.com/stefanberger/qemu-tpm.git tags/pull-tpm-2017-10-04-2

for you to fetch changes up to 3bfc6666c21bf9e437734bb3e90db7e5b5f6b8bf:

  specs: Describe the TPM support in QEMU (2017-10-05 12:50:45 -0400)

----------------------------------------------------------------
Merge tpm 2017/10/04 v2

----------------------------------------------------------------
Amarnath Valluri (9):
      tpm-backend: Remove unneeded member variable from backend class
      tpm-backend: Move thread handling inside TPMBackend
      tpm-backend: Initialize and free data members in it's own methods
      tpm-backend: Made few interface methods optional
      tpm-backend: Add new API to read backend TpmInfo
      tpm-backend: Move realloc_buffer() implementation to tpm-tis model
      tpm-passthrough: move reusable code to utils
      tpm: Added support for TPM emulator
      tpm: Move tpm_cleanup() to right place

Stefan Berger (1):
      specs: Describe the TPM support in QEMU

 backends/tpm.c                   | 115 ++++++++------
 configure                        |  13 +-
 docs/specs/tpm.txt               | 123 +++++++++++++++
 hmp.c                            |   5 +
 hw/tpm/Makefile.objs             |   1 +
 hw/tpm/tpm_emulator.c            | 587 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/tpm/tpm_ioctl.h               | 246 ++++++++++++++++++++++++++++++
 hw/tpm/tpm_passthrough.c         | 242 +++++++-----------------------
 hw/tpm/tpm_tis.c                 |  14 +-
 hw/tpm/tpm_util.c                |  25 ++++
 hw/tpm/tpm_util.h                |   4 +
 include/sysemu/tpm_backend.h     |  80 +++++-----
 include/sysemu/tpm_backend_int.h |  41 -----
 qapi/tpm.json                    |  21 ++-
 qemu-options.hx                  |  22 ++-
 tpm.c                            |  37 +----
 vl.c                             |   1 +
 17 files changed, 1211 insertions(+), 366 deletions(-)
 create mode 100644 docs/specs/tpm.txt
 create mode 100644 hw/tpm/tpm_emulator.c
 create mode 100644 hw/tpm/tpm_ioctl.h
 delete mode 100644 include/sysemu/tpm_backend_int.h


-- 
2.5.5


Re: [Qemu-devel] [PULL v2 00/10] Merge tpm 2017/10/04
Posted by Peter Maydell 6 years, 6 months ago
On 10 October 2017 at 02:33, Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:
> The following changes since commit d147f7e815f97cb477e223586bcb80c316ae10ea:
>
>   Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-10-03 16:27:24 +0100)
>
> are available in the git repository at:
>
>   git://github.com/stefanberger/qemu-tpm.git tags/pull-tpm-2017-10-04-2
>
> for you to fetch changes up to 3bfc6666c21bf9e437734bb3e90db7e5b5f6b8bf:
>
>   specs: Describe the TPM support in QEMU (2017-10-05 12:50:45 -0400)
>
> ----------------------------------------------------------------
> Merge tpm 2017/10/04 v2
>
> ----------------------------------------------------------------

Hi. This fails to build, I'm afraid:

On OpenBSD:

  CC      hw/tpm/tpm_emulator.o
/home/qemu/hw/tpm/tpm_emulator.c: In function 'tpm_emulator_probe_caps':
/home/qemu/hw/tpm/tpm_emulator.c:223:5: warning: format '%lx' expects
argument of type 'long unsigned int', but argument 3 has type
'ptm_cap' [-Wformat=]
     DPRINTF("capbilities : 0x%lx", tpm_emu->caps);
     ^
gmake: Leaving directory '/home/qemu/build/all'
gmake: Entering directory '/home/qemu/build/all'
  CC      hw/tpm/tpm_util.o
/home/qemu/hw/tpm/tpm_util.c: In function 'tpm_util_test':
/home/qemu/hw/tpm/tpm_util.c:94:16: error: 'EBADMSG' undeclared (first
use in this function)
         return EBADMSG;
                ^
/home/qemu/hw/tpm/tpm_util.c:94:16: note: each undeclared identifier
is reported only once for each function it appears in

On AArch32:

/home/peter.maydell/qemu/hw/tpm/tpm_emulator.c: In function
'tpm_emulator_probe_caps':
/home/peter.maydell/qemu/hw/tpm/tpm_emulator.c:53:25: error: format
'%lx' expects argument of type 'long unsigned int', but argument 3 has
type 'ptm_cap {aka long long unsigned int}' [-Werror=format=]
         fprintf(stderr, "tpm-emulator:"fmt"\n", ## __VA_ARGS__); \
                         ^
/home/peter.maydell/qemu/hw/tpm/tpm_emulator.c:223:5: note: in
expansion of macro 'DPRINTF'
     DPRINTF("capbilities : 0x%lx", tpm_emu->caps);
     ^

On OSX:
/Users/pm215/src/qemu-for-merges/hw/tpm/tpm_emulator.c:223:36: error:
format specifies type 'unsigned long' but the argument has type
'ptm_cap' (aka 'unsigned long long') [-Werror,-Wformat]
    DPRINTF("capbilities : 0x%lx", tpm_emu->caps);
                             ~~~   ^~~~~~~~~~~~~
                             %llx
/Users/pm215/src/qemu-for-merges/hw/tpm/tpm_emulator.c:53:52: note:
expanded from macro 'DPRINTF'
        fprintf(stderr, "tpm-emulator:"fmt"\n", ## __VA_ARGS__); \
                                                   ^

thanks
-- PMM

Re: [Qemu-devel] [PULL v2 00/10] Merge tpm 2017/10/04
Posted by Stefan Berger 6 years, 6 months ago
On 10/10/2017 11:08 AM, Peter Maydell wrote:
> On 10 October 2017 at 02:33, Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:
>> The following changes since commit d147f7e815f97cb477e223586bcb80c316ae10ea:
>>
>>    Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-10-03 16:27:24 +0100)
>>
>> are available in the git repository at:
>>
>>    git://github.com/stefanberger/qemu-tpm.git tags/pull-tpm-2017-10-04-2
>>
>> for you to fetch changes up to 3bfc6666c21bf9e437734bb3e90db7e5b5f6b8bf:
>>
>>    specs: Describe the TPM support in QEMU (2017-10-05 12:50:45 -0400)
>>
>> ----------------------------------------------------------------
>> Merge tpm 2017/10/04 v2
>>
>> ----------------------------------------------------------------
> Hi. This fails to build, I'm afraid:
>
> On OpenBSD:

I installed OpenBSD 6.2 for i386 . I could recreate this one. PRIx64 
solves it. I don't see the EBADMSG.  We include qemu/osdep.h in this 
file, so this is odd.

     Stefan


>
>    CC      hw/tpm/tpm_emulator.o
> /home/qemu/hw/tpm/tpm_emulator.c: In function 'tpm_emulator_probe_caps':
> /home/qemu/hw/tpm/tpm_emulator.c:223:5: warning: format '%lx' expects
> argument of type 'long unsigned int', but argument 3 has type
> 'ptm_cap' [-Wformat=]
>       DPRINTF("capbilities : 0x%lx", tpm_emu->caps);
>       ^
> gmake: Leaving directory '/home/qemu/build/all'
> gmake: Entering directory '/home/qemu/build/all'
>    CC      hw/tpm/tpm_util.o
> /home/qemu/hw/tpm/tpm_util.c: In function 'tpm_util_test':
> /home/qemu/hw/tpm/tpm_util.c:94:16: error: 'EBADMSG' undeclared (first
> use in this function)
>           return EBADMSG;
>                  ^
> /home/qemu/hw/tpm/tpm_util.c:94:16: note: each undeclared identifier
> is reported only once for each function it appears in
>
> On AArch32:
>
> /home/peter.maydell/qemu/hw/tpm/tpm_emulator.c: In function
> 'tpm_emulator_probe_caps':
> /home/peter.maydell/qemu/hw/tpm/tpm_emulator.c:53:25: error: format
> '%lx' expects argument of type 'long unsigned int', but argument 3 has
> type 'ptm_cap {aka long long unsigned int}' [-Werror=format=]
>           fprintf(stderr, "tpm-emulator:"fmt"\n", ## __VA_ARGS__); \
>                           ^
> /home/peter.maydell/qemu/hw/tpm/tpm_emulator.c:223:5: note: in
> expansion of macro 'DPRINTF'
>       DPRINTF("capbilities : 0x%lx", tpm_emu->caps);
>       ^
>
> On OSX:
> /Users/pm215/src/qemu-for-merges/hw/tpm/tpm_emulator.c:223:36: error:
> format specifies type 'unsigned long' but the argument has type
> 'ptm_cap' (aka 'unsigned long long') [-Werror,-Wformat]
>      DPRINTF("capbilities : 0x%lx", tpm_emu->caps);
>                               ~~~   ^~~~~~~~~~~~~
>                               %llx
> /Users/pm215/src/qemu-for-merges/hw/tpm/tpm_emulator.c:53:52: note:
> expanded from macro 'DPRINTF'
>          fprintf(stderr, "tpm-emulator:"fmt"\n", ## __VA_ARGS__); \
>                                                     ^
>
> thanks
> -- PMM
>


Re: [Qemu-devel] [PULL v2 00/10] Merge tpm 2017/10/04
Posted by Peter Maydell 6 years, 6 months ago
On 11 October 2017 at 02:36, Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:
> I installed OpenBSD 6.2 for i386 . I could recreate this one. PRIx64 solves
> it. I don't see the EBADMSG.  We include qemu/osdep.h in this file, so this
> is odd.

OpenBSD only added EBADMSG to its headers very recently:
https://github.com/openbsd/src/commit/bd616ed529e7c70988b09205b9cda0caa012efe8#diff-4c402341f93d93b29dc0f6eb539600f5
It's not in 6.1 or earlier.

thanks
-- PMM