mbox series

[v5,00/11] Add dynamic boost control support

Message ID 20230623135001.18672-1-mario.limonciello@amd.com
Headers show
Series Add dynamic boost control support | expand

Message

Mario Limonciello June 23, 2023, 1:49 p.m. UTC
Dynamic boost control is a feature of some SoCs that allows
an authenticated entity to send commands to the security processor
to control certain SOC characteristics with the intention to improve
performance.

This is implemented via a mechanism that a userspace application would
authenticate using a nonce and key exchange over an IOCTL interface.

After authentication is complete an application can exchange signed
messages with the security processor and both ends can validate the
data transmitted.

This series includes a test suite that can be run on real hardware
to ensure that the communication works as expected.  This can also be
used for an application to model the communication path.

Two sysfs files are introduced for reading the PSP bootloader version
as well as TEE version which can be useful data points for debugging
communication problems.

v4->v5:
 * Pick up tags
 * Pick up a static fix
 * Fix a mistake found in dbc_cli

Mario Limonciello (11):
  crypto: ccp: Rename macro for security attributes
  crypto: ccp: Add support for displaying PSP firmware versions
  crypto: ccp: Add bootloader and TEE version offsets
  crypto: ccp: move setting PSP master to earlier in the init
  crypto: ccp: Add support for fetching a nonce for dynamic boost
    control
  crypto: ccp: Add support for setting user ID for dynamic boost control
  crypto: ccp: Add support for getting and setting DBC parameters
  crypto: ccp: Add a sample library for ioctl use
  crypto: ccp: Add a sample python script for Dynamic Boost Control
  crypto: ccp: Add unit tests for dynamic boost control
  crypto: ccp: Add Mario to MAINTAINERS

 Documentation/ABI/testing/sysfs-driver-ccp |  18 ++
 MAINTAINERS                                |  12 +
 drivers/crypto/ccp/Makefile                |   3 +-
 drivers/crypto/ccp/dbc.c                   | 250 +++++++++++++++++++
 drivers/crypto/ccp/dbc.h                   |  56 +++++
 drivers/crypto/ccp/psp-dev.c               |  19 +-
 drivers/crypto/ccp/psp-dev.h               |   1 +
 drivers/crypto/ccp/sp-dev.h                |   7 +
 drivers/crypto/ccp/sp-pci.c                |  96 +++++++-
 include/linux/psp-platform-access.h        |   4 +
 include/uapi/linux/psp-dbc.h               | 147 ++++++++++++
 tools/crypto/ccp/.gitignore                |   1 +
 tools/crypto/ccp/Makefile                  |  13 +
 tools/crypto/ccp/dbc.c                     |  72 ++++++
 tools/crypto/ccp/dbc.py                    |  64 +++++
 tools/crypto/ccp/dbc_cli.py                | 134 +++++++++++
 tools/crypto/ccp/test_dbc.py               | 266 +++++++++++++++++++++
 17 files changed, 1146 insertions(+), 17 deletions(-)
 create mode 100644 drivers/crypto/ccp/dbc.c
 create mode 100644 drivers/crypto/ccp/dbc.h
 create mode 100644 include/uapi/linux/psp-dbc.h
 create mode 100644 tools/crypto/ccp/.gitignore
 create mode 100644 tools/crypto/ccp/Makefile
 create mode 100644 tools/crypto/ccp/dbc.c
 create mode 100644 tools/crypto/ccp/dbc.py
 create mode 100755 tools/crypto/ccp/dbc_cli.py
 create mode 100755 tools/crypto/ccp/test_dbc.py


base-commit: b335f258e8ddafec0e8ae2201ca78d29ed8f85eb

Comments

John Allen June 27, 2023, 3:42 p.m. UTC | #1
On Fri, Jun 23, 2023 at 08:49:50AM -0500, Mario Limonciello wrote:
> Dynamic boost control is a feature of some SoCs that allows
> an authenticated entity to send commands to the security processor
> to control certain SOC characteristics with the intention to improve
> performance.
> 
> This is implemented via a mechanism that a userspace application would
> authenticate using a nonce and key exchange over an IOCTL interface.
> 
> After authentication is complete an application can exchange signed
> messages with the security processor and both ends can validate the
> data transmitted.
> 
> This series includes a test suite that can be run on real hardware
> to ensure that the communication works as expected.  This can also be
> used for an application to model the communication path.
> 
> Two sysfs files are introduced for reading the PSP bootloader version
> as well as TEE version which can be useful data points for debugging
> communication problems.

