mbox series

[v3,0/5] TPM TIS SPI Support

Message ID 20241101185718.5847-1-dantan@linux.vnet.ibm.com (mailing list archive)
Headers show
Series TPM TIS SPI Support | expand

Message

dan tan Nov. 1, 2024, 6:57 p.m. UTC
*** BLURB HERE ***

Support TPM for SPI (Serial Peripheral Interface)

Revision 3 summary:
  device support:
    - moved variable tis_addr from TPMStateSPI struct to local
    - added the VM suspend/resume support:
      - added vmstate_tpm_tis_spi declaration
      - added tpm_tis_spi_pre_save() function
    - fixed trace formatting string

  qtest:
    - removed the function prototypes declaration
    - fixed code format to comply with convention
    - changed function names and variable names to be the same
      as the tpm-tis-i2c test.
    - change hard coded numbers to #define's with meaningful
      names that are identifiable with spec documentation

Version 2 summary,
    addressed the following review comments:
    - break up patch into 3 separate commits;
    - add more details in the commit logs;
      - I added links to the TCG TPM standard documents as this device
        model communicates to the TPM device (hw / swtpm) via
        tpm_tis_commom.c which is standard compliant;
      - the TPM SPI model implementation in itself is not platform
        specific. However, the SPI interface is via the PowerNV SPI
        bus master, thus it is only supported on the PowerNV platform
    - change all qemu_log() calls to trace events;
    - move static global variables to the TPMStateSPI struct;
    - fixed code formatting (verified by scripts/checkpatch.pl);
    - per requests, make the code more readable by using self-
      explanatory #defines and adding comments;
    - added some documentation support (tpm.rst);
    - beefed up the unit test exercising major supported locality
      functionality

dan tan (5):
  tpm/tpm_tis_spi: Support TPM for SPI (Serial Peripheral Interface)
  tpm/tpm_tis_spi: activation for the PowerNV machines
  tests/qtest/tpm: add unit test to tis-spi
  tpm/tpm_tis_spi: Support TPM for SPI (rev 3)
  tests/qtest/tpm: add unit test to tis-spi (rev 3)

 docs/specs/tpm.rst                 |  15 +
 include/sysemu/tpm.h               |   3 +
 hw/tpm/tpm_tis_spi.c               | 360 +++++++++++++++
 tests/qtest/tpm-tis-spi-pnv-test.c | 710 +++++++++++++++++++++++++++++
 hw/ppc/Kconfig                     |   1 +
 hw/tpm/Kconfig                     |   6 +
 hw/tpm/meson.build                 |   1 +
 hw/tpm/trace-events                |   7 +
 tests/qtest/meson.build            |   2 +
 9 files changed, 1105 insertions(+)
 create mode 100644 hw/tpm/tpm_tis_spi.c
 create mode 100644 tests/qtest/tpm-tis-spi-pnv-test.c

Comments

Stefan Berger Nov. 1, 2024, 7:25 p.m. UTC | #1
On 11/1/24 2:57 PM, dan tan wrote:
> *** BLURB HERE ***
> 
> Support TPM for SPI (Serial Peripheral Interface)
> 
> Revision 3 summary:
>    device support:
>      - moved variable tis_addr from TPMStateSPI struct to local
>      - added the VM suspend/resume support:
>        - added vmstate_tpm_tis_spi declaration
>        - added tpm_tis_spi_pre_save() function
>      - fixed trace formatting string

Can you please update patch 1/3 with those changes relevant for this 
patch and then patch 3/3 as well. I think it should be fairly simple to 
modify each one of them by merging 4/5 into 1/5 and 5/5 into 3/5. 
There's no reason that there are so many changes in 4/5 and 5/5 
replacing new code.

   Thanks
     Stefan