linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Documentation: tee: Document TEE kernel interface
@ 2020-06-03 11:31 Sumit Garg
  2020-06-03 14:34 ` Maxim Uvarov
  0 siblings, 1 reply; 3+ messages in thread
From: Sumit Garg @ 2020-06-03 11:31 UTC (permalink / raw)
  To: jens.wiklander, corbet
  Cc: maxim.uvarov, jarkko.sakkinen, tee-dev, linux-doc, linux-kernel,
	op-tee, Sumit Garg

Update documentation with TEE bus infrastructure which provides an
interface for kernel client drivers to communicate with corresponding
Trusted Application.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
---
 Documentation/tee.txt | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/Documentation/tee.txt b/Documentation/tee.txt
index c8fad81..428d3b5 100644
--- a/Documentation/tee.txt
+++ b/Documentation/tee.txt
@@ -53,6 +53,28 @@ clients, forward them to the TEE and send back the results. In the case of
 supplicants the communication goes in the other direction, the TEE sends
 requests to the supplicant which then sends back the result.
 
+The TEE kernel interface
+========================
+
+Kernel provides a TEE bus infrastructure where a Trusted Application is
+represented as a device identified via Universally Unique Identifier (UUID) and
+client drivers register a table of supported device UUIDs.
+
+TEE bus infrastructure registers following APIs:
+-  match(): iterates over the client driver UUID table to find a corresponding
+   match for device UUID. If a match is found, then this particular device is
+   probed via corresponding probe API registered by the client driver. This
+   process happens whenever a device or a client driver is registered with TEE
+   bus.
+-  uevent(): notifies user-space (udev) whenever a new device is registered on
+   TEE bus for auto-loading of modularized client drivers.
+
+TEE bus device enumeration is specific to underlying TEE implementation, so it
+is left open for TEE drivers to provide corresponding implementation.
+
+Then TEE client driver can talk to a matched Trusted Application using APIs
+listed in include/linux/tee_drv.h.
+
 OP-TEE driver
 =============
 
@@ -112,6 +134,14 @@ kernel are handled by the kernel driver. Other RPC messages will be forwarded to
 tee-supplicant without further involvement of the driver, except switching
 shared memory buffer representation.
 
+OP-TEE device enumeration
+-------------------------
+
+OP-TEE provides a pseudo Trusted Application: drivers/tee/optee/device.c in
+order to support device enumeration. In other words, OP-TEE driver invokes this
+application to retrieve a list of Trusted Applications which can be registered
+as devices on the TEE bus.
+
 AMD-TEE driver
 ==============
 
-- 
2.7.4


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

* Re: [PATCH] Documentation: tee: Document TEE kernel interface
  2020-06-03 11:31 [PATCH] Documentation: tee: Document TEE kernel interface Sumit Garg
@ 2020-06-03 14:34 ` Maxim Uvarov
  2020-06-04  6:37   ` Sumit Garg
  0 siblings, 1 reply; 3+ messages in thread
From: Maxim Uvarov @ 2020-06-03 14:34 UTC (permalink / raw)
  To: Sumit Garg
  Cc: Jens Wiklander, corbet, Jarkko Sakkinen,
	tee-dev @ lists . linaro . org, linux-doc,
	Linux Kernel Mailing List, op-tee

Hello Sumit,

if this doc is for driver developers it might be useful to add some
code examples how to register drivers on tee bus.

Best regards,
Maxim.

On Wed, 3 Jun 2020 at 14:31, Sumit Garg <sumit.garg@linaro.org> wrote:
>
> Update documentation with TEE bus infrastructure which provides an
> interface for kernel client drivers to communicate with corresponding
> Trusted Application.
>
> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> ---
>  Documentation/tee.txt | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
>
> diff --git a/Documentation/tee.txt b/Documentation/tee.txt
> index c8fad81..428d3b5 100644
> --- a/Documentation/tee.txt
> +++ b/Documentation/tee.txt
> @@ -53,6 +53,28 @@ clients, forward them to the TEE and send back the results. In the case of
>  supplicants the communication goes in the other direction, the TEE sends
>  requests to the supplicant which then sends back the result.
>
> +The TEE kernel interface
> +========================
> +
> +Kernel provides a TEE bus infrastructure where a Trusted Application is
> +represented as a device identified via Universally Unique Identifier (UUID) and
> +client drivers register a table of supported device UUIDs.
> +
> +TEE bus infrastructure registers following APIs:
> +-  match(): iterates over the client driver UUID table to find a corresponding
> +   match for device UUID. If a match is found, then this particular device is
> +   probed via corresponding probe API registered by the client driver. This
> +   process happens whenever a device or a client driver is registered with TEE
> +   bus.
> +-  uevent(): notifies user-space (udev) whenever a new device is registered on
> +   TEE bus for auto-loading of modularized client drivers.
> +
> +TEE bus device enumeration is specific to underlying TEE implementation, so it
> +is left open for TEE drivers to provide corresponding implementation.
> +
> +Then TEE client driver can talk to a matched Trusted Application using APIs
> +listed in include/linux/tee_drv.h.
> +
>  OP-TEE driver
>  =============
>
> @@ -112,6 +134,14 @@ kernel are handled by the kernel driver. Other RPC messages will be forwarded to
>  tee-supplicant without further involvement of the driver, except switching
>  shared memory buffer representation.
>
> +OP-TEE device enumeration
> +-------------------------
> +
> +OP-TEE provides a pseudo Trusted Application: drivers/tee/optee/device.c in
> +order to support device enumeration. In other words, OP-TEE driver invokes this
> +application to retrieve a list of Trusted Applications which can be registered
> +as devices on the TEE bus.
> +
>  AMD-TEE driver
>  ==============
>
> --
> 2.7.4
>

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

* Re: [PATCH] Documentation: tee: Document TEE kernel interface
  2020-06-03 14:34 ` Maxim Uvarov
