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

Stefan Berger posted 3 patches 2 years, 10 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
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(-)
[RFC PATCH V1 0/3] tpm: Eliminate TPM related code if CONFIG_TPM is not set
Posted by Stefan Berger 2 years, 10 months ago
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(-)

-- 
2.31.1


Re: [RFC PATCH V1 0/3] tpm: Eliminate TPM related code if CONFIG_TPM is not set
Posted by Markus Armbruster 2 years, 10 months ago
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:


Re: [RFC PATCH V1 0/3] tpm: Eliminate TPM related code if CONFIG_TPM is not set
Posted by Stefan Berger 2 years, 10 months ago
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