Hi,
[preview of what I indend to mail out as PATCH v6 later]
This patch set introduces a generic TEE subsystem. The TEE subsystem will
contain drivers for various TEE implementations. A TEE (Trusted Execution
Environment) is a trusted OS running in some secure environment, for
example, TrustZone on ARM CPUs, or a separate secure co-processor etc.
Regarding use cases, TrustZone has traditionally been used for
offloading secure tasks to the secure world. Examples include:
- Secure key handling where the OS may or may not have direct access to key
material.
- E-commerce and payment technologies. Credentials, credit card numbers etc
could be stored in a more secure environment.
- Trusted User Interface (TUI) to ensure that no-one can snoop PIN-codes
etc.
- Secure boot to ensure that loaded binaries haven’t been tampered with.
It’s not strictly needed for secure boot, but you could enhance security
by leveraging a TEE during boot.
- Digital Rights Management (DRM), the studios provides content with
different resolution depending on the security of the device. Higher
security means higher resolution.
A TEE could also be used in existing and new technologies. For example IMA
(Integrity Measurement Architecture) which has been in the kernel for quite
a while. Today you can enhance security by using a TPM-chip to sign the IMA
measurement list. This is something that you also could do by leveraging a
TEE.
Another example could be in 2-factor authentication which is becoming
increasingly more important. FIDO (https://fidoalliance.org) for example
are using public key cryptography in their 2-factor authentication standard
(U2F). With FIDO, a private and public key pair will be generated for every
site you visit and the private key should never leave the local device.
This is an example where you could use secure storage in a TEE for the
private key.
Today you will find a quite a few different out of tree implementations of
TEE drivers which tends to fragment the TEE ecosystem and development. We
think it would be a good idea to have a generic TEE driver integrated in
the kernel which would serve as a base for several different TEE solutions,
no matter if they are on-chip like TrustZone or if they are on a separate
crypto co-processor.
To develop this TEE subsystem we have been using the open source TEE called
OP-TEE (https://github.com/OP-TEE/optee_os) and therefore this would be the
first TEE solution supported by this new subsystem. OP-TEE is a
GlobalPlatform compliant TEE, however this TEE subsystem is not limited to
only GlobalPlatform TEEs, instead we have tried to design it so that it
should work with other TEE solutions also.
"tee: generic TEE subsystem" brings in the generic TEE subsystem which
helps when writing a driver for a specific TEE, for example, OP-TEE.
"tee: add OP-TEE driver" is an OP-TEE driver which uses the subsystem to do
its work.
This patch set has been prepared in cooperation with Javier González who
proposed "Generic TrustZone Driver in Linux Kernel" patches 28 Nov 2014,
https://lwn.net/Articles/623380/ . We've since then changed the scope to
TEE instead of TrustZone.
We have discussed the design on tee-dev(a)lists.linaro.org (archive at
https://lists.linaro.org/pipermail/tee-dev/) with people from other
companies, including Valentin Manea <valentin.manea(a)huawei.com>,
Emmanuel MICHEL <emmanuel.michel(a)st.com>,
Jean-michel DELORME <jean-michel.delorme(a)st.com>,
and Joakim Bech <joakim.bech(a)linaro.org>. Our main concern has been to
agree on something that is generic enough to support many different
TEEs while still keeping the interface together.
At last Linaro Connect, SFO15, I got some additional feedback on this patch
set:
* As each TEE driver has their own tee-supplicant (if any) we need an
automated way of starting the correct tee-supplicant
- Addressed with exposing version info (id and capabilities) of a TEE
driver in sysfs
* Relying on using only contiguous physical memory when communicating with
secure world is too constrained
- Partially addressed with an updated OP-TEE message protocol in the
OP-TEE driver
- The main concerns are to avoid incompatible user space API changes and
also avoid fundamental incompatible changes to the TEE subsystem or
driver when adding support for physically fragmented memory later on.
v6:
* Changed smccc interface to let the compiler marshal most of the
parameters
* Added ARCH64 capability for smccc interface
* Changed the PSCI firmware calls (both arm and arm64) to use the new
generic smccc interface instead instead of own assembly functions.
* Move optee DT bindings to below arm/firmware
* Defines method for OP-TEE driver to call secure world in DT, smc or hvc
* Exposes the version info (id and capabilities) of a TEE driver in sysfs
to easily spawn corresponding tee-supplicant when device is ready
* Update OP-TEE Message Protocol to better cope with fragmented physical
memory
* Read time directly from OP-TEE driver instead of forwarding the RPC
request to tee-supplicant
v5:
* Replaced kref reference counting for the device with a size_t instead as
the counter is always protected by a mutex
v4:
* Rebased on 4.1
* Redesigned the synchronization around entry exit of normal SMC
* Replaced rwsem on the driver instance with kref and completion since
rwsem wasn't intended to be used in this way
* Expanded the TEE_IOCTL_PARAM_ATTR_TYPE_MASK to make room for
future additional parameter types
* Documents TEE subsystem and OP-TEE driver
* Replaced TEE_IOC_CMD with TEE_IOC_OPEN_SESSION, TEE_IOC_INVOKE,
TEE_IOC_CANCEL and TEE_IOC_CLOSE_SESSION
* DT bindings in a separate patch
* Assembly parts moved to arch/arm and arch/arm64 respectively, in a
separate patch
* Redefined/clarified the meaning of OPTEE_SMC_SHM_CACHED
* Removed CMA usage to limit the scope of the patch set
v3:
* Rebased on 4.1-rc3 (dma_buf_export() API change)
* A couple of small sparse fixes
* Documents bindings for OP-TEE driver
* Updated MAINTAINERS
v2:
* Replaced the stubbed OP-TEE driver with a real OP-TEE driver
* Removed most APIs not needed by OP-TEE in current state
* Update Documentation/ioctl/ioctl-number.txt with correct path to tee.h
* Rename tee_shm_pool_alloc_cma() to tee_shm_pool_alloc()
* Moved tee.h into include/uapi/linux/
* Redefined tee.h IOCTL macros to be directly based on _IOR and friends
* Removed version info on the API to user space, a data blob which
can contain an UUID is left for user space to be able to tell which
protocol to use in TEE_IOC_CMD
* Changed user space exposed structures to only have types with __ prefix
* Dropped THIS_MODULE from tee_fops
* Reworked how the driver is registered and ref counted:
- moved from using an embedded struct miscdevice to an embedded struct
device.
- uses an struct rw_semaphore as synchronization for driver detachment
- uses alloc/register pattern from TPM
Thanks,
Jens
Jens Wiklander (6):
arm/arm64: add smccc
drivers: psci: replace psci firmware calls
dt/bindings: add bindings for optee
tee: generic TEE subsystem
tee: add OP-TEE driver
Documentation: tee subsystem and op-tee driver
Documentation/00-INDEX | 2 +
.../bindings/arm/firmware/optee,optee-tz.txt | 29 +
.../devicetree/bindings/vendor-prefixes.txt | 1 +
Documentation/ioctl/ioctl-number.txt | 1 +
Documentation/tee.txt | 117 +++
MAINTAINERS | 13 +
arch/arm/Kconfig | 4 +
arch/arm/kernel/Makefile | 3 +-
arch/arm/kernel/psci-call.S | 31 -
arch/arm/kernel/smccc-call.S | 49 ++
arch/arm/kernel/smccc.c | 18 +
arch/arm64/Kconfig | 4 +
arch/arm64/kernel/Makefile | 3 +-
arch/arm64/kernel/psci-call.S | 28 -
arch/arm64/kernel/smccc-call.S | 43 +
arch/arm64/kernel/smccc.c | 18 +
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/firmware/psci.c | 21 +-
drivers/tee/Kconfig | 18 +
drivers/tee/Makefile | 4 +
drivers/tee/optee/Kconfig | 8 +
drivers/tee/optee/Makefile | 5 +
drivers/tee/optee/call.c | 397 ++++++++++
drivers/tee/optee/core.c | 502 ++++++++++++
drivers/tee/optee/optee_msg.h | 420 ++++++++++
drivers/tee/optee/optee_private.h | 146 ++++
drivers/tee/optee/optee_smc.h | 418 ++++++++++
drivers/tee/optee/rpc.c | 322 ++++++++
drivers/tee/optee/supp.c | 212 +++++
drivers/tee/tee.c | 869 +++++++++++++++++++++
drivers/tee/tee_private.h | 80 ++
drivers/tee/tee_shm.c | 324 ++++++++
drivers/tee/tee_shm_pool.c | 133 ++++
include/linux/arm-smccc.h | 98 +++
include/linux/tee_drv.h | 300 +++++++
include/uapi/linux/tee.h | 383 +++++++++
37 files changed, 4964 insertions(+), 63 deletions(-)
create mode 100644 Documentation/devicetree/bindings/arm/firmware/optee,optee-tz.txt
create mode 100644 Documentation/tee.txt
delete mode 100644 arch/arm/kernel/psci-call.S
create mode 100644 arch/arm/kernel/smccc-call.S
create mode 100644 arch/arm/kernel/smccc.c
delete mode 100644 arch/arm64/kernel/psci-call.S
create mode 100644 arch/arm64/kernel/smccc-call.S
create mode 100644 arch/arm64/kernel/smccc.c
create mode 100644 drivers/tee/Kconfig
create mode 100644 drivers/tee/Makefile
create mode 100644 drivers/tee/optee/Kconfig
create mode 100644 drivers/tee/optee/Makefile
create mode 100644 drivers/tee/optee/call.c
create mode 100644 drivers/tee/optee/core.c
create mode 100644 drivers/tee/optee/optee_msg.h
create mode 100644 drivers/tee/optee/optee_private.h
create mode 100644 drivers/tee/optee/optee_smc.h
create mode 100644 drivers/tee/optee/rpc.c
create mode 100644 drivers/tee/optee/supp.c
create mode 100644 drivers/tee/tee.c
create mode 100644 drivers/tee/tee_private.h
create mode 100644 drivers/tee/tee_shm.c
create mode 100644 drivers/tee/tee_shm_pool.c
create mode 100644 include/linux/arm-smccc.h
create mode 100644 include/linux/tee_drv.h
create mode 100644 include/uapi/linux/tee.h
--
1.9.1
Hi OP-TEE Experts,
We are trying to setup the optee-demo on a ARMv7 based Freescale LS1021a SoC.
During the same, I was trying to figure out various possibilities regarding OP-TEE boot flow on ARMv7.
Currently the boot flow which we have implemented looks like: boot-loader->OP-TEE->boot-loader->linux.
I was thinking if the boot-flow could be like: boot-loader->OP-TEE->linux. Regarding this I was able to figure out a macro in optee_os CFG_TEE_GDB_BOOT (refer [1]) which is used to save linux boot args from GDB to boot preloaded linux.
So can I use this macro to save boot args passed from boot-loader and directly pass on control to linux from optee_os or can I create another macro CFG_TEE_LINUX_BOOT to perform the same function as CFG_TEE_GDB_BOOT does?
If someone can help clarify this it would be very much appreciated.
[1] https://github.com/OP-TEE/optee_os/blob/master/core/arch/arm/kernel/generic…
Thanks and regards,
Sumit
Hello,
We're almost ready to set the 1.0.0 tag. I need your help to finalize it.
*Step 1/* Last pull-requests to be merged
Here are the pull-requests on hold:
- https://github.com/OP-TEE/optee_os/pull/486: the release notes
attempt. *Joakim / Jérôme*, could you have a look and add what I missed
(and fix english too)
- https://github.com/OP-TEE/build/pull/13: mostly the juno build, but
also some other stuff (clean / GP tests). Cédric tested Juno runtime on
standard xtest successfully. *Jérome / Jens*, could you add Reviewed-By
and/or Tested-by tags if it looks ok?
- https://github.com/OP-TEE/manifest/pull/6: manifest on Juno. Tested
successfully by *Cedric. Cédric / Jens*, could you add the tags when
you're happy with it?
- https://github.com/OP-TEE/optee_os/pull/488: Remove setup script of
Juno. *Cedric / Jens*, could you add the tags when you're happy with it?
- *All*: did I miss anything to push for 1.0.0
*Step 2/* Set 1.0.0-rc2
Once they are merged, I will create a new tag 1.0.0-rc2, and update
https://github.com/OP-TEE/manifest/pull/7 with it.
*Step 3/:* Tests all platfforms
Then tests will be required using (note this is the "stable" version of the
xml that is to be used)
repo init -u https://github.com/pascal-brand-st-dev/manifest.git -m <target>
*_stable*.xml -b newtag
Could you then please test the following targets, and add a Tested-By on
https://github.com/OP-TEE/manifest/pull/7:
- *Pascal*: QEMU (default) + STM
- *Jerome*: HiKey
- *SY* or *James*: Mediatek
- *Jens*: FVP
- *Cedric*: Juno
*Step 4/*: Set final 1.0.0
Last step in my plate:
- merge https://github.com/OP-TEE/manifest/pull/7 using 1.0.0 version
instead of 1.0.0-rc2
- set 1.0.0 on all components
- remove 1.0.0-rcxxx tags from all OP-TEE gits
*Step 5/* Final test
Then the "+" step: test the final 1.0.0 using
repo init -u https://github.com/OP-TEE/manifest.git -m <target>*_stable*.xml
-b 1.0.0
Let me know in case I missed anything.
Thanks all,
Pascal.
Hi OP-TEE experts,
I am working on to integrate OP-TEE secure OS with u-boot on ARMv7 and came across following question
that I need to clarify:
- It seems that optee-os doesn't save u-boot context at its entry point during its initialization.
o Like registers r0-r12, sp etc.
- Is it the responsibility of boot-loader (u-boot in my case) to save its context, pass
control to optee-os and then retrieve context after optee-os returns control back to boot-loader?
If someone can help clarify this it would be very much appreciated.
Thanks and regards,
Sumit
Hi,
With goal of understanding ARM TrustZone and security feature, I
started with trying to setup OP-TEE on ARM FVP,
I followed the steps:
https://github.com/OP-TEE/optee_os
After all build over linux is not booting on VP. It stuck with:
it show
PEI 886ms
DXE 84 ms
BDS 5ms
Total Time = 976 ms
<=== No more activity beyond that
Any pointer would be helpful.
Thanks,
Chetan Nanda
Hi OP-TEE experts,
I'm looking at OP-TEE Secure OS and came across number of questions that I need to clarify:
- It seems OP-TEE is using only L1 page tables
* It has one large L1 page table for kernel which maps flat 4 GB space (referenced by TTBR1); every thread has another L1 translation table(s) referenced by TTBR0 which map 32 MB of virtual addresses
* Does this mean that the smallest unit of memory that it can map is 1 MB?
* If Trusted Application code/data/stack is 16 KB total, does it still consume 1 MB of DRAM?
- TA Memory usage
* Browsing through OP-TEE source (tee_ta_load_user_ta() function) we noticed that heap/stack for all TAs seems to be allocated from the same pool, is this correct?
* If yes, then can different TAs see heap/stack of each other? If this is possible, then what is security model of OP-TEE? Does it assume that all TAs are trusted and don't need isolation from each other? Any high level design description would be very helpful
- Access to HW resources
* If TA needs to access some HW resources, how can this be done? Does OP-TEE has concept of loadable secure Drivers?
- Suspend/Resume
* Does OP-TEE support saving/restoring its state for CPU suspend/resume cycle?
- Scheduling of TA threads
* Does OP-TEE Swd kernel have periodic timer interrupt handler that causes the task switch or does it rely on Nwd making some sort of SMC call for that?
If someone can help clarify this it would be very much appreciated.
Thanks,
Sergey Blotsky
Hi TEE Experts,
We are trying to setup the optee-demo on a ARMv7 based Freescale SoC.
During the same, I noticed that the SMC calls from the optee-linux-driver directly land up on the optee-os side.
I was thinking that just like the ARMv8 flow, where the SMC handling should ideally be done by a Arm Trusted Firmware
(or an equivalent secure-run-time firmware) agent running in EL3 privilege level, on ARMv7 too, if we have a resident
ATF (or secure firmware) installed the SMC calls should be handled there.
In the opteep-design documentation can the references to SECURE MONITOR LAYER (see [1]) be assumed to be equivalent to a
ATF like firmware.
Is this understanding correct or am I missing something here?
[1] https://github.com/OP-TEE/optee_os/blob/master/documentation/optee_design.md
Regards,
Bhupesh
Hi,
Here's preview 2 of the patchset I'm intending to send as PATCH v4 to
the kernel mailing lists later. I've addressed previous comments applicable
for the scope of this patchset.
Please take a look to see that we're moving in the right direction.
The "arm/arm64: add smccc ARCH32" patch doesn't contain complicated code,
but the usage of Kconfig deserves some extra attention.
OP-TEE patches to work with this in:
https://github.com/jenswi-linaro/optee_client/tree/drv4_wip2https://github.com/jenswi-linaro/optee_os/tree/drv4_wip2https://github.com/jenswi-linaro/optee_test/tree/drv4_wip2
The kernel patches are also available at
https://github.com/jenswi-linaro/linux/tree/gen_optee_driver4_wip2
v4 preview 2:
* Redesigned the synchronization around entry exit of normal SMC (again)
* Replaced rwsem with kref and completion since rwsem wasn't intended to
be used in this way
* Replaced semaphores with completions
* Expanded the TEE_IOCTL_PARAM_ATTR_TYPE_MASK to make room for
additional parameter types
* Some RPC cleanup, don't use struct optee_msg_arg::func for instance
* Changed tee_shm_pool_alloc_res_mem() to allow greater flexibility when
defining driver private and dma-buf shared memory
v4 preview 1:
* Documents TEE subsystem and OP-TEE driver
* Replaced TEE_IOC_CMD with TEE_IOC_OPEN_SESSION, TEE_IOC_INVOKE,
TEE_IOC_CANCEL and TEE_IOC_CLOSE_SESSION
* DT bindings in a separate patch
* Assembly parts moved to arch/arm and arch/arm64 respectively, in a
separate patch
* Redesigned the synchronization around entry exit of normal SMC
* Redefined/clarified the meaning of OPTEE_SMC_SHM_CACHED
* Removed CMA usage to limit the scope of the patch set
v3:
* Rebased on 4.1-rc3 (dma_buf_export() API change)
* A couple of small sparse fixes
* Documents bindings for OP-TEE driver
* Updated MAINTAINERS
v2:
* Replaced the stubbed OP-TEE driver with a real OP-TEE driver
* Removed most APIs not needed by OP-TEE in current state
* Update Documentation/ioctl/ioctl-number.txt with correct path to tee.h
* Rename tee_shm_pool_alloc_cma() to tee_shm_pool_alloc()
* Moved tee.h into include/uapi/linux/
* Redefined tee.h IOCTL macros to be directly based on _IOR and friends
* Removed version info on the API to user space, a data blob which
can contain an UUID is left for user space to be able to tell which
protocol to use in TEE_IOC_CMD
* Changed user space exposed structures to only have types with __ prefix
* Dropped THIS_MODULE from tee_fops
* Reworked how the driver is registered and ref counted:
- moved from using an embedded struct miscdevice to an embedded struct
device.
- uses an struct rw_semaphore as synchronization for driver detachment
- uses alloc/register pattern from TPM
Thanks,
Jens
Jens Wiklander (5):
arm/arm64: add smccc ARCH32
dt/bindings: add bindings for optee
tee: generic TEE subsystem
tee: add OP-TEE driver
Documentation: tee subsystem and op-tee driver
Documentation/00-INDEX | 2 +
Documentation/devicetree/bindings/optee/optee.txt | 17 +
.../devicetree/bindings/vendor-prefixes.txt | 1 +
Documentation/ioctl/ioctl-number.txt | 1 +
Documentation/tee.txt | 117 +++
MAINTAINERS | 14 +
arch/arm/Kconfig | 4 +
arch/arm/kernel/Makefile | 2 +
arch/arm/kernel/smccc-call.S | 26 +
arch/arm/kernel/smccc.c | 17 +
arch/arm64/Kconfig | 4 +
arch/arm64/kernel/Makefile | 1 +
arch/arm64/kernel/smccc-call.S | 34 +
arch/arm64/kernel/smccc.c | 17 +
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/tee/Kconfig | 18 +
drivers/tee/Makefile | 4 +
drivers/tee/optee/Kconfig | 8 +
drivers/tee/optee/Makefile | 5 +
drivers/tee/optee/call.c | 390 ++++++++++
drivers/tee/optee/core.c | 451 +++++++++++
drivers/tee/optee/optee_msg.h | 334 ++++++++
drivers/tee/optee/optee_private.h | 129 ++++
drivers/tee/optee/optee_smc.h | 466 ++++++++++++
drivers/tee/optee/rpc.c | 248 ++++++
drivers/tee/optee/supp.c | 212 ++++++
drivers/tee/tee.c | 839 +++++++++++++++++++++
drivers/tee/tee_private.h | 80 ++
drivers/tee/tee_shm.c | 324 ++++++++
drivers/tee/tee_shm_pool.c | 133 ++++
include/linux/arm-smccc.h | 80 ++
include/linux/tee_drv.h | 306 ++++++++
include/uapi/linux/tee.h | 376 +++++++++
34 files changed, 4663 insertions(+)
create mode 100644 Documentation/devicetree/bindings/optee/optee.txt
create mode 100644 Documentation/tee.txt
create mode 100644 arch/arm/kernel/smccc-call.S
create mode 100644 arch/arm/kernel/smccc.c
create mode 100644 arch/arm64/kernel/smccc-call.S
create mode 100644 arch/arm64/kernel/smccc.c
create mode 100644 drivers/tee/Kconfig
create mode 100644 drivers/tee/Makefile
create mode 100644 drivers/tee/optee/Kconfig
create mode 100644 drivers/tee/optee/Makefile
create mode 100644 drivers/tee/optee/call.c
create mode 100644 drivers/tee/optee/core.c
create mode 100644 drivers/tee/optee/optee_msg.h
create mode 100644 drivers/tee/optee/optee_private.h
create mode 100644 drivers/tee/optee/optee_smc.h
create mode 100644 drivers/tee/optee/rpc.c
create mode 100644 drivers/tee/optee/supp.c
create mode 100644 drivers/tee/tee.c
create mode 100644 drivers/tee/tee_private.h
create mode 100644 drivers/tee/tee_shm.c
create mode 100644 drivers/tee/tee_shm_pool.c
create mode 100644 include/linux/arm-smccc.h
create mode 100644 include/linux/tee_drv.h
create mode 100644 include/uapi/linux/tee.h
--
1.9.1
Hello Jens,
Here are some comments on patch V4.
*smccc_call32*
Do we only target aarch32 optee_os?
*Buffer management*
It looks that temporary buffers are now managed in the client API, not in
the driver anymore. The positive point is that it makes the driver
lighter. But the drawbacks is the number of extra ioctl used when using a
temporary buffer: 1 to allocate, 1 to map, and 1 to unmap. So a
TEEC_InvokeCommand could lead to 13 ioctls.
What about the performances? Could not it be optimized in some way? Could
we manage temporary buffers, dma buffers and "other" buffers in different
ways?
*Kernel API*
The GP API looks managed in the Client part now, without a 1-to-1 mapping
in kernel side. That means that we have lost the Kernel API, which is
useful when a given driver wants to use a TA.
It looks we are really missing this Kernel API. This is the most critical
point of our review.
*Non-zero copy*
When using RegisterSharedMemory(), it looks we do not benefit from the fact
that the original buffer was allocated using dma_buf. Hence we never have
zero-copy in the current version when using RegisterSharedMemory as we will
furher use the so-called shadowbuffer.
Can you confirm this limitation can be removed in further versions of the
patch?
By the way, we think xtest 5006, which calls TEEC_RegisterSharedBuffer()
twice may lead to memory leaks (it could be the same with the current
optee_linuxdriver).
*List of SHM*
The list of the SHM allocated is now contained in the device, whereas it
used to be in the context in optee_linuxdriver. This is not clear to us
whether this is an issue or not.
*tee_shm_pool_alloc_res_mem()*
If we'd like to use the generic function for a LX backend, we would need to
add the following arguments to the function:
- the alignment of the private region, and the one of the dma region
- a way to give the limits between both region (the size of the 1st
region, or anything else).
Emmanuel and I would like to check few other points in the proposal. We'll
come back to you if we have any other remarks.
Best regards,
Jean Michel / Emmanuel / Etienne / Pascal
Hi,
Here's a preview of the patchset I'm intending to send as PATCH v4 to
the kernel mailing lists later.
Please take a look to see that we're moving in the right direction.
The "arm/arm64: add smccc ARCH32" patch doesn't contain complicated code,
but the usage of Kconfig deserves some extra attention.
OP-TEE patches to work with this in:
https://github.com/jenswi-linaro/optee_client/tree/drv4_wiphttps://github.com/jenswi-linaro/optee_os/tree/drv4_wip
The kernel patches are available at
https://github.com/jenswi-linaro/linux/tree/gen_optee_driver4_wip
v4 preview:
* Documents TEE subsystem and OP-TEE driver
* Replaced TEE_IOC_CMD with TEE_IOC_OPEN_SESSION, TEE_IOC_INVOKE,
TEE_IOC_CANCEL and TEE_IOC_CLOSE_SESSION
* DT bindings in a separate patch
* Assembly parts moved to arch/arm and arch/arm64 respectively, in a
separate patch
* Redesigned the synchronization around entry exit of normal SMC
* Redefined/clarified the meaning of OPTEE_SMC_SHM_CACHED
* Removed CMA usage to limit the scope of the patch set
v3:
* Rebased on 4.1-rc3 (dma_buf_export() API change)
* A couple of small sparse fixes
* Documents bindings for OP-TEE driver
* Updated MAINTAINERS
v2:
* Replaced the stubbed OP-TEE driver with a real OP-TEE driver
* Removed most APIs not needed by OP-TEE in current state
* Update Documentation/ioctl/ioctl-number.txt with correct path to tee.h
* Rename tee_shm_pool_alloc_cma() to tee_shm_pool_alloc()
* Moved tee.h into include/uapi/linux/
* Redefined tee.h IOCTL macros to be directly based on _IOR and friends
* Removed version info on the API to user space, a data blob which
can contain an UUID is left for user space to be able to tell which
protocol to use in TEE_IOC_CMD
* Changed user space exposed structures to only have types with __ prefix
* Dropped THIS_MODULE from tee_fops
* Reworked how the driver is registered and ref counted:
- moved from using an embedded struct miscdevice to an embedded struct
device.
- uses an struct rw_semaphore as synchronization for driver detachment
- uses alloc/register pattern from TPM
Thanks,
Jens
Jens Wiklander (5):
arm/arm64: add smccc ARCH32
dt/bindings: add bindings for optee
tee: generic TEE subsystem
tee: add OP-TEE driver
Documentation: tee subsystem and op-tee driver
Documentation/00-INDEX | 2 +
Documentation/devicetree/bindings/optee/optee.txt | 17 +
.../devicetree/bindings/vendor-prefixes.txt | 1 +
Documentation/ioctl/ioctl-number.txt | 1 +
Documentation/tee.txt | 117 +++
MAINTAINERS | 14 +
arch/arm/Kconfig | 4 +
arch/arm/kernel/Makefile | 2 +
arch/arm/kernel/smccc-call.S | 26 +
arch/arm/kernel/smccc.c | 17 +
arch/arm64/Kconfig | 4 +
arch/arm64/kernel/Makefile | 1 +
arch/arm64/kernel/smccc-call.S | 34 +
arch/arm64/kernel/smccc.c | 17 +
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/tee/Kconfig | 18 +
drivers/tee/Makefile | 4 +
drivers/tee/optee/Kconfig | 8 +
drivers/tee/optee/Makefile | 5 +
drivers/tee/optee/call.c | 338 +++++++++
drivers/tee/optee/core.c | 430 +++++++++++
drivers/tee/optee/optee_msg.h | 355 +++++++++
drivers/tee/optee/optee_private.h | 131 ++++
drivers/tee/optee/optee_smc.h | 408 +++++++++++
drivers/tee/optee/rpc.c | 248 +++++++
drivers/tee/optee/supp.c | 210 ++++++
drivers/tee/tee.c | 802 +++++++++++++++++++++
drivers/tee/tee_private.h | 73 ++
drivers/tee/tee_shm.c | 328 +++++++++
drivers/tee/tee_shm_pool.c | 139 ++++
include/linux/arm-smccc.h | 80 ++
include/linux/tee_drv.h | 292 ++++++++
include/uapi/linux/tee.h | 360 +++++++++
34 files changed, 4489 insertions(+)
create mode 100644 Documentation/devicetree/bindings/optee/optee.txt
create mode 100644 Documentation/tee.txt
create mode 100644 arch/arm/kernel/smccc-call.S
create mode 100644 arch/arm/kernel/smccc.c
create mode 100644 arch/arm64/kernel/smccc-call.S
create mode 100644 arch/arm64/kernel/smccc.c
create mode 100644 drivers/tee/Kconfig
create mode 100644 drivers/tee/Makefile
create mode 100644 drivers/tee/optee/Kconfig
create mode 100644 drivers/tee/optee/Makefile
create mode 100644 drivers/tee/optee/call.c
create mode 100644 drivers/tee/optee/core.c
create mode 100644 drivers/tee/optee/optee_msg.h
create mode 100644 drivers/tee/optee/optee_private.h
create mode 100644 drivers/tee/optee/optee_smc.h
create mode 100644 drivers/tee/optee/rpc.c
create mode 100644 drivers/tee/optee/supp.c
create mode 100644 drivers/tee/tee.c
create mode 100644 drivers/tee/tee_private.h
create mode 100644 drivers/tee/tee_shm.c
create mode 100644 drivers/tee/tee_shm_pool.c
create mode 100644 include/linux/arm-smccc.h
create mode 100644 include/linux/tee_drv.h
create mode 100644 include/uapi/linux/tee.h
--
1.9.1