Series looks OK to me.

Acked-by: John Allen <john.allen@amd.com>

> 
> v4->v5:
>  * Pick up tags
>  * Pick up a static fix
>  * Fix a mistake found in dbc_cli
> 
> Mario Limonciello (11):
>   crypto: ccp: Rename macro for security attributes
>   crypto: ccp: Add support for displaying PSP firmware versions
>   crypto: ccp: Add bootloader and TEE version offsets
>   crypto: ccp: move setting PSP master to earlier in the init
>   crypto: ccp: Add support for fetching a nonce for dynamic boost
>     control
>   crypto: ccp: Add support for setting user ID for dynamic boost control
>   crypto: ccp: Add support for getting and setting DBC parameters
>   crypto: ccp: Add a sample library for ioctl use
>   crypto: ccp: Add a sample python script for Dynamic Boost Control
>   crypto: ccp: Add unit tests for dynamic boost control
>   crypto: ccp: Add Mario to MAINTAINERS
> 
>  Documentation/ABI/testing/sysfs-driver-ccp |  18 ++
>  MAINTAINERS                                |  12 +
>  drivers/crypto/ccp/Makefile                |   3 +-
>  drivers/crypto/ccp/dbc.c                   | 250 +++++++++++++++++++
>  drivers/crypto/ccp/dbc.h                   |  56 +++++
>  drivers/crypto/ccp/psp-dev.c               |  19 +-
>  drivers/crypto/ccp/psp-dev.h               |   1 +
>  drivers/crypto/ccp/sp-dev.h                |   7 +
>  drivers/crypto/ccp/sp-pci.c                |  96 +++++++-
>  include/linux/psp-platform-access.h        |   4 +
>  include/uapi/linux/psp-dbc.h               | 147 ++++++++++++
>  tools/crypto/ccp/.gitignore                |   1 +
>  tools/crypto/ccp/Makefile                  |  13 +
>  tools/crypto/ccp/dbc.c                     |  72 ++++++
>  tools/crypto/ccp/dbc.py                    |  64 +++++
>  tools/crypto/ccp/dbc_cli.py                | 134 +++++++++++
>  tools/crypto/ccp/test_dbc.py               | 266 +++++++++++++++++++++
>  17 files changed, 1146 insertions(+), 17 deletions(-)
>  create mode 100644 drivers/crypto/ccp/dbc.c
>  create mode 100644 drivers/crypto/ccp/dbc.h
>  create mode 100644 include/uapi/linux/psp-dbc.h
>  create mode 100644 tools/crypto/ccp/.gitignore
>  create mode 100644 tools/crypto/ccp/Makefile
>  create mode 100644 tools/crypto/ccp/dbc.c
>  create mode 100644 tools/crypto/ccp/dbc.py
>  create mode 100755 tools/crypto/ccp/dbc_cli.py
>  create mode 100755 tools/crypto/ccp/test_dbc.py
> 
> 
> base-commit: b335f258e8ddafec0e8ae2201ca78d29ed8f85eb
> -- 
> 2.34.1
>
Mario Limonciello July 10, 2023, 6:26 p.m. UTC | #2
On 6/23/2023 08:49, Mario Limonciello wrote:
> Dynamic boost control is a feature of some SoCs that allows
> an authenticated entity to send commands to the security processor
> to control certain SOC characteristics with the intention to improve
> performance.
> 
> This is implemented via a mechanism that a userspace application would
> authenticate using a nonce and key exchange over an IOCTL interface.
> 
> After authentication is complete an application can exchange signed
> messages with the security processor and both ends can validate the
> data transmitted.
> 
> This series includes a test suite that can be run on real hardware
> to ensure that the communication works as expected.  This can also be
> used for an application to model the communication path.
> 
> Two sysfs files are introduced for reading the PSP bootloader version
> as well as TEE version which can be useful data points for debugging
> communication problems.
> 
> v4->v5:
>   * Pick up tags
>   * Pick up a static fix
>   * Fix a mistake found in dbc_cli
> 
> Mario Limonciello (11):
>    crypto: ccp: Rename macro for security attributes
>    crypto: ccp: Add support for displaying PSP firmware versions
>    crypto: ccp: Add bootloader and TEE version offsets
>    crypto: ccp: move setting PSP master to earlier in the init
>    crypto: ccp: Add support for fetching a nonce for dynamic boost
>      control
>    crypto: ccp: Add support for setting user ID for dynamic boost control
>    crypto: ccp: Add support for getting and setting DBC parameters
>    crypto: ccp: Add a sample library for ioctl use
>    crypto: ccp: Add a sample python script for Dynamic Boost Control
>    crypto: ccp: Add unit tests for dynamic boost control
>    crypto: ccp: Add Mario to MAINTAINERS
> 
>   Documentation/ABI/testing/sysfs-driver-ccp |  18 ++
>   MAINTAINERS                                |  12 +
>   drivers/crypto/ccp/Makefile                |   3 +-
>   drivers/crypto/ccp/dbc.c                   | 250 +++++++++++++++++++
>   drivers/crypto/ccp/dbc.h                   |  56 +++++
>   drivers/crypto/ccp/psp-dev.c               |  19 +-
>   drivers/crypto/ccp/psp-dev.h               |   1 +
>   drivers/crypto/ccp/sp-dev.h                |   7 +
>   drivers/crypto/ccp/sp-pci.c                |  96 +++++++-
>   include/linux/psp-platform-access.h        |   4 +
>   include/uapi/linux/psp-dbc.h               | 147 ++++++++++++
>   tools/crypto/ccp/.gitignore                |   1 +
>   tools/crypto/ccp/Makefile                  |  13 +
>   tools/crypto/ccp/dbc.c                     |  72 ++++++
>   tools/crypto/ccp/dbc.py                    |  64 +++++
>   tools/crypto/ccp/dbc_cli.py                | 134 +++++++++++
>   tools/crypto/ccp/test_dbc.py               | 266 +++++++++++++++++++++
>   17 files changed, 1146 insertions(+), 17 deletions(-)
>   create mode 100644 drivers/crypto/ccp/dbc.c
>   create mode 100644 drivers/crypto/ccp/dbc.h
>   create mode 100644 include/uapi/linux/psp-dbc.h
>   create mode 100644 tools/crypto/ccp/.gitignore
>   create mode 100644 tools/crypto/ccp/Makefile
>   create mode 100644 tools/crypto/ccp/dbc.c
>   create mode 100644 tools/crypto/ccp/dbc.py
>   create mode 100755 tools/crypto/ccp/dbc_cli.py
>   create mode 100755 tools/crypto/ccp/test_dbc.py
> 
> 
> base-commit: b335f258e8ddafec0e8ae2201ca78d29ed8f85eb

