linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] Asynchronous notifications from secure world
@ 2021-06-16 10:36 Jens Wiklander
  2021-06-16 10:36 ` [PATCH v2 1/7] docs: staging/tee.rst: add a section on OP-TEE notifications Jens Wiklander
                   ` (7 more replies)
  0 siblings, 8 replies; 29+ messages in thread
From: Jens Wiklander @ 2021-06-16 10:36 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, op-tee, devicetree, linux-doc
  Cc: Jerome Forissier, Etienne Carriere, Sumit Garg, Vincent Guittot,
	Rob Herring, Jonathan Corbet, Ard Biesheuvel, Marc Zyngier,
	Jens Wiklander

Hi all,

This adds support for asynchronous notifications from OP-TEE in secure
world to the OP-TEE driver. This allows a design with a top half and bottom
half type of driver where the top half runs in secure interrupt context and
a notifications tells normal world to schedule a yielding call to do the
bottom half processing.

An interrupt is used to notify the driver that there are asynchronous
notifications pending.

v2:
* Added documentation
* Converted optee bindings to json-schema and added interrupt property
* Configure notification interrupt from DT instead of getting it
  from secure world, suggested by Ard Biesheuvel <ardb@kernel.org>.

Thanks,
Jens

Jens Wiklander (7):
  docs: staging/tee.rst: add a section on OP-TEE notifications
  dt-bindings: arm: Convert optee binding to json-schema
  dt-bindings: arm: optee: add interrupt property
  tee: fix put order in teedev_close_context()
  tee: add tee_dev_open_helper() primitive
  optee: separate notification functions
  optee: add asynchronous notifications

 .../bindings/arm/firmware/linaro,optee-tz.txt |  31 ---
 .../arm/firmware/linaro,optee-tz.yaml         |  57 +++++
 Documentation/staging/tee.rst                 |  27 +++
 drivers/tee/optee/Makefile                    |   1 +
 drivers/tee/optee/call.c                      |  27 +++
 drivers/tee/optee/core.c                      |  87 +++++--
 drivers/tee/optee/notif.c                     | 226 ++++++++++++++++++
 drivers/tee/optee/optee_msg.h                 |   9 +
 drivers/tee/optee/optee_private.h             |  23 +-
 drivers/tee/optee/optee_rpc_cmd.h             |  31 +--
 drivers/tee/optee/optee_smc.h                 |  75 +++++-
 drivers/tee/optee/rpc.c                       |  73 +-----
 drivers/tee/tee_core.c                        |  37 ++-
 include/linux/tee_drv.h                       |  27 +++
 14 files changed, 576 insertions(+), 155 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.txt
 create mode 100644 Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml
 create mode 100644 drivers/tee/optee/notif.c

-- 
2.31.1


