1. 17 Feb, 2014 1 commit
  2. 29 Jul, 2013 1 commit
    • Peter Maydell's avatar
      tpm.c: Don't try to put -1 in a variable of type TpmModel · 8cdd2e0a
      Peter Maydell authored
      The TpmModel type is an enum (valid values 0 and 1), which means
      the compiler can legitimately decide that comparisons like
      'tpm_models[i] == -1' are never true. (For example it could
      pick 'unsigned char' as its type for representing the enum.)
      
      Avoid this issue by using TPM_MODEL_MAX to mark entries in
      the tpm_models[] array which aren't filled in, instead of -1.
      
      This silences a clang warning:
      
       tpm.c:43:27: error: comparison of constant -1 with expression of type
            'enum TpmModel' is always false [-Werror,-Wtautological-constant-out-of-range-compare]
              if (tpm_models[i] == -1) {
                  ~~~~~~~~~~~~~ ^  ~~
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1375096931-13842-1-git-send-email-peter.maydell@linaro.org
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      8cdd2e0a
  3. 23 Apr, 2013 1 commit
  4. 15 Apr, 2013 2 commits
  5. 02 Apr, 2013 1 commit
  6. 25 Mar, 2013 1 commit
  7. 12 Mar, 2013 2 commits
    • Stefan Berger's avatar
      Add a TPM Passthrough backend driver implementation · 4549a8b7
      Stefan Berger authored
      This patch is based of off version 9 of Stefan Berger's patch series
        "QEMU Trusted Platform Module (TPM) integration"
      and adds a new backend driver for it.
      
      This patch adds a passthrough backend driver for passing commands sent to the
      emulated TPM device directly to a TPM device opened on the host machine.
      Thus it is possible to use a hardware TPM device in a system running on QEMU,
      providing the ability to access a TPM in a special state (e.g. after a Trusted
      Boot).
      
      This functionality is being used in the acTvSM Trusted Virtualization Platform
      which is available on [1].
      
      Usage example:
        qemu-system-x86_64 -tpmdev passthrough,id=tpm0,path=/dev/tpm0 \
                           -device tpm-tis,tpmdev=tpm0 \
                           -cdrom test.iso -boot d
      
      Some notes about the host TPM:
      The TPM needs to be enabled and activated. If that's not the case one
      has to go through the BIOS/UEFI and enable and activate that TPM for TPM
      commands to work as expected.
      It may be necessary to boot the kernel using tpm_tis.force=1 in the boot
      command line or 'modprobe tpm_tis force=1' in case of using it as a module.
      
      Regards,
      Andreas Niederl, Stefan Berger
      
      [1] http://trustedjava.sourceforge.net/Signed-off-by: default avatarAndreas Niederl <andreas.niederl@iaik.tugraz.at>
      Signed-off-by: default avatarStefan Berger <stefanb@linux.vnet.ibm.com>
      Reviewed-by: default avatarCorey Bryant <coreyb@linux.vnet.ibm.com>
      Reviewed-by: default avatarJoel Schopp <jschopp@linux.vnet.ibm.com>
      Message-id: 1361987275-26289-6-git-send-email-stefanb@linux.vnet.ibm.com
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      4549a8b7
    • Stefan Berger's avatar
      Support for TPM command line options · d1a0cf73
      Stefan Berger authored
      This patch adds support for TPM command line options.
      The command line options supported here are
      
      ./qemu-... -tpmdev passthrough,path=<path to TPM device>,id=<id>
                 -device tpm-tis,tpmdev=<id>,id=<other id>
      
      and
      
      ./qemu-... -tpmdev help
      
      where the latter works similar to -soundhw help and shows a list of
      available TPM backends (for example 'passthrough').
      
      Using the type parameter, the backend is chosen, i.e., 'passthrough' for the
      passthrough driver. The interpretation of the other parameters along
      with determining whether enough parameters were provided is pushed into
      the backend driver, which needs to implement the interface function
      'create' and return a TPMDriverOpts structure if the VM can be started or
      'NULL' if not enough or bad parameters were provided.
      
      Monitor support for 'info tpm' has been added. It for example prints the
      following:
      
      (qemu) info tpm
      TPM devices:
       tpm0: model=tpm-tis
        \ tpm0: type=passthrough,path=/dev/tpm0,cancel-path=/sys/devices/pnp0/00:09/cancel
      Signed-off-by: default avatarStefan Berger <stefanb@linux.vnet.ibm.com>
      Reviewed-by: default avatarCorey Bryant <coreyb@linux.vnet.ibm.com>
      Reviewed-by: default avatarJoel Schopp <jschopp@linux.vnet.ibm.com>
      Message-id: 1361987275-26289-2-git-send-email-stefanb@linux.vnet.ibm.com
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      d1a0cf73