mbox series

[RFC,V1,0/3] tpm: Eliminate TPM related code if CONFIG_TPM is not set

Message ID 20210612012102.1820063-1-stefanb@linux.ibm.com (mailing list archive)
Headers show
Series tpm: Eliminate TPM related code if CONFIG_TPM is not set | expand

Message

Stefan Berger June 12, 2021, 1:20 a.m. UTC
The following patches entirely elimiante TPM related code if CONFIG_TPM
is not set.

  Stefan

Stefan Berger (3):
  acpi: Eliminate all TPM related code if CONFIG_TPM is not set
  arm: Eliminate all TPM related code if CONFIG_TPM is not set
  sysemu: Make TPM structures inaccessible if CONFIG_TPM is not defined

 hw/acpi/aml-build.c          |  2 ++
 hw/arm/sysbus-fdt.c          |  4 ++++
 hw/arm/virt-acpi-build.c     |  6 ++++++
 hw/arm/virt.c                |  2 ++
 hw/i386/acpi-build.c         | 20 ++++++++++++++++++++
 include/hw/acpi/tpm.h        |  4 ++++
 include/sysemu/tpm.h         |  6 +++++-
 include/sysemu/tpm_backend.h |  6 +++++-
 stubs/tpm.c                  |  4 ----
 9 files changed, 48 insertions(+), 6 deletions(-)

Comments

Markus Armbruster June 14, 2021, 8:34 a.m. UTC | #1
Stefan Berger <stefanb@linux.ibm.com> writes:

> The following patches entirely elimiante TPM related code if CONFIG_TPM
> is not set.
>
>   Stefan

I believe this is on top of Philippe's "[PATCH v2 2/2] tpm: Return QMP
error when TPM is disabled in build"

Based-on: <20210609184955.1193081-3-philmd@redhat.com>

However, it should probably go *first*, so the additional 'if' to
suppress warnings about unused qmp_marshal_output_TpmFOO() can be
squashed into Philippe's patch.

Apart from that, this looks good to me!

Additional 'if':

diff --git a/qapi/tpm.json b/qapi/tpm.json
index 09332e6f99..e74c881ea6 100644
--- a/qapi/tpm.json
+++ b/qapi/tpm.json
@@ -17,7 +17,9 @@
 #
 # Since: 1.5
 ##
-{ 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb', 'tpm-spapr' ] }
+{ 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb', 'tpm-spapr' ],
+  'if': 'defined(CONFIG_TPM)' }
+
 ##
 # @query-tpm-models:
 #
@@ -47,7 +49,8 @@
 #
 # Since: 1.5
 ##
-{ 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ] }
+{ 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ],
+  'if': 'defined(CONFIG_TPM)' }
 
 ##
 # @query-tpm-types:
@@ -124,7 +127,8 @@
 { 'struct': 'TPMInfo',
   'data': {'id': 'str',
            'model': 'TpmModel',
-           'options': 'TpmTypeOptions' } }
+           'options': 'TpmTypeOptions' },
+  'if': 'defined(CONFIG_TPM)' }
 
 ##
 # @query-tpm:
Stefan Berger June 14, 2021, 7:12 p.m. UTC | #2
On 6/14/21 4:34 AM, Markus Armbruster wrote:
> Stefan Berger <stefanb@linux.ibm.com> writes:
>
>> The following patches entirely elimiante TPM related code if CONFIG_TPM
>> is not set.
>>
>>    Stefan
> I believe this is on top of Philippe's "[PATCH v2 2/2] tpm: Return QMP
> error when TPM is disabled in build"

No, my series is stand-alone.


    Stefan