Hi,
This patch set introduces a new RPMB subsystem, based on patches from [1],
[2], and [3]. The RPMB subsystem aims at providing access to RPMB
partitions to other kernel drivers, in particular the OP-TEE driver. A new
user space ABI isn't needed, we can instead continue using the already
present ABI when writing the RPMB key during production.
I've added and removed things to keep only what is needed by the OP-TEE
driver. Since the posting of [3], there has been major changes in the MMC
subsystem so "mmc: block: register RPMB partition with the RPMB subsystem"
is in practice completely rewritten.
With this OP-TEE can access RPMB during early boot instead of having to
wait for user space to become available as in the current design [4].
This will benefit the efi variables [5] since we wont rely on userspace as
well as some TPM issues [6] that were solved.
The OP-TEE driver finds the correct RPMB device to interact with by
iterating over available devices until one is found with a programmed
authentication matching the one OP-TEE is using. This enables coexisting
users of other RPMBs since the owner can be determined by who knows the
authentication key.
The corresponding secure world OP-TEE patches are available at [7].
I've put myself as a maintainer for the RPMB subsystem as I have an
interest in the OP-TEE driver to keep this in good shape. However, if you'd
rather see someone else taking the maintainership that's fine too. I'll
help keep the subsystem updated regardless.
[1] https://lore.kernel.org/lkml/20230722014037.42647-1-shyamsaini@linux.micros…
[2] https://lore.kernel.org/lkml/20220405093759.1126835-2-alex.bennee@linaro.or…
[3] https://lore.kernel.org/linux-mmc/1478548394-8184-2-git-send-email-tomas.wi…
[4] https://optee.readthedocs.io/en/latest/architecture/secure_storage.html#rpm…
[5] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
[6] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
[7] https://github.com/jenswi-linaro/optee_os/tree/rpmb_probe
Thanks,
Jens
Changes since v4:
* "rpmb: add Replay Protected Memory Block (RPMB) subsystem"
- Describing struct rpmb_descr as RPMB description instead of descriptor
* "mmc: block: register RPMB partition with the RPMB subsystem"
- Addressing review comments
- Adding more comments for struct rpmb_frame
- Fixing assignment of reliable_wr_count and capacity in mmc_blk_rpmb_add()
* "optee: probe RPMB device using RPMB subsystem"
- Updating struct rpmb_dev_info to match changes in "rpmb: add Replay
Protected Memory Block (RPMB) subsystem"
Changes since v3:
* Move struct rpmb_frame into the MMC driver since the format of the RPMB
frames depend on the implementation, one format for eMMC, another for
UFS, and so on
* "rpmb: add Replay Protected Memory Block (RPMB) subsystem"
- Adding Reviewed-by: Linus Walleij <linus.walleij(a)linaro.org>
- Adding more description of the API functions
- Removing the set_dev_info() op from struct rpmb_ops, the needed information
is supplied in the arguments to rpmb_dev_register() instead.
- Getting rid of struct rpmb_ops since only the route_frames() op was
remaining, store that op directly in struct rpmb_dev
- Changed rpmb_interface_register() and rpmb_interface_unregister() to use
notifier_block instead of implementing the same thing ourselves
* "mmc: block: register RPMB partition with the RPMB subsystem"
- Moving the call to rpmb_dev_register() to be done at the end of
mmc_blk_probe() when the device is fully available
* "optee: probe RPMB device using RPMB subsystem"
- Use IS_REACHABLE(CONFIG_RPMB) to determine if the RPMB subsystem is
available
- Translate TEE_ERROR_STORAGE_NOT_AVAILABLE if encountered in get_devices()
to recognize the error in optee_rpmb_scan()
- Simplified optee_rpmb_scan() and optee_rpmb_intf_rdev()
Changes since v2:
* "rpmb: add Replay Protected Memory Block (RPMB) subsystem"
- Fixing documentation issues
- Adding a "depends on MMC" in the Kconfig
- Removed the class-device and the embedded device, struct rpmb_dev now
relies on the parent device for reference counting as requested
- Removed the now unneeded rpmb_ops get_resources() and put_resources()
since references are already taken in mmc_blk_alloc_rpmb_part() before
rpmb_dev_register() is called
- Added rpmb_interface_{,un}register() now that
class_interface_{,un}register() can't be used ay longer
* "mmc: block: register RPMB partition with the RPMB subsystem"
- Adding the missing error cleanup in alloc_idata()
- Taking the needed reference to md->disk in mmc_blk_alloc_rpmb_part()
instead of in mmc_rpmb_chrdev_open() and rpmb_op_mmc_get_resources()
* "optee: probe RPMB device using RPMB subsystem"
- Registering to get a notification when an RPMB device comes online
- Probes for RPMB devices each time an RPMB device comes online, until
a usable device is found
- When a usable RPMB device is found, call
optee_enumerate_devices(PTA_CMD_GET_DEVICES_RPMB)
- Pass type of rpmb in return value from OPTEE_RPC_CMD_RPMB_PROBE_NEXT
Changes since Shyam's RFC:
* Removed the remaining leftover rpmb_cdev_*() function calls
* Refactored the struct rpmb_ops with all the previous ops replaced, in
some sense closer to [3] with the route_frames() op
* Added rpmb_route_frames()
* Added struct rpmb_frame, enum rpmb_op_result, and enum rpmb_type from [3]
* Removed all functions not needed in the OP-TEE use case
* Added "mmc: block: register RPMB partition with the RPMB subsystem", based
on the commit with the same name in [3]
* Added "optee: probe RPMB device using RPMB subsystem" for integration
with OP-TEE
* Moved the RPMB driver into drivers/misc/rpmb-core.c
* Added my name to MODULE_AUTHOR() in rpmb-core.c
* Added an rpmb_mutex to serialize access to the IDA
* Removed the target parameter from all rpmb_*() functions since it's
currently unused
Jens Wiklander (3):
rpmb: add Replay Protected Memory Block (RPMB) subsystem
mmc: block: register RPMB partition with the RPMB subsystem
optee: probe RPMB device using RPMB subsystem
MAINTAINERS | 7 +
drivers/misc/Kconfig | 10 ++
drivers/misc/Makefile | 1 +
drivers/misc/rpmb-core.c | 232 ++++++++++++++++++++++++++++
drivers/mmc/core/block.c | 241 +++++++++++++++++++++++++++++-
drivers/tee/optee/core.c | 30 ++++
drivers/tee/optee/device.c | 7 +
drivers/tee/optee/ffa_abi.c | 8 +
drivers/tee/optee/optee_private.h | 21 ++-
drivers/tee/optee/optee_rpc_cmd.h | 35 +++++
drivers/tee/optee/rpc.c | 232 ++++++++++++++++++++++++++++
drivers/tee/optee/smc_abi.c | 7 +
include/linux/rpmb.h | 136 +++++++++++++++++
13 files changed, 964 insertions(+), 3 deletions(-)
create mode 100644 drivers/misc/rpmb-core.c
create mode 100644 include/linux/rpmb.h
--
2.34.1
Hello arm-soc maintainers,
Please pull these patches that introduces a TEE driver for Trusted
Services. You can see more details below from the signed tag. These
patches have been in for a few weeks.
Thanks,
Jens
The following changes since commit 4cece764965020c22cff7665b18a012006359095:
Linux 6.9-rc1 (2024-03-24 14:10:05 -0700)
are available in the Git repository at:
https://git.linaro.org/people/jens.wiklander/linux-tee.git/ tags/tee-ts-for-v6.10
for you to fetch changes up to 31611cc8faa082a96009c29822d9906d893cce57:
MAINTAINERS: tee: tstee: Add entry (2024-04-03 14:03:09 +0200)
----------------------------------------------------------------
TEE driver for Trusted Services
This introduces a TEE driver for Trusted Services [1].
Trusted Services is a TrustedFirmware.org project that provides a
framework for developing and deploying device Root of Trust services in
FF-A [2] Secure Partitions. The project hosts the reference
implementation of Arm Platform Security Architecture [3] for Arm
A-profile devices.
The FF-A Secure Partitions are accessible through the FF-A driver in
Linux. However, the FF-A driver doesn't have a user space interface so
user space clients currently cannot access Trusted Services. The goal of
this TEE driver is to bridge this gap and make Trusted Services
functionality accessible from user space.
[1] https://www.trustedfirmware.org/projects/trusted-services/
[2] https://developer.arm.com/documentation/den0077/
[3] https://www.arm.com/architecture/security-features/platform-security
----------------------------------------------------------------
Balint Dobszay (4):
tee: optee: Move pool_op helper functions
tee: tstee: Add Trusted Services TEE driver
Documentation: tee: Add TS-TEE driver
MAINTAINERS: tee: tstee: Add entry
Sumit Garg (1):
tee: Refactor TEE subsystem header files
Documentation/tee/index.rst | 1 +
Documentation/tee/ts-tee.rst | 71 ++++++
MAINTAINERS | 10 +
drivers/tee/Kconfig | 1 +
drivers/tee/Makefile | 1 +
drivers/tee/amdtee/amdtee_private.h | 2 +-
drivers/tee/amdtee/call.c | 2 +-
drivers/tee/amdtee/core.c | 3 +-
drivers/tee/amdtee/shm_pool.c | 2 +-
drivers/tee/optee/call.c | 2 +-
drivers/tee/optee/core.c | 66 +----
drivers/tee/optee/device.c | 2 +-
drivers/tee/optee/ffa_abi.c | 8 +-
drivers/tee/optee/notif.c | 2 +-
drivers/tee/optee/optee_private.h | 14 +-
drivers/tee/optee/rpc.c | 2 +-
drivers/tee/optee/smc_abi.c | 11 +-
drivers/tee/tee_core.c | 2 +-
drivers/tee/tee_private.h | 35 ---
drivers/tee/tee_shm.c | 67 ++++-
drivers/tee/tee_shm_pool.c | 2 +-
drivers/tee/tstee/Kconfig | 11 +
drivers/tee/tstee/Makefile | 3 +
drivers/tee/tstee/core.c | 480 ++++++++++++++++++++++++++++++++++++
drivers/tee/tstee/tstee_private.h | 92 +++++++
include/linux/tee_core.h | 306 +++++++++++++++++++++++
include/linux/tee_drv.h | 285 +++------------------
include/uapi/linux/tee.h | 1 +
28 files changed, 1095 insertions(+), 389 deletions(-)
create mode 100644 Documentation/tee/ts-tee.rst
create mode 100644 drivers/tee/tstee/Kconfig
create mode 100644 drivers/tee/tstee/Makefile
create mode 100644 drivers/tee/tstee/core.c
create mode 100644 drivers/tee/tstee/tstee_private.h
create mode 100644 include/linux/tee_core.h
Hello arm-soc maitainers,
Please pull this small patch converting the platform remove callback to
return void for the OP-TEE driver.
Thanks,
Jens
The following changes since commit 4cece764965020c22cff7665b18a012006359095:
Linux 6.9-rc1 (2024-03-24 14:10:05 -0700)
are available in the Git repository at:
https://git.linaro.org/people/jens.wiklander/linux-tee.git/ tags/optee-convert-platform-remove-callback-for-v6.10
for you to fetch changes up to 5c794301eb4e5373822e8898661bacdc7f46ba14:
tee: optee: smc: Convert to platform remove callback returning void (2024-03-25 11:51:06 +0100)
----------------------------------------------------------------
OP-TEE Convert to platform remove callback returning void
----------------------------------------------------------------
Uwe Kleine-König (1):
tee: optee: smc: Convert to platform remove callback returning void
drivers/tee/optee/smc_abi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Hi,
This patch set introduces a new RPMB subsystem, based on patches from [1],
[2], and [3]. The RPMB subsystem aims at providing access to RPMB
partitions to other kernel drivers, in particular the OP-TEE driver. A new
user space ABI isn't needed, we can instead continue using the already
present ABI when writing the RPMB key during production.
I've added and removed things to keep only what is needed by the OP-TEE
driver. Since the posting of [3], there has been major changes in the MMC
subsystem so "mmc: block: register RPMB partition with the RPMB subsystem"
is in practice completely rewritten.
With this OP-TEE can access RPMB during early boot instead of having to
wait for user space to become available as in the current design [4].
This will benefit the efi variables [5] since we wont rely on userspace as
well as some TPM issues [6] that were solved.
The OP-TEE driver finds the correct RPMB device to interact with by
iterating over available devices until one is found with a programmed
authentication matching the one OP-TEE is using. This enables coexisting
users of other RPMBs since the owner can be determined by who knows the
authentication key.
The corresponding secure world OP-TEE patches are available at [7].
I've put myself as a maintainer for the RPMB subsystem as I have an
interest in the OP-TEE driver to keep this in good shape. However, if you'd
rather see someone else taking the maintainership that's fine too. I'll
help keep the subsystem updated regardless.
[1] https://lore.kernel.org/lkml/20230722014037.42647-1-shyamsaini@linux.micros…
[2] https://lore.kernel.org/lkml/20220405093759.1126835-2-alex.bennee@linaro.or…
[3] https://lore.kernel.org/linux-mmc/1478548394-8184-2-git-send-email-tomas.wi…
[4] https://optee.readthedocs.io/en/latest/architecture/secure_storage.html#rpm…
[5] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
[6] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
[7] https://github.com/jenswi-linaro/optee_os/tree/rpmb_probe
Thanks,
Jens
Changes since v3:
* Move struct rpmb_frame into the MMC driver since the format of the RPMB
frames depend on the implementation, one format for eMMC, another for
UFS, and so on
* "rpmb: add Replay Protected Memory Block (RPMB) subsystem"
- Adding Reviewed-by: Linus Walleij <linus.walleij(a)linaro.org>
- Adding more description of the API functions
- Removing the set_dev_info() op from struct rpmb_ops, the needed information
is supplied in the arguments to rpmb_dev_register() instead.
- Getting rid of struct rpmb_ops since only the route_frames() op was
remaining, store that op directly in struct rpmb_dev
- Changed rpmb_interface_register() and rpmb_interface_unregister() to use
notifier_block instead of implementing the same thing ourselves
* "mmc: block: register RPMB partition with the RPMB subsystem"
- Moving the call to rpmb_dev_register() to be done at the end of
mmc_blk_probe() when the device is fully available
* "optee: probe RPMB device using RPMB subsystem"
- Use IS_REACHABLE(CONFIG_RPMB) to determine if the RPMB subsystem is
available
- Translate TEE_ERROR_STORAGE_NOT_AVAILABLE if encountered in get_devices()
to recognize the error in optee_rpmb_scan()
- Simplified optee_rpmb_scan() and optee_rpmb_intf_rdev()
Changes since v2:
* "rpmb: add Replay Protected Memory Block (RPMB) subsystem"
- Fixing documentation issues
- Adding a "depends on MMC" in the Kconfig
- Removed the class-device and the embedded device, struct rpmb_dev now
relies on the parent device for reference counting as requested
- Removed the now unneeded rpmb_ops get_resources() and put_resources()
since references are already taken in mmc_blk_alloc_rpmb_part() before
rpmb_dev_register() is called
- Added rpmb_interface_{,un}register() now that
class_interface_{,un}register() can't be used ay longer
* "mmc: block: register RPMB partition with the RPMB subsystem"
- Adding the missing error cleanup in alloc_idata()
- Taking the needed reference to md->disk in mmc_blk_alloc_rpmb_part()
instead of in mmc_rpmb_chrdev_open() and rpmb_op_mmc_get_resources()
* "optee: probe RPMB device using RPMB subsystem"
- Registering to get a notification when an RPMB device comes online
- Probes for RPMB devices each time an RPMB device comes online, until
a usable device is found
- When a usable RPMB device is found, call
optee_enumerate_devices(PTA_CMD_GET_DEVICES_RPMB)
- Pass type of rpmb in return value from OPTEE_RPC_CMD_RPMB_PROBE_NEXT
Changes since Shyam's RFC:
* Removed the remaining leftover rpmb_cdev_*() function calls
* Refactored the struct rpmb_ops with all the previous ops replaced, in
some sense closer to [3] with the route_frames() op
* Added rpmb_route_frames()
* Added struct rpmb_frame, enum rpmb_op_result, and enum rpmb_type from [3]
* Removed all functions not needed in the OP-TEE use case
* Added "mmc: block: register RPMB partition with the RPMB subsystem", based
on the commit with the same name in [3]
* Added "optee: probe RPMB device using RPMB subsystem" for integration
with OP-TEE
* Moved the RPMB driver into drivers/misc/rpmb-core.c
* Added my name to MODULE_AUTHOR() in rpmb-core.c
* Added an rpmb_mutex to serialize access to the IDA
* Removed the target parameter from all rpmb_*() functions since it's
currently unused
Jens Wiklander (3):
rpmb: add Replay Protected Memory Block (RPMB) subsystem
mmc: block: register RPMB partition with the RPMB subsystem
optee: probe RPMB device using RPMB subsystem
MAINTAINERS | 7 +
drivers/misc/Kconfig | 10 ++
drivers/misc/Makefile | 1 +
drivers/misc/rpmb-core.c | 232 +++++++++++++++++++++++++++++
drivers/mmc/core/block.c | 230 ++++++++++++++++++++++++++++-
drivers/tee/optee/core.c | 30 ++++
drivers/tee/optee/device.c | 7 +
drivers/tee/optee/ffa_abi.c | 8 +
drivers/tee/optee/optee_private.h | 21 ++-
drivers/tee/optee/optee_rpc_cmd.h | 35 +++++
drivers/tee/optee/rpc.c | 233 ++++++++++++++++++++++++++++++
drivers/tee/optee/smc_abi.c | 7 +
include/linux/rpmb.h | 136 +++++++++++++++++
13 files changed, 954 insertions(+), 3 deletions(-)
create mode 100644 drivers/misc/rpmb-core.c
create mode 100644 include/linux/rpmb.h
--
2.34.1
Hi,
I'm pleased to announce that OP-TEE version 4.2.0 is now available. The
list of
changes can be found in the changelog [1]. A summary will be published
shortly
as well summarizing this release. The branch for stable can be found here
[2].
Tested platforms in this release can be found here [3].
Many thanks to everyone who has contributed in any form to this release.
Let me take the opportunity to remind you that OP-TEE will celebrate ten
years
as an open source project in June of this year. The next Linaro Connect will
feature a panel discussion amongst the core maintainers along with a brief
history lesson as part of the 10 year celebration. For those who wish to
participate in person, registration details can be found here [4].
[1] https://github.com/OP-TEE/optee_os/blob/master/CHANGELOG.md
[2] https://github.com/OP-TEE/manifest/tree/4.2.0
[3]
https://github.com/OP-TEE/optee_os/commit/12d7c4ee4642d2d761e39fbcf21a06fb7…
[4] https://connect.linaro.org/
--
Regards,
Joakim Bech
| Distinguished Engineer | Linaro |
| Mobile: +46 73 697 37 14 | Address: Scheelevägen 17, 223 63 Lund, Sweden |