On Wed, Oct 16, 2024 at 10:57:07AM -0400, Stefan Berger wrote:
> Use the new ptm_cap_n structure for getting the PTM_GET_CAPABILITY response
> from swtpm. Previously only 17 bits could possibly have been set in ptm_cap
> (=uint64_t) in big endian order and those bits are now found in the 2nd
> 32bit word in the response in the caps field.
> 
> This data structure makes it now clear that the 1st 32bit word carries the
> tpm_result like all the other response structures of all other commands
> do.
> 
> Signed-off-by: Stefan Berger <stef...@linux.ibm.com>
> ---
>  backends/tpm/tpm_emulator.c | 14 ++++++++------
>  backends/tpm/tpm_ioctl.h    | 13 ++++++++++++-
>  backends/tpm/trace-events   |  2 +-
>  3 files changed, 21 insertions(+), 8 deletions(-)
> 

> diff --git a/backends/tpm/tpm_ioctl.h b/backends/tpm/tpm_ioctl.h
> index 1933ab6855..ee2dd15d35 100644
> --- a/backends/tpm/tpm_ioctl.h
> +++ b/backends/tpm/tpm_ioctl.h
> @@ -29,6 +29,16 @@
>  
>  typedef uint32_t ptm_res;
>  
> +/* PTM_GET_CAPABILITY: Get supported capabilities (ioctl's) */
> +struct ptm_cap_n {
> +    union {
> +        struct {
> +            ptm_res tpm_result; /* will always be TPM_SUCCESS (0) */
> +            uint32_t caps;
> +        } resp; /* response */
> +    } u;
> +};

The union here is pointless surely, since it only has one entry and
the following patch doesn't add a 2nd either ? 


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Reply via email to