@ 2020-06-04  6:37   ` Sumit Garg
  0 siblings, 0 replies; 3+ messages in thread
From: Sumit Garg @ 2020-06-04  6:37 UTC (permalink / raw)
  To: Maxim Uvarov
  Cc: Jens Wiklander, Jonathan Corbet, Jarkko Sakkinen,
	tee-dev @ lists . linaro . org, Linux Doc Mailing List,
	Linux Kernel Mailing List, op-tee

On Wed, 3 Jun 2020 at 20:05, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>
> Hello Sumit,
>
> if this doc is for driver developers it might be useful to add some
> code examples how to register drivers on tee bus.

Sure, will add an example TEE client driver snippet for reference.

-Sumit

>
> Best regards,
> Maxim.
>
> On Wed, 3 Jun 2020 at 14:31, Sumit Garg <sumit.garg@linaro.org> wrote:
> >
> > Update documentation with TEE bus infrastructure which provides an
> > interface for kernel client drivers to communicate with corresponding
> > Trusted Application.
> >
> > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > ---
> >  Documentation/tee.txt | 30 ++++++++++++++++++++++++++++++
> >  1 file changed, 30 insertions(+)
> >
> > diff --git a/Documentation/tee.txt b/Documentation/tee.txt
> > index c8fad81..428d3b5 100644
> > --- a/Documentation/tee.txt
> > +++ b/Documentation/tee.txt
> > @@ -53,6 +53,28 @@ clients, forward them to the TEE and send back the results. In the case of
> >  supplicants the communication goes in the other direction, the TEE sends
> >  requests to the supplicant which then sends back the result.
> >
> > +The TEE kernel interface
> > +========================
> > +
> > +Kernel provides a TEE bus infrastructure where a Trusted Application is
> > +represented as a device identified via Universally Unique Identifier (UUID) and
> > +client drivers register a table of supported device UUIDs.
> > +
> > +TEE bus infrastructure registers following APIs:
> > +-  match(): iterates over the client driver UUID table to find a corresponding
> > +   match for device UUID. If a match is found, then this particular device is
> > +   probed via corresponding probe API registered by the client driver. This
> > +   process happens whenever a device or a client driver is registered with TEE
> > +   bus.
> > +-  uevent(): notifies user-space (udev) whenever a new device is registered on
> > +   TEE bus for auto-loading of modularized client drivers.
> > +
> > +TEE bus device enumeration is specific to underlying TEE implementation, so it
> > +is left open for TEE drivers to provide corresponding implementation.
> > +
> > +Then TEE client driver can talk to a matched Trusted Application using APIs
> > +listed in include/linux/tee_drv.h.
> > +
> >  OP-TEE driver
> >  =============
> >
> > @@ -112,6 +134,14 @@ kernel are handled by the kernel driver. Other RPC messages will be forwarded to
> >  tee-supplicant without further involvement of the driver, except switching
> >  shared memory buffer representation.
> >
> > +OP-TEE device enumeration
> > +-------------------------
> > +
> > +OP-TEE provides a pseudo Trusted Application: drivers/tee/optee/device.c in
> > +order to support device enumeration. In other words, OP-TEE driver invokes this
> > +application to retrieve a list of Trusted Applications which can be registered
> > +as devices on the TEE bus.
> > +
> >  AMD-TEE driver
> >  ==============
> >
> > --
> > 2.7.4
> >

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

end of thread, other threads:[~2020-06-04  6:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 11:31 [PATCH] Documentation: tee: Document TEE kernel interface Sumit Garg
2020-06-03 14:34 ` Maxim Uvarov
2020-06-04  6:37   ` Sumit Garg

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).