1. 13 3月, 2013 5 次提交
    • S
      Add a TPM Passthrough backend driver implementation · 4549a8b7
      Stefan Berger 提交于
      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: NAndreas Niederl <andreas.niederl@iaik.tugraz.at>
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      Reviewed-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
      Reviewed-by: NJoel Schopp <jschopp@linux.vnet.ibm.com>
      Message-id: 1361987275-26289-6-git-send-email-stefanb@linux.vnet.ibm.com
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      4549a8b7
    • S
      Build the TPM frontend code · ab214c29
      Stefan Berger 提交于
      Build the TPM frontend code that has been added so far.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      Reviewed-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
      Reviewed-by: NJoel Schopp <jschopp@linux.vnet.ibm.com>
      Message-id: 1361987275-26289-5-git-send-email-stefanb@linux.vnet.ibm.com
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ab214c29
    • S
      Add a debug register · 8db7c415
      Stefan Berger 提交于
      This patch uses the possibility to add a vendor-specific register and
      adds a debug register useful for dumping the TIS's internal state. This
      register is only active in a debug build (#define DEBUG_TIS).
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      Reviewed-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
      Reviewed-by: NJoel Schopp <jschopp@linux.vnet.ibm.com>
      Message-id: 1361987275-26289-4-git-send-email-stefanb@linux.vnet.ibm.com
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      8db7c415
    • S
      Add TPM (frontend) hardware interface (TPM TIS) to QEMU · edff8678
      Stefan Berger 提交于
      This patch adds the main code of the TPM frontend driver, the TPM TIS
      interface, to QEMU. The code is largely based on the previous implementation
      for Xen but has been significantly extended to meet the standard's
      requirements, such as the support for changing of localities and all the
      functionality of the available flags.
      
      Communication with the backend (i.e., for Xen or the libtpms-based one)
      is cleanly separated through an interface which the backend driver needs
      to implement.
      
      Whenever the frontend has collected a complete packet, it will submit
      a task to the backend, which then starts processing the command. Once
      the result has been returned, the backend invokes a callback function
      (tpm_tis_receive_cb()).
      
      Testing the proper functioning of the different flags and localities
      cannot be done from user space when running in Linux for example, since
      access to the address space of the TPM TIS interface is not possible. Also
      the Linux driver itself does not exercise all functionality. So, for
      testing there is a fairly extensive test suite as part of the SeaBIOS patches
      since from within the BIOS one can have full access to all the TPM's registers.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      Reviewed-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
      Reviewed-by: NJoel Schopp <jschopp@linux.vnet.ibm.com>
      Message-id: 1361987275-26289-3-git-send-email-stefanb@linux.vnet.ibm.com
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      edff8678
    • S
      Support for TPM command line options · d1a0cf73
      Stefan Berger 提交于
      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: NStefan Berger <stefanb@linux.vnet.ibm.com>
      Reviewed-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
      Reviewed-by: NJoel Schopp <jschopp@linux.vnet.ibm.com>
      Message-id: 1361987275-26289-2-git-send-email-stefanb@linux.vnet.ibm.com
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      d1a0cf73
  2. 11 3月, 2013 35 次提交