Patchwork [V22,7/7] Introduce --enable-tpm-passthrough configure option

login
register
mail settings
Submitter Stefan Berger
Date Feb. 14, 2013, 9:43 p.m.
Message ID <1360878193-2923-8-git-send-email-stefanb@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/220522/
State New
Headers show

Comments

Stefan Berger - Feb. 14, 2013, 9:43 p.m.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
---
 configure | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Patch

diff --git a/configure b/configure
index b7359aa..b4f0a82 100755
--- a/configure
+++ b/configure
@@ -227,6 +227,7 @@  seccomp=""
 glusterfs=""
 virtio_blk_data_plane=""
 tpm="no"
+tpm_passthrough="no"
 
 # parse CC options first
 for opt do
@@ -900,11 +901,20 @@  for opt do
   ;;
   --enable-tpm) tpm="yes"
   ;;
+  --enable-tpm-passthrough) tpm_passthrough="yes"
+  ;;
   *) echo "ERROR: unknown option $opt"; show_help="yes"
   ;;
   esac
 done
 
+if test "$tpm" = "no" ; then
+    if test "$tpm_passthrough" = "yes"; then
+        echo "ERROR: --enable-tpm-passthrough requires --enable-tpm"
+        exit 1
+    fi
+fi
+
 case "$cpu" in
     sparc)
            LDFLAGS="-m32 $LDFLAGS"
@@ -1150,6 +1160,7 @@  echo "  --disable-glusterfs      disable GlusterFS backend"
 echo "  --enable-gcov            enable test coverage analysis with gcov"
 echo "  --gcov=GCOV              use specified gcov [$gcov_tool]"
 echo "  --enable-tpm             enable TPM support"
+echo "  --enable-tpm-passthrough enable TPM passthrough driver"
 echo ""
 echo "NOTE: The object files are built at the place where configure is launched"
 exit 1
@@ -3349,6 +3360,7 @@  echo "virtio-blk-data-plane $virtio_blk_data_plane"
 echo "gcov              $gcov_tool"
 echo "gcov enabled      $gcov"
 echo "TPM support       $tpm"
+echo "TPM passthrough   $tpm_passthrough"
 
 if test "$sdl_too_old" = "yes"; then
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -4258,6 +4270,11 @@  fi
 
 if test "$tpm" = "yes"; then
   if test "$target_softmmu" = "yes" ; then
+    if test "$linux" = "yes" ; then
+      if test "$tpm_passthrough" = "yes" ; then
+        echo "CONFIG_TPM_PASSTHROUGH=y" >> $config_host_mak
+      fi
+    fi
     echo "CONFIG_TPM=y" >> $config_host_mak
   fi
 fi