Patchwork [V23,4/7] Build the TPM frontend code

login
register
mail settings
Submitter Stefan Berger
Date Feb. 15, 2013, 7:39 p.m.
Message ID <1360957200-20871-5-git-send-email-stefanb@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/220845/
State New
Headers show

Comments

Stefan Berger - Feb. 15, 2013, 7:39 p.m.
Build the TPM frontend code that has been added so far.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
---
 configure         | 11 +++++++++++
 tpm/Makefile.objs |  1 +
 2 files changed, 12 insertions(+)
Andreas Färber - Feb. 16, 2013, 11:19 a.m.
Am 15.02.2013 20:39, schrieb Stefan Berger:
> Build the TPM frontend code that has been added so far.

The previous two patches were not compile-testable?! That's not cool.

> 
> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
> Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
> ---
>  configure         | 11 +++++++++++
>  tpm/Makefile.objs |  1 +
>  2 files changed, 12 insertions(+)
> 
> diff --git a/configure b/configure
> index 8789324..b7359aa 100755
> --- a/configure
> +++ b/configure
> @@ -226,6 +226,7 @@ coroutine=""
>  seccomp=""
>  glusterfs=""
>  virtio_blk_data_plane=""
> +tpm="no"
>  
>  # parse CC options first
>  for opt do
> @@ -897,6 +898,8 @@ for opt do
>    ;;
>    --enable-virtio-blk-data-plane) virtio_blk_data_plane="yes"
>    ;;
> +  --enable-tpm) tpm="yes"
> +  ;;
>    *) echo "ERROR: unknown option $opt"; show_help="yes"
>    ;;
>    esac
> @@ -1146,6 +1149,7 @@ echo "  --enable-glusterfs       enable GlusterFS backend"
>  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 ""
>  echo "NOTE: The object files are built at the place where configure is launched"
>  exit 1
> @@ -3344,6 +3348,7 @@ echo "GlusterFS support $glusterfs"
>  echo "virtio-blk-data-plane $virtio_blk_data_plane"
>  echo "gcov              $gcov_tool"
>  echo "gcov enabled      $gcov"
> +echo "TPM support       $tpm"
>  
>  if test "$sdl_too_old" = "yes"; then
>  echo "-> Your SDL version is too old - please upgrade to have SDL support"
> @@ -4251,6 +4256,12 @@ if test "$gprof" = "yes" ; then
>    fi
>  fi
>  
> +if test "$tpm" = "yes"; then
> +  if test "$target_softmmu" = "yes" ; then
> +    echo "CONFIG_TPM=y" >> $config_host_mak
> +  fi
> +fi

So if some softmmu is being built and --enabled-tpm was chosen, we set
CONFIG_TPM=y for the host. Fine.

> +
>  if test "$ARCH" = "tci"; then
>    linker_script=""
>  else
> diff --git a/tpm/Makefile.objs b/tpm/Makefile.objs
> index dffb567..63bfcea 100644
> --- a/tpm/Makefile.objs
> +++ b/tpm/Makefile.objs
> @@ -1 +1,2 @@
>  common-obj-y = tpm.o
> +common-obj-$(CONFIG_TPM) += tpm_tis.o

Some softmmus might not even support ISA, so this needs to be
conditional on more than just the host's $(CONFIG_TPM), it should be a
combination of the host's CONFIG_TPM=y and CONFIG_TPM_TIS=y in
default-configs/{i386,x86_64}-softmmu.config or similar.

Regards,
Andreas
Stefan Berger - Feb. 16, 2013, 5:27 p.m.
On 02/16/2013 06:19 AM, Andreas Färber wrote:
> Am 15.02.2013 20:39, schrieb Stefan Berger:
>   if test "$sdl_too_old" = "yes"; then
>   echo "-> Your SDL version is too old - please upgrade to have SDL support"
> @@ -4251,6 +4256,12 @@ if test "$gprof" = "yes" ; then
>     fi
>   fi
>   
> +if test "$tpm" = "yes"; then
> +  if test "$target_softmmu" = "yes" ; then
> +    echo "CONFIG_TPM=y" >> $config_host_mak
> +  fi
> +fi
> So if some softmmu is being built and --enabled-tpm was chosen, we set
> CONFIG_TPM=y for the host. Fine.
>
>> +
>>   if test "$ARCH" = "tci"; then
>>     linker_script=""
>>   else
>> diff --git a/tpm/Makefile.objs b/tpm/Makefile.objs
>> index dffb567..63bfcea 100644
>> --- a/tpm/Makefile.objs
>> +++ b/tpm/Makefile.objs
>> @@ -1 +1,2 @@
>>   common-obj-y = tpm.o
>> +common-obj-$(CONFIG_TPM) += tpm_tis.o
> Some softmmus might not even support ISA, so this needs to be
> conditional on more than just the host's $(CONFIG_TPM), it should be a
> combination of the host's CONFIG_TPM=y and CONFIG_TPM_TIS=y in
> default-configs/{i386,x86_64}-softmmu.config or similar.

I need some help with this... From what I can see at least in hw/Makefile.objs isa-bus.o is unconditionally added to common-obj-y. Similarly the sb16.c, also an ISA device, ends up in config-host.mak. Does this imply that any softmmu will have isa-bus.o and sb16 compile in ?

Regards,
    Stefan

Patch

diff --git a/configure b/configure
index 8789324..b7359aa 100755
--- a/configure
+++ b/configure
@@ -226,6 +226,7 @@  coroutine=""
 seccomp=""
 glusterfs=""
 virtio_blk_data_plane=""
+tpm="no"
 
 # parse CC options first
 for opt do
@@ -897,6 +898,8 @@  for opt do
   ;;
   --enable-virtio-blk-data-plane) virtio_blk_data_plane="yes"
   ;;
+  --enable-tpm) tpm="yes"
+  ;;
   *) echo "ERROR: unknown option $opt"; show_help="yes"
   ;;
   esac
@@ -1146,6 +1149,7 @@  echo "  --enable-glusterfs       enable GlusterFS backend"
 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 ""
 echo "NOTE: The object files are built at the place where configure is launched"
 exit 1
@@ -3344,6 +3348,7 @@  echo "GlusterFS support $glusterfs"
 echo "virtio-blk-data-plane $virtio_blk_data_plane"
 echo "gcov              $gcov_tool"
 echo "gcov enabled      $gcov"
+echo "TPM support       $tpm"
 
 if test "$sdl_too_old" = "yes"; then
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -4251,6 +4256,12 @@  if test "$gprof" = "yes" ; then
   fi
 fi
 
+if test "$tpm" = "yes"; then
+  if test "$target_softmmu" = "yes" ; then
+    echo "CONFIG_TPM=y" >> $config_host_mak
+  fi
+fi
+
 if test "$ARCH" = "tci"; then
   linker_script=""
 else
diff --git a/tpm/Makefile.objs b/tpm/Makefile.objs
index dffb567..63bfcea 100644
--- a/tpm/Makefile.objs
+++ b/tpm/Makefile.objs
@@ -1 +1,2 @@ 
 common-obj-y = tpm.o
+common-obj-$(CONFIG_TPM) += tpm_tis.o