Herbert,

Any other concerns on this series?  It has acks from Tom and John both now.

Do you want me to rebase on 6.5-rc1?

Thanks,
Herbert Xu July 10, 2023, 11:16 p.m. UTC | #3
On Mon, Jul 10, 2023 at 01:26:41PM -0500, Limonciello, Mario wrote:
>
> Any other concerns on this series?  It has acks from Tom and John both now.
> 
> Do you want me to rebase on 6.5-rc1?

Please be patient.  New code is never added during a merge window.
The earliest this can be applied is this week.

Thanks,
Mario Limonciello July 10, 2023, 11:25 p.m. UTC | #4
On 7/10/2023 6:16 PM, Herbert Xu wrote:
> On Mon, Jul 10, 2023 at 01:26:41PM -0500, Limonciello, Mario wrote:
>> Any other concerns on this series?  It has acks from Tom and John both now.
>>
>> Do you want me to rebase on 6.5-rc1?
> Please be patient.  New code is never added during a merge window.
> The earliest this can be applied is this week.
>
> Thanks,
Right; this is why I was offering to re-base it on 6.5-rc1 if necessary.
Herbert Xu July 10, 2023, 11:26 p.m. UTC | #5
On Mon, Jul 10, 2023 at 06:25:21PM -0500, Limonciello, Mario wrote:
>
> Right; this is why I was offering to re-base it on 6.5-rc1 if necessary.

