mbox series

[v3,0/5] tpm: Eliminate TPM related code if CONFIG_TPM is not set

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

Message

Philippe Mathieu-Daudé June 14, 2021, 8:09 p.m. UTC
v3
- make the qapi schema conditional (Marc-André)

Philippe Mathieu-Daudé (1):
  tpm: Return QMP error when TPM is disabled in build

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

 qapi/tpm.json                | 28 +++++++++++++++++---------
 include/hw/acpi/tpm.h        |  4 ++++
 include/sysemu/tpm.h         |  9 +++++++++
 include/sysemu/tpm_backend.h |  6 +++++-
 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 ++++++++++++++++++
 monitor/hmp-cmds.c           |  4 ++++
 stubs/tpm.c                  | 39 ------------------------------------
 stubs/meson.build            |  1 -
 12 files changed, 75 insertions(+), 50 deletions(-)
 delete mode 100644 stubs/tpm.c

Comments

Philippe Mathieu-Daudé June 14, 2021, 8:12 p.m. UTC | #1
On 6/14/21 10:09 PM, Philippe Mathieu-Daudé wrote:
> When the management layer queries a binary built using --disable-tpm
> for TPM devices, it gets confused by getting empty responses:
> 
>   { "execute": "query-tpm" }
>   {
>       "return": [
>       ]
>   }
>   { "execute": "query-tpm-types" }
>   {
>       "return": [
>       ]
>   }
>   { "execute": "query-tpm-models" }
>   {
>       "return": [
>       ]
>   }
> 
> To make it clearer by returning an error:
> - Make the TPM QAPI schema conditional
> - Adapt the HMP command
> - Remove stubs which became unnecessary
> 
> The management layer now gets a 'CommandNotFound' error:
> 
>   { "execute": "query-tpm" }
>   {
>       "error": {
>           "class": "CommandNotFound",
>           "desc": "The command query-tpm has not been found"
>       }
>   }
> 
> Suggested-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  qapi/tpm.json      | 28 +++++++++++++++++++---------
>  monitor/hmp-cmds.c |  4 ++++
>  stubs/tpm.c        | 25 -------------------------
>  stubs/meson.build  |  1 -
>  4 files changed, 23 insertions(+), 35 deletions(-)
>  delete mode 100644 stubs/tpm.c

Grrrr I forgot to commit:

-- >8 --
diff --git a/MAINTAINERS b/MAINTAINERS
index 7d9cd290426..636bf2f5365 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2707,7 +2707,6 @@ TPM
 M: Stefan Berger <stefanb@linux.ibm.com>
 S: Maintained
 F: tpm.c
-F: stubs/tpm.c
 F: hw/tpm/*
 F: include/hw/acpi/tpm.h
 F: include/sysemu/tpm*
---
Stefan Berger June 14, 2021, 9:57 p.m. UTC | #2
On 6/14/21 4:12 PM, Philippe Mathieu-Daudé wrote:
>
> Grrrr I forgot to commit:
>
> -- >8 --
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 7d9cd290426..636bf2f5365 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2707,7 +2707,6 @@ TPM
>   M: Stefan Berger <stefanb@linux.ibm.com>
>   S: Maintained
>   F: tpm.c
> -F: stubs/tpm.c
>   F: hw/tpm/*
>   F: include/hw/acpi/tpm.h
>   F: include/sysemu/tpm*
> ---
>
Who is going to upstream the series? I could add this part ...
Markus Armbruster June 15, 2021, 8:52 a.m. UTC | #3
Stefan Berger <stefanb@linux.ibm.com> writes:

> On 6/14/21 4:12 PM, Philippe Mathieu-Daudé wrote:
>>
>> Grrrr I forgot to commit:
>>
>> -- >8 --
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 7d9cd290426..636bf2f5365 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -2707,7 +2707,6 @@ TPM
>>   M: Stefan Berger <stefanb@linux.ibm.com>
>>   S: Maintained
>>   F: tpm.c
>> -F: stubs/tpm.c
>>   F: hw/tpm/*
>>   F: include/hw/acpi/tpm.h
>>   F: include/sysemu/tpm*
>> ---
>>
> Who is going to upstream the series? I could add this part ...

Please do.

Thank you!