^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: [PATCH v2 0/7] Asynchronous notifications from secure world
@ 2021-07-09  8:05 Etienne CARRIERE
  2021-07-13 11:11 ` Sudeep Holla
  0 siblings, 1 reply; 29+ messages in thread
From: Etienne CARRIERE @ 2021-07-09  8:05 UTC (permalink / raw)
  To: Sudeep Holla, Sumit Garg, Marc Zyngier, Jens Wiklander,
	Sudeep Holla, Linux Kernel Mailing List, linux-arm-kernel,
	OP-TEE TrustedFirmware, devicetree, Linux Doc Mailing List,
	Jerome Forissier, Vincent Guittot, Rob Herring, Jonathan Corbet,
	Ard Biesheuvel, Ard Biesheuvel, Etienne Carriere

Hello Sudeep and all,

On Wed, 7 Jul 2021 at 19:52, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> Hi Sumit,
>
> I was holding off you reply as I didn't have all the background on this.
> Achin did mention that this is preparatory work for FFA notifications.
> I did mention to him that this is more than that, it is custom extension
> to address what FF-A notification is trying to in standard way.
>
> I share same opinion as Marc Z.
>
> On Wed, Jul 07, 2021 at 11:22:23AM +0530, Sumit Garg wrote:
> > On Tue, 6 Jul 2021 at 18:16, Marc Zyngier <maz@kernel.org> wrote:
>
> [...]
>
> > >
> > > I don't care about OP-TEE. If you are proposing a contract between S
> > > and NS, it has to be TEE and OS independent. That's how the
> > > architecture works.
> > >
> >
> > Agree, here we are not proposing a common contract among the S and NS
> > world that every TEE (based on Arm TrustZone) will use to communicate
> > with REE (Linux in our case) but rather an OP-TEE specific
> > notifications feature that is built on top of OP-TEE specific ABIs.
> >
> > And I can see your arguments coming from an FFA perspective but there
> > are platforms like the ones based on Armv7 which don't support FFA
> > ABI. Maybe Jens can elaborate how this feature will fit in when FFA
> > comes into picture?
> >
>
> I can understand that but won't those platforms add the support both in
> the kernel(current series) and secure world to address notifications.
> While you could argue that it is small extension to what is already present
> but I prefer they support FF-A is they need such a support instead of adding
> custom mechanisms. It is hard to maintain and each vendor will deviate
> from this custom mechanism and soon we will have bunch of them to handle.


There exist armv7-a platforms that expect OP-TEE notification support and will not move the FF-A, like the stm32mp15. This platform won't move to FF-A mainly due to the memory cost of the added SPM layer and the device physical constraints.
We have a usecase for OP-TEE notification. We're working on the integration of an SCMI server in OP-TEE. SCMI notification is a feature needed is this scope and it requires OP-TEE async notification means as those proposed here.

This OP-TEE async notif also brings a lot of value in OP-TEE as it allows a OP-TEE secure thread (i.e. executing a trusted application service) to gently wait on a secure interrupt (as a slow bus transaction completion or many other usecase) with the CPU relaxed. This support is provided by the proposed series. I believe existing device should be able to leverage this OP-TEE feature without needing their OP-TEE to move to the new FF-A interface.

Regards,
Etienne

>
> [...]

ST Restricted

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2021-07-20 10:03 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16 10:36 [PATCH v2 0/7] Asynchronous notifications from secure world Jens Wiklander
2021-06-16 10:36 ` [PATCH v2 1/7] docs: staging/tee.rst: add a section on OP-TEE notifications Jens Wiklander
2021-06-16 10:36 ` [PATCH v2 2/7] dt-bindings: arm: Convert optee binding to json-schema Jens Wiklander
2021-06-16 16:03   ` Rob Herring
2021-06-16 16:05   ` Rob Herring
2021-06-22  8:38     ` Jens Wiklander
2021-06-16 10:36 ` [PATCH v2 3/7] dt-bindings: arm: optee: add interrupt property Jens Wiklander
2021-06-16 16:05   ` Rob Herring
2021-06-22  8:41     ` Jens Wiklander
2021-06-16 10:36 ` [PATCH v2 4/7] tee: fix put order in teedev_close_context() Jens Wiklander
2021-06-16 10:36 ` [PATCH v2 5/7] tee: add tee_dev_open_helper() primitive Jens Wiklander
2021-06-16 10:36 ` [PATCH v2 6/7] optee: separate notification functions Jens Wiklander
2021-06-16 10:36 ` [PATCH v2 7/7] optee: add asynchronous notifications Jens Wiklander
2021-06-16 14:08   ` Ard Biesheuvel
2021-06-17  4:33 ` [PATCH v2 0/7] Asynchronous notifications from secure world Sumit Garg
2021-06-17  6:10   ` Jens Wiklander
2021-07-06  7:25     ` Sumit Garg
2021-07-06 10:36       ` Marc Zyngier
2021-07-06 11:39         ` Sumit Garg
2021-07-06 12:46           ` Marc Zyngier
2021-07-07  5:52             ` Sumit Garg
2021-07-07  6:54               ` Jens Wiklander
2021-07-07 17:51               ` Sudeep Holla
2021-07-08 12:56                 ` Sumit Garg
2021-07-09  8:05 Etienne CARRIERE
2021-07-13 11:11 ` Sudeep Holla
2021-07-20  6:45   ` Jens Wiklander
2021-07-20  7:50     ` Sudeep Holla
2021-07-20  9:59       ` Jens Wiklander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).