If there are no major conflicts a rebase is not necessary.  It will
only delay your patches further.

Thanks,
Herbert Xu July 14, 2023, 8:53 a.m. UTC | #6
On Fri, Jun 23, 2023 at 08:49:50AM -0500, Mario Limonciello wrote:
> Dynamic boost control is a feature of some SoCs that allows
> an authenticated entity to send commands to the security processor
> to control certain SOC characteristics with the intention to improve
> performance.
> 
> This is implemented via a mechanism that a userspace application would
> authenticate using a nonce and key exchange over an IOCTL interface.
> 
> After authentication is complete an application can exchange signed
> messages with the security processor and both ends can validate the
> data transmitted.
> 
> This series includes a test suite that can be run on real hardware
> to ensure that the communication works as expected.  This can also be
> used for an application to model the communication path.
> 
> Two sysfs files are introduced for reading the PSP bootloader version
> as well as TEE version which can be useful data points for debugging
> communication problems.
> 
> v4->v5:
>  * Pick up tags
>  * Pick up a static fix
>  * Fix a mistake found in dbc_cli
> 
> Mario Limonciello (11):
>   crypto: ccp: Rename macro for security attributes
>   crypto: ccp: Add support for displaying PSP firmware versions
>   crypto: ccp: Add bootloader and TEE version offsets
>   crypto: ccp: move setting PSP master to earlier in the init
>   crypto: ccp: Add support for fetching a nonce for dynamic boost
>     control
>   crypto: ccp: Add support for setting user ID for dynamic boost control
>   crypto: ccp: Add support for getting and setting DBC parameters
>   crypto: ccp: Add a sample library for ioctl use
>   crypto: ccp: Add a sample python script for Dynamic Boost Control
>   crypto: ccp: Add unit tests for dynamic boost control
>   crypto: ccp: Add Mario to MAINTAINERS
> 
>  Documentation/ABI/testing/sysfs-driver-ccp |  18 ++
>  MAINTAINERS                                |  12 +
>  drivers/crypto/ccp/Makefile                |   3 +-
>  drivers/crypto/ccp/dbc.c                   | 250 +++++++++++++++++++
>  drivers/crypto/ccp/dbc.h                   |  56 +++++
>  drivers/crypto/ccp/psp-dev.c               |  19 +-
>  drivers/crypto/ccp/psp-dev.h               |   1 +
>  drivers/crypto/ccp/sp-dev.h                |   7 +
>  drivers/crypto/ccp/sp-pci.c                |  96 +++++++-
>  include/linux/psp-platform-access.h        |   4 +
>  include/uapi/linux/psp-dbc.h               | 147 ++++++++++++
>  tools/crypto/ccp/.gitignore                |   1 +
>  tools/crypto/ccp/Makefile                  |  13 +
>  tools/crypto/ccp/dbc.c                     |  72 ++++++
>  tools/crypto/ccp/dbc.py                    |  64 +++++
>  tools/crypto/ccp/dbc_cli.py                | 134 +++++++++++
>  tools/crypto/ccp/test_dbc.py               | 266 +++++++++++++++++++++
>  17 files changed, 1146 insertions(+), 17 deletions(-)
>  create mode 100644 drivers/crypto/ccp/dbc.c
>  create mode 100644 drivers/crypto/ccp/dbc.h
>  create mode 100644 include/uapi/linux/psp-dbc.h
>  create mode 100644 tools/crypto/ccp/.gitignore
>  create mode 100644 tools/crypto/ccp/Makefile
>  create mode 100644 tools/crypto/ccp/dbc.c
>  create mode 100644 tools/crypto/ccp/dbc.py
>  create mode 100755 tools/crypto/ccp/dbc_cli.py
>  create mode 100755 tools/crypto/ccp/test_dbc.py
> 
> 
> base-commit: b335f258e8ddafec0e8ae2201ca78d29ed8f85eb
> -- 
> 2.34.1

All applied.  Thanks.